l24_spcl_topics

# l24_spcl_topics - 6.042/18.062J Mathematics for Computer...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6.042/18.062J Mathematics for Computer Science May 12, 2005 Srini Devadas and Eric Lehman Lecture Notes Special Topics 1 Streaks Was the table of H ’s and T ’s below generated by flipping a fair coin 100 times, or by someone tapping the H and T keys in a what felt like a random way? HTTTHTHTTHTTHTHTHTHT TTTHHTHHTHTHTTHHHTHT HHTHHTTTHHHTHTTHHHHT THTTHHTHTHTHTHTTHTHH HTTHHHTHTHHHTHTHHHTH There is no way to be sure. However, this sequence has a distinctive feature that is com- mon in “random” human-generated sequences and unusual in truly random sequences: namely, there is no long streak of H’s or T’s. In fact, no symbol appears above more than four times in a row. How likely is that? If we flip a fair coin 100 times, what is the probability that we never get five heads in a row? 1.1 From a Probability Problem to a Counting Problem The sample space for this experiment is { H,T } 100 ; that is, the set of all length-100 se- quences of H’s and T’s. If the coin tosses are fair and independent, then all 2 100 such se- quences are equally likely. Therefore, we need only count the number of sequences with no streak of five heads; given that, the probability that a random length-100 sequence contains no such streak is: Pr ( sequence has no HHHHH ) = # sequences with no HHHHH 2 100 This is a common situation. We have reduced a probability problem to a counting problem. Unfortunatley, we have no hope of solving the counting problem by direct computation. No computer can consider all 2 100 sequences of H ’s and T ’s, keeping track of how many lack a streak of five heads. But, on the bright side, there is a big bag of mathematical tricks for solving counting problems. In this case, we’ll use a recurrence equation . The recurrence equation approach involves two steps: 2 Special Topics 1. Solve some small problems. 2. Solve the n-th problem using preceding solutions. Let’s see how this approach plays out in the analysis of streaks. 1.2 Step 1: Solve Small Instances Let S n be the set of length- n sequences of H ’s and T ’s that do not contain a streak of five heads. Our eventual goal is to compute | S 100 | . But for now, let’s just compute | S n | for some very small values of n : | S 1 | = 2 ( H and T ) | S 2 | = 4 ( HH , HT , TH , and TT ) | S 3 | = 8 | S 4 | = 16 | S 5 | = 31 ( HHHHH is excluded!) These are called base cases ....
View Full Document

{[ snackBarMessage ]}

### Page1 / 7

l24_spcl_topics - 6.042/18.062J Mathematics for Computer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online