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
Answer
\[ P = \frac {1 - (\frac {q}{p}) ^ s } {1 - (\frac {q}{p}) ^ M} \]
Given, q = 0.6
p = 0.4,
s = 1,
M = 8
According to formula of Gambler’s Ruin:
\[ P = \frac {1 - (\frac {q}{p}) ^ s } {1 - (\frac {q}{p}) ^ M} = \frac {1 - (\frac {0.6}{0.4}) ^ 1 } {1 - (\frac {0.6}{0.4}) ^ 8} = 0.02\]
# using R
q <- 0.6
p <- 0.4
s <- 1
M <- 8
P <- (1 - (q/p) ^ s) / (1 - (q/p) ^ M)
print(P)
## [1] 0.02030135
The probability of wining is 0.02.
If he bets his entire money each time until 8 dollar. He starts with 1 dollar and must win 3 bets in a row with probability of 0.4
At first bet, If he wins, he ends up with $2.
At second bet, If he wins, he ends up with $4.
At third bet, If he wins, he ends up with $8.
library(stats)
dbinom(3,3,0.4)
## [1] 0.064
The probability of wining is 0.064.