This preview shows pages 1–2. 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: CS 70 Discrete Mathematics and Probability Theory Fall 2010 Tse/Wagner Soln 10 1. (50 pts.) Expectations Solve each of the following problems using linearity of expectation. Clearly explain your methods. (Hint: for each problem, think about what the appropriate random variables should be and define them explicitly.) (a) A monkey types at a 26-letter keyboard with one key corresponding to each of the lower-case English letters. Each keystroke is chosen independently and uniformly at random from the 26 possibilities. If the monkey types 1 million letters, what is the expected number of times the sequence bonbon" appears? Answer: Define the random variable X to be the number of times bonbon appears in the 1 million letters the monkey types. We express X as the sum X = 10 6- 5 i = 1 X i where the random variable X i is X i = ( 1 if characters i ,..., i + 5 are bonbon otherwise. Since each letter is independent, the probability that any given string of 6 letters is bonbon is 1 26 6 , and therefore Pr [ X i = 1 ] = 1 26 6 . Thus, E ( X i ) = 1 26 6 and so by linearity of expectation E ( X ) = E ( 10 6- 5 i = 1 X i ) = 10 6- 5 i = 1 E ( X i ) = 10 6- 5 i = 1 1 26 6 = ( 10 6- 5 ) 1 26 6 . Comment: This solution is fine, despite the fact that the X i s are not mutually independent. Linearity of expectation can be applied even if the underlying random variables are not independent. (b) A coin with Heads probability p is flipped n times. A run is a maximal sequence of consecutive flips that are all the same. (Thus, for example, the sequence HTHHHTTH with n = 8 has five runs.) Show that the expected number of runs is 1 + 2 ( n- 1 ) p ( 1- p ) . Justify your answer carefully. Answer: Again, we use linearity of expectation. Define the random variable X to be the number of runs in a sequence, and define the indicator random variable X i as X i = ( 1 if the i th flip is the beginning of a run otherwise....
View Full Document
This note was uploaded on 12/08/2010 for the course CS 70 taught by Professor Papadimitrou during the Fall '08 term at University of California, Berkeley.
- Fall '08