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
s <- 1
M <- 8
q <- .6
p <- .4
qz <- (((q/p)^s)-1) / (((q/p)^M)-1)
round(qz,2)
## [1] 0.02
The probabilty of Smith getting $8 if he bets $1 each time is around 2%
x <- 3
s <- 3
p <- .4
dbinom(x, s, p)
## [1] 0.064
It seems that the bold strategy p=.064 gives Smith a better chance of getting out of jail as oppose to the timid strategy that gives him p=.02 chance