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). (b) he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy). (c) Which strategy gives Smith the better chance of getting out of jail?
a)
\({ q }_{ z }=\frac { { \frac { q }{ p } }^{ z }-1 }{ { \frac { q }{ p } }^{ M }-1 }\)
\({ q }_{ z }=\frac { { \frac { .6 }{ .4 } }^{ 1 }-1 }{ { \frac { .6 }{ .4 } }^{ 8 }-1 }\)
((3/2) - 1)/((3/2)**8 -1)
## [1] 0.02030135
Using simulation, we can confirm the result:
vec <- c(-1, 1)
probs <- c(.6,.4)
sample(vec, 1, replace = T, prob = probs)
## [1] -1
wins <- 0
samples <- 1000000
for (x in 1:samples){
fortune <- 1
while (T){
fortune <- fortune + sample(vec, 1, replace = T, prob = probs)
if(fortune == 0){
break
}else if (fortune == 8){
wins <- wins + 1
break
}
}
}
wins/samples
## [1] 0.020129
b)
The player needs to “double up” 3 consecutive times to reach $8, so their probability of getting out is \({ .4 }^{ 3 }\)
\(=.064\)
c)
Clearly, fortune favors the bold in this case. What if the player had a considerable advantage instead? If we change the p and q to .7 and .3, they have a 57% chance of escape with the timid strategy, but only a 34% chance of leaving with the bold strategy.
confirming:
vec <- c(-1, 1)
probs <- c(.3,.7)
sample(vec, 1, replace = T, prob = probs)
## [1] 1
wins <- 0
samples <- 1000000
for (x in 1:samples){
fortune <- 1
while (T){
fortune <- fortune + sample(vec, 1, replace = T, prob = probs)
if(fortune == 0){
break
}else if (fortune == 8){
wins <- wins + 1
break
}
}
}
wins/samples
## [1] 0.571982