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)

We can define pk to be the probability that Smith???s stake reaches M without ever having reached 0, given that the initial state is k. We know that p0=0 because there is a 0% chance of reaching M before 0 if Smith starts with k=\(0. Similarly, we know that pM=1 because there is a 100% chance of reaching M before 0 if Smith starts with k=\)M.

Formula: pk=pp(k+1)+qp(k???1),

Since p0=0, pk= [1???(q/p)^k] / [1???(qp)^M]

k <- 1
M <- 8
p <- 0.4
q <- 0.6
pk = (1 - (q/p)^k)/ (1-(q/p)^M)
pk
## [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).

Ans:

??(3) = 0.4??(6)

??(6) = 0.4??(8) + 0.6??(4)

??(4) = 0.4??(8)

??(0) = 0

??(8) = 1

??(3) = 0.256, ??(4) = 0.4 ,??(6) = 0.64

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

Ans: By comparing the third components of the vector ?? we find that the bold strategy gives Smith a better chance to get out jail.