# Probability and Statistics – 1 : coin flips

February 10, 2011 Leave a comment

**Question 1.** I toss a fair coin until I obtain Heads. How many times am I expected to toss the coin (this number includes the coin toss which resulted in the Head)? What is the variance of the number of coin tosses?

Solution. This is exactly the geometric distribution with p = 0.5. Hence, I am expected to toss the coin 1/p = 2 times.

We can derive it as follows:

Let be the random variable denoting the number of coin tosses.

If we get a H in the 1st toss, we are done. —- . ( the probability is 1/2 since it is a fair coin.)

For us to have , the 1st toss must result in a T, and the 2nd in a H. —-

.

Similarly, only if we get the sequence T T H in our 1st 3 coin tosses. —- .

Thus, we have that,

Subtracting the 2nd equation from the 1st, we get:

.

—-

Variance of X:

We have that,

Subtracting the 2nd equation from the 1st:

.

Therefore, .

—–

**Question 2**.I toss a fair coin until I get either HH or TT. Let X be the number of coin tosses I make. Find E[X].

Solution.

The 1st coin toss can result in either a H or a T. If we are given that X = k, then the remaining k-1 coin tosses are uniquely determined given the result of the 1st toss. The fixed sequence occurs with probability .

Thus, we have that,

Solving, we get, .

—-