Chapter 29: Variance of Continuous Random Variables

Meike Niederhausen and Nicky Wakim

2023-11-20

Learning Objectives

  1. Calculate expected value of functions of RVs

  2. Calculate variance of RVs

Expected value of a function of a continuous RV

How do we calculate the expected value of a function of a discrete RV or joint RVs?

   

For discrete RVs:

\[\mathbb{E}[g(X)] = \sum_{\{all\ x\}}\ g(x) p_X(x).\] \[\mathbb{E}[g(X, Y)] = \sum_{\{all\ x\}}\sum_{\{all\ y\}}\ g(x,y) p_{X,Y}(x,y).\]

How do we calculate the expected value of a function of a continuous RV or joint RVs?

   

For continuous RVs:

Expected value from a joint pdf

Example 1

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

Remark on expected value of one RV from joint pdf

If you are given \(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. Or, calculate \(\mathbb{E}[X]\) using the joint density: \[\mathbb{E}[X] = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty}x f_{X,Y}(x,y)dydx.\]

Important properties of expected values of functions of continuous RVs

Function of RV with two constants

\(\mathbb{E}[aX+b] =a\mathbb{E}[X]+b\)

Function of two RVs added

\(\mathbb{E}[X+Y] =\mathbb{E}[X]+\mathbb{E}[Y]\)

Expected value of sum of independent RVs pt 1

If \(X_1, X_2, \ldots X_n\) are continuous RVs and \(a_1, a_2, \ldots a_n\) are constants, then \[\mathbb{E}\Bigg[\sum_{i=1}^{n} a_i X_i\Bigg] = \sum_{i=1}^{n}a_i\mathbb{E}[X_i]\]

Expected value of multiplication of function of independent RVs

If \(X\) and \(Y\) are independent continuous RVs, and \(g\) and \(h\) are functions, then \[\mathbb{E}[g(X)h(Y)] =\mathbb{E}[g(X)]\mathbb{E}[h(Y)]\]

Expected value of multiplication of independent RVs

If \(X\) and \(Y\) are independent continuous RVs, then \[\mathbb{E}[XY] = \mathbb{E}[X] \mathbb{E}[Y] \]

Variance of continuous RVs

How do we calculate the variance of a discrete RV?

   

For discrete RVs:

\[ \begin{align} Var(X) & = \mathbb{E}[(X-\mu_X)^2] \\ & = \mathbb{E}[(X-\mathbb{E}[X])^2] \\ &= \mathbb{E}[X^2]-(\mathbb{E}[X])^2 \\ & = \sum_{\{all\ x\}}(x-\mu_x)^2 p_{X}(x) \end{align} \]

How do we calculate the variance of a continuous RV?

    

For continuous RVs:

Variance of an Uniform distribution

Example 2

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

Variance of exponential distribution

Example 3

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

Important properties of variances of continuous RVs

function of RV with two constants

\[Var[aX+b] = a^2Var[X]\]

Variance of sum of independent RVs pt 1

If \(X_1, X_2, \ldots X_n\) are independent continuous RVs and \(a_1, a_2, \ldots a_n\) are constants, then \[Var\Bigg(\sum_{i=1}^{n} a_i X_i\Bigg) =\sum_{i=1}^{n} a^2_i Var(X_i)\]

Variance of sum of independent RVs pt 2

If \(X_1, X_2, \ldots X_n\) are independent continuous RVs, then \[Var\Bigg(\sum_{i=1}^{n} X_i\Bigg) = \sum_{i=1}^{n} Var(X_i)\]

Find the mean and sd from word problem

Example 4

A machine manufactures cubes with a side length that varies uniformly from 1 to 2 inches. Assume the sides of the base and height are equal. The cost to make a cube is 10 ¢ per cubic inch, and 5 ¢ cents for the general cost per cube. Find the mean and standard deviation of the cost to make 10 cubes.