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
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 humangenerated sequences and unusual in truly random sequences: namely, there is no long streak of Hs or Ts. 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 length100 se quences of Hs and Ts. 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 length100 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, well use a recurrence equation . The recurrence equation approach involves two steps: 2 Special Topics 1. Solve some small problems. 2. Solve the nth problem using preceding solutions. Lets 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, lets 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
 Spring '11
 Dr.EricLehman
 Computer Science

Click to edit the document details