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

(a) he bets 1 dollar each time (timid strategy).

\(P_j = \frac{1−(\frac{q}{p})^j}{1−(\frac{q}{p})^m}\)

p <- 0.4
q <- 1-p
j <- 1
m <- 8
P_timid <- (1 - (q/p)^j) / ( 1 - (q/p)^m)
P_timid
## [1] 0.02030135

(b) he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy).

If Smith bets all of his dollars he need to have 3 straight wins at probability(p)=0.4. Which is in first he wins (1+1)=2, in second he wins 4 and in third bet he wins 8.

P_bold <- p^3
P_bold
## [1] 0.064

(c) Which strategy gives Smith the better chance of getting out of jail?

Bold strategy gives Smith the better chance of getting out of jail.