06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

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.

“mcs” — 2017/3/3 — 11:21 — page 840 — #848<br />

840<br />

Chapter 19<br />

Random Variables<br />

B<br />

H<br />

A<br />

T<br />

C<br />

H<br />

T<br />

H<br />

T<br />

C<br />

B<br />

Figure 19.10<br />

Outcome Tree <strong>for</strong> Flipping Until HH or TT<br />

Problem 19.16.<br />

A coin with probability p of flipping Heads and probability q WWD 1 p of flipping<br />

tails is repeatedly flipped until two consecutive flips match—that is, until HH or<br />

TT occurs. The outcome tree A <strong>for</strong> this setup is illustrated in Figure 19.10.<br />

Let e.T / be the expected number of flips starting at the root of subtree T of A.<br />

So we’re interested in finding e.A/.<br />

Write a small system of equations involving e.A/; e.B/, and e.C / that could be<br />

solved to find e.A/. You do not need to solve the equations.<br />

Homework Problems<br />

Problem 19.17.<br />

We are given a random vector of n distinct numbers. We then determine the maximum<br />

of these numbers using the following procedure:<br />

Pick the first number. Call it the current maximum. Go through the rest of the<br />

vector (in order) and each time we come across a number (call it x) that exceeds<br />

our current maximum, we update the current maximum with x.<br />

What is the expected number of times we update the current maximum?<br />

Hint: Let X i be the indicator variable <strong>for</strong> the event that the ith element in the<br />

vector is larger than all the previous elements.

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

Saved successfully!

Ooh no, something went wrong!