Computational Mathematics - Markov Chains & Random Walks

Euclides Rodriguez

2022-04-03

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

  1. he bets 1 dollar each time (timid strategy).
i <- 1
n <- 8 
p <- .4
r <- (1-p)/p
P <- (1-r^i)/(1-r^n)
round(P,2)
## [1] 0.02

Resource: https://www.youtube.com/watch?v=97nb6KUxAzc&t=1s
Resource: https://www.probabilitycourse.com/chapter14/Chapter_14.pdf

  1. he bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy).
#Since each loss in this scenario is a total loss he must win consecutively in order to obtain bail.
p <- .4
p^3
## [1] 0.064
  1. Which strategy gives Smith the better chance of getting out of jail?
    Surprisingly, the bold strategy wins in this scenario.