Lesson 13: Expected Values

Meike Niederhausen and Nicky Wakim

2025-11-10

Learning Objectives

  1. Define the expected value for discrete and continuous RVs

  2. Calculate the expected value (mean) of a single discrete RV

  3. Calculate the expected value (mean) of a single continuous RV

  4. Calculate expected value for the sum of discrete or continuous RVs

  5. Calculate expected value for joint densities (continuous RVs)

Where are we?

Learning Objectives

  1. Define the expected value for discrete and continuous RVs
  1. Calculate the expected value (mean) of a single discrete RV

  2. Calculate the expected value (mean) of a single continuous RV

  3. Calculate expected value for the sum of discrete or continuous RVs

  4. Calculate expected value for joint densities (continuous RVs)

Our good and fair friend, the 6-sided die

Example 1

Suppose you roll a fair 6-sided die. What value do you expect to get?

What is an expected value?

Definition: Expected value of discrete RV

The expected value of a discrete RV \(X\) that takes on values \(x_1, x_2, \ldots, x_n\) is \[\mathbb{E}[X] = \sum_{i=1}^n x_ip_X(x_i)\] where \(n\) can be \(\infty\)

Definition: Expected value of continuous RV

The expected value of a continuous RV \(X\) is \[\mathbb{E}[X] = \displaystyle\int_{-\infty}^\infty xf_X(x) dx\] where we adjust the integrand based on the bounds of \(X\)

  • Expected values are not necessarily an actual outcome
    • In previous example, we cannot roll a 3.5
    • It could be that our expected value is not in the sample space (\(E(X) \notin S\))

Learning Objectives

  1. Define the expected value for discrete and continuous RVs
  1. Calculate the expected value (mean) of a single discrete RV
  1. Calculate the expected value (mean) of a single continuous RV

  2. Calculate expected value for the sum of discrete or continuous RVs

  3. Calculate expected value for joint densities (continuous RVs)

Our good and not-so-fair friend, the 6-sided die

Example 2

Suppose the die is 6-sided, but not fair. And the probabilities of each side is distributed as:

\(x\) \(p_X(x)\)
1 0.10
2 0.05
3 0.02
4 0.30
5 0.50
6 0.03

What value do you expect to get on a roll?

Expected value of a Bernoulli distribution

Example 3

Suppose \[X = \left\{ \begin{array}{ll} 1 & \quad \mathrm{with\ probability}\ p \quad\mathrm{(success)}\\ 0 & \quad \mathrm{with\ probability}\ 1-p \quad\mathrm{(failure)} \end{array} \right.\] Find the expected value of \(X\).

Let’s slightly change our random variable

Example 4

Suppose \[X = \left\{ \begin{array}{ll} 1 & \quad \mathrm{with\ probability}\ p \\ -1 & \quad \mathrm{with\ probability}\ 1-p \end{array} \right.\] Find the expected value of \(X\).

Learning Objectives

  1. Define the expected value for discrete and continuous RVs

  2. Calculate the expected value (mean) of a single discrete RV

  1. Calculate the expected value (mean) of a single continuous RV
  1. Calculate expected value for the sum of discrete or continuous RVs

  2. Calculate expected value for joint densities (continuous RVs)

Expected Value of the Uniform Distribution

Example 5

Let \(f_X(x)= \frac{1}{b-a}\), for \(a \leq x \leq b\). Find \(\mathbb{E}[X]\).

Expected Value of the Exponential Distribution

Example 6

Let \(f_X(x)= \lambda e^{-\lambda x}\), for \(x > 0\) and \(\lambda> 0\). Find \(\mathbb{E}[X]\).

Integrating by Parts

\(\displaystyle\int_a^b u dv = uv\bigg|^b_a - \displaystyle\int_a^b vdu\)

Learning Objectives

  1. Define the expected value for discrete and continuous RVs

  2. Calculate the expected value (mean) of a single discrete RV

  3. Calculate the expected value (mean) of a single continuous RV

  1. Calculate expected value for the sum of discrete or continuous RVs
  1. Calculate expected value for joint densities (continuous RVs)

Revisiting our two card draw

Example 7

Suppose you draw 2 cards from a standard deck of cards with replacement. Let \(X\) be the number of hearts you draw. Find \(\mathbb{E}[X]\).

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

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

Sums of Random Variables

Theorem: Sum of random variables

For RVs (discrete or continuous) \(X_i\) and constants \(a_i\), \(i=1,2,\dots, n\), \[\mathbb{E}\Bigg[\sum_{i=1}^n a_iX_i\Bigg] = \sum_{i=1}^n a_i\mathbb{E}[X_i] .\] Remark: The theorem holds for infinitely RV’s \(X_i\) as well.

  • For two RVs, \(X\) and \(Y\):
    • We can say \(E[X+Y] = E[X] + E[Y]\)
    • … and constant numbers \(a\) and \(b\), we can also say \(E[aX+bY] = aE[X] + bE[Y]\)
    • We can also also say \(E[X-Y] = E[X] - E[Y]\), since \(b=-1\)

Corollaries from Theorem

Function with two constants

For a RV \(X\), and constants \(a\) and \(b\), \[\mathbb{E}[aX+b] = a\mathbb{E}[X] + b.\]

Expected value of sum of identically distributed RVs

If \(X_i\), \(i=1,2,\dots, n\), are identically distributed RV’s, then \[\mathbb{E}\bigg[\sum_{i=1}^n X_i\bigg] = n\mathbb{E}[X_1] .\]

Cost of hotel rooms

Example 8

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. In addition, there is a 10% tourism tax for each room. What is the expected cost for the 30 hotel rooms?

Learning Objectives

  1. Define the expected value for discrete and continuous RVs

  2. Calculate the expected value (mean) of a single discrete RV

  3. Calculate the expected value (mean) of a single continuous RV

  4. Calculate expected value for the sum of discrete or continuous RVs

  1. Calculate expected value for joint densities (continuous RVs)

Expected value of one RV from joint pdf

If you have a joint distribution \(f_{X,Y}(x,y)\) and want to calculate \(\mathbb{E}[X]\), you have two options:

  1. Find \(f_X(x)\) and use it to calculate \(\mathbb{E}[X]\).

  2. Calculate \(\mathbb{E}[X]\) using the joint density: \[\mathbb{E}[X] = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}x f_{X,Y}(x,y)dydx.\]

You can do the same for \(\mathbb{E}[Y]\)!

Option 1: Find marginal first

Example 9

Let \(f_{X,Y}(x,y)= 2e^{-(x+y)}\), for \(0 \leq x \leq y\). Find \(\mathbb{E}[X]\).

Do this one at home by finding \(f_X(x)\) then \(\mathbb{E}[X] = \displaystyle\int_{-\infty}^\infty xf_X(x) dx\). See if you get the same result as next page’s answer!

Option 2: Expected value from a joint distribution

Example 9

Let \(f_{X,Y}(x,y)= 2e^{-(x+y)}\), for \(0 \leq x \leq y\). Find \(\mathbb{E}[X]\).

Learning Objectives

  1. Define the expected value for discrete and continuous RVs

  2. Calculate the expected value (mean) of a single discrete RV

  3. Calculate the expected value (mean) of a single continuous RV

  4. Calculate expected value for the sum of discrete or continuous RVs

  5. Calculate expected value for joint densities (continuous RVs)