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.

394 DISCRETE PROBABILITY<br />

In the special case p = i we can interpret these <strong>for</strong>mulas in a particularly<br />

simple way. Given a pattern A of m heads and tails, let<br />

A:A = fIkpl [Ack’ =A(kj] .<br />

k=l<br />

(8.76)<br />

We can easily find the binary representation of this number by placing a ‘1’<br />

under each position such that the string matches itself perfectly when it is<br />

superimposed on a copy of itself that has been shifted to start in this position:<br />

A = HTHTHHTHTH<br />

A:A=(1000010101)2=-512+16+4+l =533<br />

HTHTHHTHTH J<br />

HTHTHHTHTH<br />

HTHTHHTHTH<br />

HTHTHHTHTH<br />

HTHTHHTHTH<br />

HTHTHHTH'TH J<br />

HTHTHHTHTH<br />

HTHTHHTHTH J<br />

HTHTHHTHTH<br />

HTHTHHTHTH J<br />

Equation (8.74) now tells us that the expected number of flips until pattern A<br />

appears is exactly 2(A:A), if we use a fair coin, because &kj = Ik when<br />

p=q=$. This result, first discovered by the Soviet mathematician A. D. “Chem bol’she<br />

Solov’ev in 1966 [271], seems paradoxical at first glance: Patterns with no periodov u nasheg0<br />

s/ova, tern pozzhe<br />

self-overlaps occur sooner th,an overlapping patterns do! It takes almost twice on0 poMl~ets%”<br />

as long to encounter HHHHH as it does to encounter HHHHT or THHHH. -A. D. Solov’ev<br />

Now let’s consider an amusing game that was invented by (of all people)<br />

Walter Penney [231] in 196!3. Alice and Bill flip a coin until either HHT or<br />

HTT occurs; Alice wins if the pattern HHT comes first, Bill wins if HTT comes<br />

first. This game-now called “Penney ante” -certainly seems to be fair, if<br />

played with a fair coin, because both patterns HHT and HTT have the same<br />

characteristics if we look at them in isolation: The probability generating<br />

function <strong>for</strong> the waiting tim’e until HHT first occurs is<br />

G(z) =<br />

z3<br />

z3 - 8(2- 1) ’<br />

and the same is true <strong>for</strong> HTT. There<strong>for</strong>e neither Alice nor Bill has an advan-<br />

Of w not! Who<br />

could they have an<br />

tage, if they play solitaire. advantage over?

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

Saved successfully!

Ooh no, something went wrong!