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.

” ‘You really are an<br />

automaton-a calculating<br />

machine, ’<br />

I cried. ‘There is<br />

something positively<br />

inhuman in you at<br />

times.“’<br />

-J. H. Watson (701<br />

8.4 FLIPPING COINS 391<br />

Now let’s try a more intricate experiment: We will flip coins until the<br />

pattern THTTH is first obtained. The sum of winning positions is now<br />

S = THTTH + HTHTTH + TTHTTH<br />

+ HHTHTTH + HTTHTTH + THTHTTH + TTTHTTH + . ;<br />

this sum is more difficult to describe than the previous one. If we go back to<br />

the method by which we solved the domino problems in Chapter 7, we can<br />

obtain a <strong>for</strong>mula <strong>for</strong> S by considering it as a “finite state language” defined<br />

by the following “automaton”:<br />

The elementary events in the probability space are the sequences of H’s and<br />

T’s that lead from state 0 to state 5. Suppose, <strong>for</strong> example, that we have<br />

just seen THT; then we are in state 3. Flipping tails now takes us to state 4;<br />

flipping heads in state 3 would take us to state 2 (not all the way back to<br />

state 0, since the TH we’ve just seen may be followed by TTH).<br />

In this <strong>for</strong>mulation, we can let Sk be the sum of all sequences of H’s and<br />

T’s that lead to state k: it follows that<br />

so = l+SoH+SzH,<br />

S1 = SoT+S,T+SqT,<br />

S2 = S, H+ S3H,<br />

S3 = S2T,<br />

S4 = SST,<br />

S5 = S4 H.<br />

Now the sum S in our problem is S5; we can obtain it by solving these six<br />

equations in the six unknowns SO, S1, . . . , Sg. Replacing H by pz and T by qz<br />

gives generating functions where the coefficient of z” in Sk is the probability<br />

that we are in state k after n flips.<br />

In the same way, any diagram of transitions between states, where the<br />

transition from state j to state k occurs with given probability pj,k, leads to<br />

a set of simultaneous linear equations whose solutions are generating functions<br />

<strong>for</strong> the state probabilities after n transitions have occurred. Systems<br />

of this kind are called Markov processes, and the theory of their behavior is<br />

intimately related to the theory of linear equations.

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

Saved successfully!

Ooh no, something went wrong!