HW10
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:
Equations:
f<-function(i)
{
p <- .6
q <- .4
N<-8
iw <- round((1-(q/p)^i),2)
nw <- round((iw/(1-(q/p)^N)),2)
l<- 1-iw
pa<-c(iw,nw,l)
}a<-f(1)Bets 1 dollar each time (timid strategy).
\(\color{red}{\text{The probability he wins \$8 before losing if he bets \$1 is 0.34}}\)
He bets, each time, as much as possible but not more than necessary to bring his fortune up to 8 dollars (bold strategy).
\(\color{red}{\text{The probability he wins \$8 before losing if he bets as much as possible is 0.33}}\)
Which strategy gives Smith the better chance of getting out of jail?
\(\color{red}{\text{The best strategy is to bet \$1 at a time. Below shows probability of winning \$8 is slighly higher per .01}}\)
sapply(seq(0,1, by=.01), f)## [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13]
## [1,] 0 0 0.01 0.01 0.02 0.02 0.02 0.03 0.03 0.04 0.04 0.04 0.05
## [2,] 0 0 0.01 0.01 0.02 0.02 0.02 0.03 0.03 0.04 0.04 0.04 0.05
## [3,] 1 1 0.99 0.99 0.98 0.98 0.98 0.97 0.97 0.96 0.96 0.96 0.95
## [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24]
## [1,] 0.05 0.06 0.06 0.06 0.07 0.07 0.07 0.08 0.08 0.09 0.09
## [2,] 0.05 0.06 0.06 0.06 0.07 0.07 0.07 0.08 0.08 0.09 0.09
## [3,] 0.95 0.94 0.94 0.94 0.93 0.93 0.93 0.92 0.92 0.91 0.91
## [,25] [,26] [,27] [,28] [,29] [,30] [,31] [,32] [,33] [,34] [,35]
## [1,] 0.09 0.1 0.1 0.1 0.11 0.11 0.11 0.12 0.12 0.13 0.13
## [2,] 0.09 0.1 0.1 0.1 0.11 0.11 0.11 0.12 0.12 0.14 0.14
## [3,] 0.91 0.9 0.9 0.9 0.89 0.89 0.89 0.88 0.88 0.87 0.87
## [,36] [,37] [,38] [,39] [,40] [,41] [,42] [,43] [,44] [,45] [,46]
## [1,] 0.13 0.14 0.14 0.14 0.15 0.15 0.15 0.16 0.16 0.16 0.17
## [2,] 0.14 0.15 0.15 0.15 0.16 0.16 0.16 0.17 0.17 0.17 0.18
## [3,] 0.87 0.86 0.86 0.86 0.85 0.85 0.85 0.84 0.84 0.84 0.83
## [,47] [,48] [,49] [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57]
## [1,] 0.17 0.17 0.18 0.18 0.18 0.19 0.19 0.19 0.20 0.20 0.20
## [2,] 0.18 0.18 0.19 0.19 0.19 0.20 0.20 0.20 0.21 0.21 0.21
## [3,] 0.83 0.83 0.82 0.82 0.82 0.81 0.81 0.81 0.80 0.80 0.80
## [,58] [,59] [,60] [,61] [,62] [,63] [,64] [,65] [,66] [,67] [,68]
## [1,] 0.21 0.21 0.21 0.22 0.22 0.22 0.23 0.23 0.23 0.23 0.24
## [2,] 0.22 0.22 0.22 0.23 0.23 0.23 0.24 0.24 0.24 0.24 0.25
## [3,] 0.79 0.79 0.79 0.78 0.78 0.78 0.77 0.77 0.77 0.77 0.76
## [,69] [,70] [,71] [,72] [,73] [,74] [,75] [,76] [,77] [,78] [,79]
## [1,] 0.24 0.24 0.25 0.25 0.25 0.26 0.26 0.26 0.27 0.27 0.27
## [2,] 0.25 0.25 0.26 0.26 0.26 0.27 0.27 0.27 0.28 0.28 0.28
## [3,] 0.76 0.76 0.75 0.75 0.75 0.74 0.74 0.74 0.73 0.73 0.73
## [,80] [,81] [,82] [,83] [,84] [,85] [,86] [,87] [,88] [,89] [,90]
## [1,] 0.27 0.28 0.28 0.28 0.29 0.29 0.29 0.29 0.30 0.30 0.30
## [2,] 0.28 0.29 0.29 0.29 0.30 0.30 0.30 0.30 0.31 0.31 0.31
## [3,] 0.73 0.72 0.72 0.72 0.71 0.71 0.71 0.71 0.70 0.70 0.70
## [,91] [,92] [,93] [,94] [,95] [,96] [,97] [,98] [,99] [,100] [,101]
## [1,] 0.31 0.31 0.31 0.31 0.32 0.32 0.32 0.33 0.33 0.33 0.33
## [2,] 0.32 0.32 0.32 0.32 0.33 0.33 0.33 0.34 0.34 0.34 0.34
## [3,] 0.69 0.69 0.69 0.69 0.68 0.68 0.68 0.67 0.67 0.67 0.67