09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.4 FLIPPING COINS 395<br />

But there’s an interesting interplay between the patterns when both are<br />

considered simultaneously. Let SA be the sum of Alice’s winning configurations,<br />

and let Ss be the sum of Bill’s:<br />

SA = HHT + HHHT + THHT + HHHHT + HTHHT + THHHT + . . . ;<br />

Ss = HTT + THTT + HTHTT + TTHTT + THTHTT + TTTHTT + . . . .<br />

Also- taking our cue from the trick that worked when only one pattern was<br />

involved-let us denote by N the sum of all sequences in which neither player<br />

has won so far:<br />

N = 1 +H+T+HH+HT+TH+TT+HHH+HTH+THH+... . (8.77)<br />

Then we can easily verify the following set of equations:<br />

l+N(H+T) = NfS~f.5.s;<br />

NHHT = SA ; (8.78)<br />

NHTT = SATTS~.<br />

If we now set H = T = i, the resulting value of SA becomes the probability<br />

that Alice wins, and Ss becomes the probability that Bill wins. The three<br />

equations reduce to<br />

1 +N = N +sA +Ss; ;N = s,; ;N = $A +sg;<br />

and we find SA = f , Ss = f . Alice will win about twice as often as Bill!<br />

In a generalization of this game, Alice and Bill choose patterns A and B<br />

of heads and tails, and they flip coins until either A or B appears. The<br />

two patterns need not have the same length, but we assume that A doesn’t<br />

occur within B, nor does B occur within A. (Otherwise the game would be<br />

degenerate. For example, if A = HT and B = THTH, poor Bill could never win;<br />

and if A = HTH and B = TH, both players might claim victory simultaneously.)<br />

Then we can write three equations analogous to (8.73) and (8.78):<br />

1 +N(H+T) = N+SA+S~;<br />

min(l,m)<br />

NA = SA i A(lPkj [A (k’ =A(kj] + sp, x A(lmk) [Bck) =Aiki];<br />

k=l k=l<br />

min(l,m)<br />

NB = SA x B lrnpk’ [Atk’ = B(k)]<br />

k=l<br />

+ Ss 5 BCmPk) [Bck) = B,,,] .<br />

k=l<br />

(8.79)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!