N Selina Assignment 10 - Data 605

Noori Selina

Smith is in jail and has 1 dollar; he can get out on bail if he has 8 dollars. A guard agrees to make a series of bets with him. If Smith bets A dollars, he wins A dollars with probability .4 and loses A dollars with probability .6. Find the probability that he wins 8 dollars before losing all of his money if

  1. he bets 1 dollar each time (timid strategy). When using the timid strategy, Smith possesses approximately a 2.03% probability of successfully attaining 8 dollars.
q_timid <- matrix(c(0,.4,0,0,0,0,0,.6,0,.4,0,0,0,0,0,.6,0,.4,0,0,0,0,0,.6,0,.4,0,0,0,0,0,.6,0,.4,0,0,0,0,0,.6,0,.4,0,0,0,0,0,.6,0), c(7,7), byrow = TRUE)
identity <- diag(7)
n_timid <- solve(identity-q_timid)
r_timid <- matrix(c(.6,0,0,0,0,0,0,0,0,0,0,0,0,.4), nrow=7, byrow = TRUE)
b_timid <- n_timid %*% r_timid
print(b_timid)
##           [,1]       [,2]
## [1,] 0.9796987 0.02030135
## [2,] 0.9492466 0.05075337
## [3,] 0.9035686 0.09643140
## [4,] 0.8350515 0.16494845
## [5,] 0.7322760 0.26772403
## [6,] 0.5781126 0.42188739
## [7,] 0.3468676 0.65313243
  1. he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy). When using the bold strategy and commencing with 1 dollar, Smith holds a 6.4% likelihood of reaching 8 dollars.
q_bold <- matrix(c(0,.4,0,0,0,0,0,0,0,0,.4,0,0,0,0,0,0,0,0,.4,0,0,0,0,0,0,0,0,0,.6,0,0,0,0,0,0,0,0,.6,0,0,0,0,0,0,0,0,.6,0), c(7,7), byrow = TRUE)
n_bold <- solve(identity-q_bold)
r_bold <- matrix(c(.6,0,.6,0,.6,0,.6,.4,0,.4,0,.4,0,.4), nrow=7, byrow = TRUE)
b_bold <- n_bold %*% r_bold
print(b_bold)
##       [,1]  [,2]
## [1,] 0.936 0.064
## [2,] 0.840 0.160
## [3,] 0.744 0.256
## [4,] 0.600 0.400
## [5,] 0.504 0.496
## [6,] 0.360 0.640
## [7,] 0.216 0.784
  1. The bold strategy gives Smith a better shot at getting out of jail. Specifically, it’s more likely for him to win 8 dollars before running out of money compared to the timid strategy. The timid approach has a probability of approximately 2.03%, whereas the bold strategy offers a higher chance at approximately 6.4%.