6.2. Expected Value and Variance of Continuous Random Variables
Now that we understand how probability density functions work for continuous random variables, we need to extend our concepts of expected value and variance from the discrete world. The core ideas remain the same—we still want to measure the center and spread of a distribution— but the mathematical machinery shifts from summation to integration. This transition reveals the beautiful parallel structure between discrete and continuous probability theory.
Road Map 🧭
Extend expected value from discrete sums to continuous integrals.
Apply the Law of the Unconscious Statistician (LOTUS) for functions of continuous random variables.
Understand that linearity and additivity properties of expected values remain unchanged.
Define variance using integration and master the computational shortcut.
Explore properties of variance for linear transformations and sums of independent variables.
6.2.1. From Discrete Sums to Continuous Integrals
The expected value of a discrete random variable involved summing each possible value, weighted by its probability. For continuous random variables, we replace this discrete sum with a continuous integral, weighing each possible value by its probability density.
Definition
The expected value of a continuous random variable \(X\), denoted \(E[X]\) or \(\mu_X\), is the continuously weighted average of all values in its support:
This integral represents the “balance point” or center of mass of the probability distribution. Just as in the discrete case, values with higher probability density contribute more to the overall average.
Comparison with the Discrete Case
Discrete \(E[X]\) |
Continuous \(E[X]\) |
---|---|
\(\sum_{x \in \text{supp}(X)} x \cdot p_X(x)\) |
\(\int_{-\infty}^{\infty} x \cdot f_X(x) \, dx = \int_{\text{supp}(X)}x \cdot f_X(x) \, dx\) |
The summation becomes an integration, and the probability mass function \(p_X(x)\) is replaced by the probability density function \(f_X(x)\). Although the integral is formally taken over the entire real line \((-\infty, \infty)\) in the general definition of continuous expectation, only values of \(x\) within the support contribute meaningfully to the computation, since \(f_X(x) = 0\) outside \(\text{supp}(X)\). Thus, the integral is effectively taken over the support—just as the summation is in the discrete case.
Remark: The Absolute Integrability Condition
For the expected value of \(X\) to be well-defined and finite, \(X\) must satisfy
All continuous distributions we encounter in this course satisfy this condition.
6.2.2. The Law of the Unconscious Statistician (LOTUS) for Continuous Random Variables
Just as in the discrete case, we often want to find the expected value of some function of a random variable, like \(E[X^2]\) or \(E[e^X]\). The Law of the Unconscious Statistician (LOTUS) extends naturally to continuous random variables.
Theorem: LOTUS
If \(X\) is a continuous random variable with PDF \(f_X(x)\), and \(g(x)\) is a function, then:
The Power of LOTUS
This theorem is remarkably powerful because it allows us to compute \(E[g(X)]\) directly without having to find the PDF of the new random variable \(Y = g(X)\) Instead, we simply plug \(g(x)\) into our expectation integral and use the original PDF \(f_X(x)\).
Example💡: Expected value of functions of \(X\)
Consider a continuous random variable \(X\) with PDF
Find \(E[X], E[X^2]\), and \(E[\sqrt{X}]\).
Find \(E[X]\) using the definition
\[E[X] = \int_0^1 x \cdot (2x) \, dx = \int_0^1 2x^2 \, dx = 2 \cdot \frac{x^3}{3}\Bigg\rvert_0^1 = \frac{2}{3}\]Apply LOTUS for \(E[X^2]\) and \(E[\sqrt{X}]\)
6.2.3. Properties of Expected Value: Unchanged by Continuity
The fundamental properties of expected value that we learned for discrete random variables apply unchanged to continuous random variables. The only difference is that we use integration instead of summation to compute the expected values.
Linearity of Expectation
For any continuous random variable \(X\) and constants \(a\) and \(b\):
Proof of linearity of expectation
\[\begin{split}\begin{align} E[aX + b] &= \int_{-\infty}^{\infty} (ax + b) \cdot f_X(x) \, dx \\ &= a\int_{-\infty}^{\infty} x \cdot f_X(x) \, dx + b\int_{-\infty}^{\infty} f_X(x) \, dx \\ &= aE[X] + b \cdot 1 \\ &= aE[X] + b \end{align}\end{split}\]
Additivity of Expectation
For any set of continuous random variables \(X_1, X_2, \cdots, X_n\),
The remarkable fact is that additivity holds regardless of any dependence between the variables.
6.2.4. Variance for Continuous Random Variables
The concept of variance also translates directly from discrete to continuous random variables.
Definition
The variance of a continuous random variable \(X\) is the expected value of the squared deviation from the mean:
Computational Shortcut for Variance
Just as in the discrete case, we have the much more convenient computational formula:
Standard Deviation
The standard deviation is the square root of the variance:
Example💡: Computing Variance
For the random variable \(X\) with PDF
compute \(\text{Var}(X)\) and \(\sigma_X\).
Using \(E[X]\) and \(E[X^2]\) obtained in the previous example, apply the computational shortcut:
Therefore, \(\sigma_X = \sqrt{1/18} = 1/(3\sqrt{2}) \approx 0.236\).
6.2.5. Properties of Variance for Continuous Random Variables
The variance properties we learned for discrete random variables apply without modification to continuous random variables.
Variance of Linear Transformations
For any continuous random variable \(X\) and constants \(a\) and \(b\):
Recall that:
Adding a constant (\(b\)) doesn’t change how spread out a distribution is—it just shifts its location.
Multiplying by a constant (\(a\)) scales the variance by \(a^2\).
Variance of Sums for Independent Variables
When \(X\) and \(Y\) are independent continuous random variables:
This extends to any number of mutually independent variables:
Be Cautious 🛑
The additivity of variances only applies when the random variables are independent. This means that the mutual independence of all terms involved must be provided or shown before the rule is applied.
For dependent variables, we need to account for covariance terms.
6.2.6. Covariance and Correlation: A Brief Introduction
When dealing with multiple continuous random variables that may be dependent, we need measures of how they vary together. The concepts of covariance and correlation also extend to continuous random variables.
Covariance
The covariance between continuous random variables \(X\) and \(Y\) is:
Correlation
The correlation coefficient is:
As before, correlation is unitless and bounded between -1 and +1.
Note
Working with joint distributions of continuous random variables involves multivariable calculus and is beyond the scope of this course. We’ll focus on single continuous random variables in the remainder of this chapter.
6.2.7. Bringing It All Together
Key Takeaways 📝
Expected value for continuous random variables uses integration instead of summation, but represents the same concept: a weighted average using probability densities as weights.
All expectation properties (LOTUS, linearity, additivity) remain unchanged—only the computational method (integration vs. summation) differs.
Variance maintains the same conceptual meaning and computational shortcut.
Variance properties for linear transformations and sums of independent variables apply identically to continuous random variables.
The transition from discrete to continuous random variables preserves all the fundamental relationships we’ve learned, while replacing the discrete machinery of summation with the continuous machinery of integration. This parallel structure demonstrates the elegant unity underlying probability theory, whether we’re counting discrete outcomes or measuring continuous quantities.
Exercises
Basic Expected Value: For the PDF
\[\begin{split}f_X(x) = \begin{cases} &3x^2, &0 ≤ x ≤ 1\\ &0 &\text{ elsewhere} \end{cases},\end{split}\]Find \(E[X]\).
Find \(E[X^2]\).
Find \(Var(X)\).
Find \(E[2X + 3]\).
Find \(Var(3X - 1)\).
Piecewise PDF: Consider the PDF:
\[\begin{split}f_X(x) = \begin{cases} &x/2, &0 ≤ x ≤ 2\\ &(4-x)/2, &2 < x ≤ 4\\ &0, &\text{ elsewhere} \end{cases}\end{split}\]Verify this is a legitimate PDF.
Find \(E[X]\).
Find \(Var(X)\).
Linear Transformations: For \(X\) with \(E[X] = 5\) and \(Var(X) = 4\), find:
\(E[3X - 7]\).
\(\sigma_{3X - 7}\).