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

Sol)

s <- 1
m <- 8 
q <- .6
P <- .4

Timid_strategy <- (((q/P)^s)-1) / (((q/P)^m)-1)
round(Timid_strategy,4)
## [1] 0.0203

Here, the probabilty of Smith getting $8 if he bet $1 each time to be around 2%.

(b) He bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy).

Sol) If Smith bets as much as he can he will need to win 3 times in a row to get to $8 ($1,$2,$4).

x <- 3 
s <- 3
P <- .4
(Bold_strategy <- dbinom(x, s, P)) 
## [1] 0.064

This resembles as binomial distribution with a probability of .4. Using the bold method Smith has a 6% chance of getting $8.

(c) Which strategy gives Smith the better chance of getting out of jail?

Sol) Smith choose bold strategy of getting out of jail because the probability of bold strategy is High(6%).