Homework 10, part A
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
This is the “The Gambler’s Ruin Problem” (p. 487, probability book)
P(w) = 0.4
P(l) = 0.6
if l is not equal to w, then P(winning) = ((l/w)^1 - 1)/((l/w)^8-1)
w <- 0.4
l <- 0.6
z = 1
m = 8
((l/w)^z - 1)/((l/w)^m-1)
## [1] 0.02030135
0.02030135 is the probability that Smith wins 8 dollars before losing all of his money if he bets 1 dollar each time.
If he does win his purse will follow the following sequence: 1,2,4,8. If he starts with 1 dollar and must win 3 bets in a row
P(w) = 0.4
dbinom(3,3,0.4)
## [1] 0.064
0.064 is the probability that he wins 8 dollars before losing all of his money (bold strategy)
Bold strategy gives Smith the better chance of getting out of jail (more than triples).