Random Variables and Expectation

Videos (~0 mins)

Reading (~30 mins)

Warmup (~60 mins)

Problem 1

Suppose that I have a biased coin which comes up heads with probability \(p\). I flip it \(n\) times. Let the random variable \(X\) describe the number of heads I observe.

Part A

Let \(n = 3\) and \(p = 0.7\).

  1. Enumerate the entire sample space of possible outcomes. You should have 8 total.
  2. Compute the probability of each of the 8 outcomes, as well as the number of heads.
  3. Compute the expected value of \(X\) in this case.

Part B

Suppose now that we flip \(n\) coins with probability \(p\). Use the linearity property of expectation to prove that \(E(X) = np\).

Note: You may have seen a formula for how to solve this problem in a previous class. You shouldn’t cite this formula to solve this problem – I am asking you to prove the formula.

Problem 2

Your friend offers to play a “game” with you. They have two coins. Coin \(A\) has probability of heads equal to \(\frac{1}{2}\) and coin \(B\) has probability of heads equal to \(q\). In this game,

  1. First, your friend picks one of the two coins. Each coin has probability \(\frac{1}{2}\) of being chosen.
  2. Then, your friend flips the coin. If heads, your friend owes you a coffee. If tails, you owe your friend a coffee.

Part A

You and your friend play this game 10 times. What is the expected number of coffees that your friend owes you after 10 plays?

If you owe your friend some number of coffees, then your answer should be a negative number. In expectation, one of you might owe the other a fractional number of coffees.

Hints:

  • Use linearity of expectation.
  • \(p(H) = p(H|A)p(A) + p(H|B)p(B)\). This formula is sometimes called “the law of total probability,” but it is just an instance of the definition of conditional probability and the addition principle for disjoint events.

Part B

What is the smallest value of \(q\) for which you would be willing to play this game?



© Phil Chodrow, 2023