Seyed Masoud Hosseini · Overview · Study log · Ideas · Transcript · RSS feed

Probability · Lecture 48 of 76 · 17:19

A Random Number of Coin Flips

A Random Number of Coin Flips on YouTube

Study guide

What this lecture covers

This is a worked recitation problem on sums of a random number of random variables. A fair six-sided die is rolled to decide how many times a fair coin is flipped, and the problem finds the expectation and variance of the resulting number of heads. It builds on the law of iterated expectations and the law of total variance, applying them to a random sum expressed with Bernoulli indicator variables.

After watching, you should be able to set up a random-sum problem with indicator variables, correctly avoid misapplying linearity of expectation to a random number of terms, and compute both the mean and variance by conditioning on the number of trials.

Key ideas

  • Indicator variable setup: H = X1 + X2 + ... + XN, where each Xi is 1 if the i-th flip is heads and 0 otherwise, and N is the outcome of the die roll (discrete uniform on 1 to 6).
  • Linearity of expectation does not directly apply: since N itself is random, you cannot simply sum E[Xi] over a fixed number of terms; you must condition on N first.
  • Iterated expectation for the mean: E[H] = E[N] * E[Xi] = (7/2) * (1/2) = 7/4.
  • Law of total variance for the variance: Var(H) = Var(E[H|N]) + E[Var(H|N)], combining E[Xi]^2 * Var(N) and Var(Xi) * E[N], giving 77/48.
  • Discrete uniform formulas: for N uniform on integers a to b, E[N] = (a+b)/2 and Var(N) = (b-a)(b-a+2)/12.
  • Splitting one long random sum into independent, identical sums: rolling two dice and flipping the total number of times is equivalent to two independent single-die experiments added together, so the mean and variance of the two-die version simply double.

Walkthrough

Setting up the problem with indicator variables (0:00)

The problem defines N as the die outcome and each Xi as a Bernoulli indicator for whether the i-th coin flip is heads, expressing the total heads count H as a sum of a random number of Bernoulli variables, and warns against applying linearity of expectation naively to a random number of terms.

Computing the expectation by conditioning on N (3:05)

Conditioning on N reduces the problem to a fixed-length sum, giving E[H|N] = N * E[Xi]; applying the law of iterated expectations and plugging in E[Xi] = 1/2 and E[N] = 7/2 yields E[H] = 7/4.

Computing the variance with the law of total variance (6:08)

The problem derives Var(H) = E[Var(H|N)] + Var(E[H|N]), working out each term using the variance of a sum of independent Bernoulli trials and the discrete uniform variance formula for N, arriving at Var(H) = 77/48.

Two dice experiment (10:14)

The problem extends to two dice determining the total number of flips, and reframes the experiment as two independent copies of the single-die experiment run back to back, showing that both the mean and variance simply double to 7/2 and 77/24.

Before you watch

  • Watch the main lecture on iterated expectations (law of iterated expectations and law of total variance) before this problem.
  • Know the mean and variance of a Bernoulli random variable and of a discrete uniform random variable.

Check your understanding

  1. Why can't you apply linearity of expectation directly to X1 + X2 + ... + XN when N is random?
  2. Derive E[H] = 7/4 by conditioning on N.
  3. Walk through both terms of the law of total variance used to find Var(H).
  4. Why does reframing the two-dice experiment as two independent single-die experiments make the mean and variance simply double?

Chapters

From the YouTube description

MIT 6.041SC Probabilistic Systems Analysis and Applied Probability, Fall 2013
View the complete course: http://ocw.mit.edu/6-041SCF13
Instructor: Katie Szeto

License: Creative Commons BY-NC-SA
More information at http://ocw.mit.edu/terms
More courses at http://ocw.mit.edu

← Using the Conditional Expectation and Variance · A Coin with Random Bias →