Expected Values and Variance
Last modified — 21 Jun 2026
Warning
Our final exam is scheduled for June 22nd, 2026 at 8:30am. Please find the room location on Workday.
The exam is 2.5 hours, with the exact same rules as the midterm.
By the end of this lecture, students are anticipated to be able to:
The expected value of a random variable \(g(X)\) is defined by
\[ \mathbb{E}[g(X)] = \begin{cases} \displaystyle\sum_{x} g(x) p_X(x) & \text{if $X$ is discrete}\\ \\ \displaystyle\int_{-\infty}^\infty g(x) f_X(x) \mathsf{d}x & \text{if $X$ is absolutely continuous} \end{cases} \]
provided that the sum or integral exists.
Let \(X\) be the value of the face of a die when rolled. What is the expected value of \(X\)?
Let \(X \sim {\mathrm{Binom}}(n, \theta)\). What is \(\mathbb{E}[X]\)? Hint: we can use “kernel matching” and use the fact that \(x\binom{n}{x} = n\binom{n-1}{x-1}\).
Suppose\(X \sim \textrm{Gamma}(\alpha, \lambda )\). What is \(\mathbb{E}[X]\)? Hint: kernel matching!
Let \(X \sim {\mathrm{Gam}}(\alpha, \lambda)\) where \(\alpha>0\) and \(\lambda > 0\). Recall that the PDF of a RV \(Y\sim{\mathrm{Gam}}(\theta, \beta)\) is given by \[f_X(x) = \frac{\beta^\theta}{\Gamma(\theta)} x^{\theta - 1} e^{-\beta x} I_{(0,\infty)}(x).\]
Let \(t < \lambda\). Find \(\mathbb{E}[\exp(tX)]\).
(Where the expected value exists.)
For the last property, the converse is false.
Let \(X\sim U(0,\theta)\) and \(Y\sim{\mathrm{Exp}}(1)\) be independent.
Find \(\mathbb{E}\left[\frac{1}{2}(X + Y)^2\right]\).
Let \(g : {\mathbb{R}}^2 \to {\mathbb{R}}\) be a function.
If \(X\) and \(Y\) are both discrete random variables, then \[\begin{aligned} \mathbb{E}[g(X, Y)] &= \sum_{x} \sum_{y} g(x, y) p_{X,Y}(x, y). \end{aligned}\] If \(X\) and \(Y\) are jointly absolutely continuous random variables, then \[\begin{aligned} \mathbb{E}[g(X, Y)] &= \int_{-\infty}^\infty \int_{-\infty}^\infty g(x, y) f_{X,Y}(x, y) \mathsf{d}x \mathsf{d}y. \end{aligned}\]
Suppose that \(X\) and \(Y\) are jointly absolutely continuous random variables with joint PDF \(f_{X,Y}(x, y)\). Note that \(\mathbb{E}[g(X)h(Y)]\) is a scalar-valued function of \(X\) and \(Y\).
\[\begin{aligned} \mathbb{E}[g(X)h(Y)] &= \int_{-\infty}^\infty \int_{-\infty} ^\infty g(x) h(y) f_{X,Y}(x, y) \mathsf{d}x \mathsf{d}y \\ &= \int_{-\infty}^\infty \int_{-\infty}^\infty g(x) h(y) f_X(x) f_Y(y) \mathsf{d}x\mathsf{d}y && \text{$X$ and $Y$ are independent} \\ &= \int_{-\infty}^\infty g(x) f_X(x) \mathsf{d}x \int_{-\infty}^\infty h(y) f_Y(y) \mathsf{d}y \\ &= \mathbb{E}[g(X)] \mathbb{E}[h(Y)]. \end{aligned}\]
Let \(X\) and \(Y\) have joint PDF \[f_{X,Y}(x,y) = 8xyI_{\{0 < x < y < 1\}}(x,y).\]
The variance of a random variable \(X\) is defined by \[ \begin{aligned} \sigma^2_X &= \operatorname{Var}(X) \\ &= \mathbb{E}[(X - \mathbb{E}[X])^2] &\text{(this is the "definition"...)}\\ &= \mathbb{E}[X^2] - \mathbb{E}[X]^2 & \text{(... but this version is often easier for calculations)} \end{aligned} \]
The standard deviation of a random variable \(X\) is defined by \[\sigma_X = \sqrt{\operatorname{Var}(X)}.\]
(Where the variance exists.)
Let’s do the following example together.
Let \(X \sim {\mathrm{Unif}}(0,1)\). Find \(\operatorname{Var}(X)\).
Recall if \(X \sim Unif(L,R)\), then \[f_X(x; L, R) = \frac{1}{R-L}I_{[L,R]}(x)\]
Let \(X \sim {\mathrm{Exp}}(\lambda)\). Find \(\operatorname{Var}(X)\).
Hints: remember that \(\mathbb{E}[X] = 1/\lambda\) and that \(\Gamma(z) = (z-1)!\) for integer \(z > 1\).
Stat 302 - Winter 2025/26