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
We can calculate this with the following expression:
\[ \frac{1 - \frac{P_W}{P_L}}{1 - (\frac{P_W}{P_L})^n} \]
pw = .4
pl = .6
n = 8
(1-(pl/pw))/(1-(pl/pw)^n)
## [1] 0.02030135
As 8 is equal to 2^3, we know that our prisoner can only win in this strategy with 3 straight wins. He starts with $1, then provided he wins-out will have $2, $4, then $8. If he loses any game, he will be out.
We know his probability of winning is \[ (P_w)^3\]
pw^3
## [1] 0.064
As .064>.0203, we know that the bold strategy yields the better probability.