Chapter 12: Variance of Discrete RVs

Meike Niederhausen and Nicky Wakim

2023-10-23

Learning Objectives

  1. Calculate the variance and standard deviation of discrete random variables
  2. Calculate the variance of sums of discrete random variables
  3. Calculate the variance of functions of discrete random variables

Let’s start building the variance through expected values of functions

Example 1

Let \(g\) be a function and let \(g(x) = ax+b\), for real-valued constants \(a\) and \(b\). What is \(\mathbb{E}[g(X)]\)?

What is the expected value of a function?

Definition: Expected value of function of RV

For any function \(g\) and discrete r.v. \(X\), the expected value of \(g(X)\) is \[\mathbb{E}[g(X)] = \sum_{\{all\ x\}}\ g(x) p_X(x).\]

Let’s revisit the card example (1/2)

Example 2

Suppose you draw 2 cards from a standard deck of cards with replacement. Let \(X\) be the number of hearts you draw.

  1. Find \(\mathbb{E}[X^2]\).

Recall Binomial RV with \(n=2\):

\[p_X(x) = {2 \choose x}p^x(1-p)^{2-x} \text{  for } x = 0, 1, 2\]

Let’s revisit the card example (2/2)

Example 2

Suppose you draw 2 cards from a standard deck of cards with replacement. Let \(X\) be the number of hearts you draw.

  1. Find \(\mathbb{E}\big[\big(X-\frac{1}{2}\big)^2\big]\).

Recall Binomial RV with \(n=2\):

\[p_X(x) = {2 \choose x}p^x(1-p)^{2-x} \text{  for } x = 0, 1, 2\]

Variance of a RV

Definition: Variance of RV

The variance of a r.v. \(X\), with (finite) expected value \(\mu_X=\mathbb{E}[X]\) is \[\sigma_X^2=Var(X)=\mathbb{E}[(X-\mu_X)^2] = \mathbb{E}[(X-\mathbb{E}[X])^2].\]

Definition: Standard deviation of RV

The standard deviation of a r.v. \(X\) is \[\sigma_X = SD(X) = \sqrt{\sigma_X^2}=\sqrt{Var(X)}.\]

Let’s calculate the variance and prove it!

Lemma 6: “Computation formula” for Variance

The variance of a r.v. \(X\), can be computed as \[\begin{align} \sigma_X^2 & =Var(X) \\ & = \mathbb{E}[X^2]-\mu_X^2 \\ & = \mathbb{E}[X^2] - (\mathbb{E}[X])^2 \end{align}\]

(break) Some Important Variance and Expected Values Results

Variance of a function with a single RV

Lemma 7

For a r.v. \(X\) and constants \(a\) and \(b\), \[Var(aX+b) = a^2Var(X).\]

Proof will be exercise in homework. It’s fun! In a mathy kinda way.

Important results for independent RVs

Theorem 8

For independent r.v.’s \(X\) and \(Y\), and functions \(g\) and \(h\), \[\mathbb{E}[g(X)h(Y)] = \mathbb{E}[g(X)]\mathbb{E}[h(Y)].\]

Corollary 1

For independent r.v.’s \(X\) and \(Y\), \[\mathbb{E}[XY] = \mathbb{E}[X]\mathbb{E}[Y].\]

Variance of sum of independent discrete RVs

Theorem 9: Variance of sum of independent discrete r.v.’s

For independent discrete r.v.’s \(X_i\) and constants \(a_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n a_iX_i\Bigg) = \sum_{i=1}^n a_i^2Var(X_i).\]

Corollaries

Corollary 2

For independent discrete r.v.’s \(X_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n X_i\Bigg) = \sum_{i=1}^n Var(X_i).\]

Corollary 3

For independent identically distributed (i.i.d.) discrete r.v.’s \(X_i\), \(i=1,2,\dots, n\), \[Var\Bigg(\sum_{i=1}^n X_i\Bigg) = n Var(X_1).\]

Let’s revisit our ghost problems without replacement

Example 3.1

The ghost is trick-or-treating at a different house now. In this case it is known that the bag of candy has 10 chocolates, 20 lollipops, and 30 laffy taffies. The ghost grabs a handful of five pieces of candy. What is the variance for the number of chocolates the ghost takes? Let’s solve this for the cases without replacement.

Recall probability without replacement:

\[p_X(x) = \dfrac{{K \choose x}{N-K \choose n-x}}{{N \choose n}} \]

Let’s revisit our ghost problems with replacement

Example 3.2

The ghost is trick-or-treating at a different house now. In this case it is known that the bag of candy has 10 chocolates, 20 lollipops, and 30 laffy taffies. The ghost grabs a handful of five pieces of candy. What is the variance for the number of chocolates the ghost takes? Let’s solve this for the cases with replacement.

Recall probability with replacement:

\[ p_X(x) = {n \choose k}p^k(1-p)^{n-k} \]

Back to our hotel example from Chapter 11

Example 4

A tour group is planning a visit to the city of Minneapolis and needs to book 30 hotel rooms. The average price of a room is $200 with standard deviation $10. In addition, there is a 10% tourism tax for each room. What is the standard deviation of the cost for the 30 hotel rooms?

Problem to do at home if we don’t have enough time.