In: Math
Suppose you are tossing a fair coin. You will keep tossing until
you get two consecutive
heads. Let, X represents the number of tosses you will need. So the
minimum value of X is
two.
(a) Using hand calculation, calculate P[X = 2], P[X = 3], P[X = 4]
and P[X = 5].
(b) How to write an R function that keeps tossing the fair coin
until two consecutive heads
show up and returns the total number of tosses. (run this function
1000 times)