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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

396 DISCRETE PROBABILITY<br />

Here 1 is the length of A and m is the length of B. For example, if we have<br />

A = HTTHTHTH and B = THTHTTH, the two pattern-dependent equations are<br />

N HTTHTHTH = SA TTHTHTH + SA + Ss TTHTHTH + Ss THTH ;<br />

N THTHTTH = SA THTTH + SA TTH + Ss THTTH + Ss .<br />

We obtain the victory probabilities by setting H = T = i, if we assume that a<br />

fair coin is being used; this reduces the two crucial equations to<br />

N = S/I x zk ]Alk’ = A.(k)] + Ss x 2k [Bckl = Ackj] ;<br />

k=l<br />

k=l<br />

N =SA 2k [Alk) = B,,,] + Ss x 2k [Bckl = B(k)] .<br />

k=l k=l<br />

(8.80)<br />

We can see what’s going on if we generalize the A:A operation of (8.76) to a<br />

function of two independent strings A and B:<br />

min(l,m)<br />

A:B = x 2kp’ [Alk’ =Bck,] .<br />

k=l<br />

Equations (8.80) now become simply<br />

S*(A:A) + Ss(B:A) = S*(A:B) + Ss(B:B) ;<br />

the odds in Alice’s favor are<br />

SA B:B - B:A<br />

- SB = A:A-A:B<br />

(8.81)<br />

(8.82)<br />

(This beautiful <strong>for</strong>mula was discovered by John Horton Conway [ill].)<br />

For example, if A = HTTHTHTH and B = THTHTTH as above, we have<br />

A:A = (10000001)2 = 129, A:B = (0001010)2 = 10, B:A = (0001001)2 = 9,<br />

and B:B = (1000010)2 = 66; so the ratio SA/SB is (66-9)/(129-10) = 57/l 19.<br />

Alice will win this one only 57 times out of every 176, on the average.<br />

Strange things can happen in Penney’s game. For example, the pattern<br />

HHTH wins over the pattern HTHH with 3/2 odds, and HTHH wins over THHH with<br />

7/5 odds. So HHTH ought to ‘be much better than THHH. Yet THHH actually wins<br />

over HHTH, with 7/5 odds! ‘The relation between patterns is not transitive. In<br />

fact, exercise 57 proves that if Alice chooses any pattern ri ~2 . . ~1 of length<br />

1 3 3, Bill can always ensure better than even chances of winning if he chooses<br />

the pattern ;S2rlr2 . . . ~1~1, where ?2 is the heads/tails opposite of ~2.<br />

Odd, odd.

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

Saved successfully!

Ooh no, something went wrong!