Mathematics for Computer Science
e9ck2Ar
e9ck2Ar
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
“mcs” — 2017/3/3 — 11:21 — page 913 — #921<br />
21.1. Gambler’s Ruin 913<br />
For fixed p and T , let e n be the expected number of bets until the game ends<br />
when the gambler’s initial capital is n dollars. Since the game is over in zero steps<br />
if n D 0 or T , the boundary conditions this time are e 0 D e T D 0.<br />
Otherwise, the gambler starts with n dollars, where 0 < n < T . Now by the<br />
conditional expectation rule, the expected number of steps can be broken down<br />
into the expected number of steps given the outcome of the first bet weighted by<br />
the probability of that outcome. But after the gambler wins the first bet, his capital<br />
is n C 1, so he can expect to make another e nC1 bets. That is,<br />
ExŒ#bets starting with $n j gambler wins first bet D 1 C e nC1 :<br />
Similarly, after the gambler loses his first bet, he can expect to make another e n 1<br />
bets:<br />
So we have<br />
ExŒ#bets starting with $n j gambler loses first bet D 1 C e n 1 :<br />
e n D p ExŒ#bets starting with $n j gambler wins first bet C q ExŒ#bets starting with $n j gambler loses<br />
D p.1 C e nC1 / C q.1 C e n 1 / D pe nC1 C qe n 1 C 1:<br />
This yields the linear recurrence<br />
e nC1 D 1 p e n<br />
q<br />
p e n 1<br />
The routine solution of this linear recurrence yields:<br />
1<br />
p : (21.10)<br />
Theorem 21.1.3. In the Gambler’s Ruin game with initial capital n, target T , and<br />
probability p of winning each bet,<br />
8<br />
ˆ<<br />
ExŒnumber of bets D<br />
w n T n<br />
p q<br />
ˆ:<br />
n.T n/ <strong>for</strong> p D 1 2 ;<br />
<strong>for</strong> p ¤ 1 2<br />
where w n D .r n 1/=.r T 1/<br />
D PrŒthe gambler wins:<br />
In the unbiased case, (21.11) can be rephrased simply as<br />
(21.11)<br />
ExŒnumber of fair bets D initial capital intended profit: (21.12)<br />
For example, if the gambler starts with $10 dollars and plays until he is broke or<br />
ahead $10, then 10 10 D 100 bets are required on average. If he starts with $500<br />
and plays until he is broke or ahead $100, then the expected number of bets until<br />
the game is over is 500 100 D 50; 000. This simple <strong>for</strong>mula (21.12) cries out <strong>for</strong><br />
an intuitive proof, but we have not found one (where are you, Pascal?).