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 he bets 1 dollar each time (timid strategy).

So if we use the gamblers ruin formula of: (1-(q/p)(i))/(1-(q/p)N)

(1-(3/2))/(1-(3/2)^8)
## [1] 0.02030135

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

So if we take it as he bets essentially his whole value every round, it would progress like this:

1 -> 2 -> 4 -> 8

Any break from this pattern, and we would loose everything and the game would end.

There fore, we would need to calculate the probability that he wins 3 times in a row, as that would bring him to 8 dollars!

Seeing as 0.4 is his win rate, and they are all independent:

.4^3
## [1] 0.064

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

The Bold Strategy gives Smith the best chance of getting out of Jail, as it is 3 times more likely to result in a win. This is mostly due to the fact that the game has a high house advantage.