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).

Gambler’s Ruin Probabilities

\[ x_n = \frac{1 - (q/p)^n}{1 - (q/p)^N} \] p = 0.4 q = 0.6 n = 1 N = 8

x = (1 - (0.6/0.4)^1)/(1 - (0.6/0.4)^8)
  1. he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy).

This is an absorbing transition matrix. You are going to only end up at either 0 or 8.

m <- matrix(c(1, 0, 0, 0, 0,
              .6, 0, .4, 0, 0,
              .6, 0, 0, .4, 0,
              .6, 0, 0, 0, .4,
               0, 0, 0, 0, 1), ncol = 5, byrow = TRUE)

rownames(m)=c("0","1","2","4", "8")
colnames(m)=c("0","1","2","4","8")

runs <- new("markovchain", transitionMatrix = m)

start_point<- c(0,1,0,0,0)

start_point * runs^8
##          0 1 2 4     8
## [1,] 0.936 0 0 0 0.064
  1. Which strategy gives Smith the better chance of getting out of jail?

My intuition is that the fewer bets you make the better becasue your chance of winning is less that 50% on each bet. This played out in practice.

The bold strategy gives you the best odds of getting out of jail.