Expectation and Variance of Continuous Distributions
This lesson focuses on computing E ( X ) E(X) E ( X ) , E ( X 2 ) E(X^2) E ( X 2 ) , Var ( X ) \text{Var}(X) Var ( X ) , and related quantities for continuous distributions. You will practise integration techniques and learn how to handle more complex PDFs involving polynomials, trigonometric functions, and parameters.
Core Formulas (Recap)
For a continuous random variable X X X with PDF f ( x ) f(x) f ( x ) defined on [ a , b ] [a, b] [ a , b ] :
Quantity Formula E ( X ) E(X) E ( X ) ∫ a b x f ( x ) d x \int_a^b x f(x) \, dx ∫ a b x f ( x ) d x E ( X 2 ) E(X^2) E ( X 2 ) ∫ a b x 2 f ( x ) d x \int_a^b x^2 f(x) \, dx ∫ a b x 2 f ( x ) d x E ( g ( X ) ) E(g(X)) E ( g ( X )) ∫ a b g ( x ) f ( x ) d x \int_a^b g(x) f(x) \, dx ∫ a b g ( x ) f ( x ) d x Var ( X ) \text{Var}(X) Var ( X ) E ( X 2 ) − ( E ( X ) ) 2 E(X^2) - (E(X))^2 E ( X 2 ) − ( E ( X ) ) 2
Worked Example 1: Polynomial PDF
Let f ( x ) = 12 x 2 ( 1 − x ) f(x) = 12x^2(1 - x) f ( x ) = 12 x 2 ( 1 − x ) for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 .
Verify: ∫ 0 1 12 x 2 ( 1 − x ) d x = 12 ∫ 0 1 ( x 2 − x 3 ) d x = 12 [ x 3 3 − x 4 4 ] 0 1 = 12 ( 1 3 − 1 4 ) = 12 × 1 12 = 1 \int_0^1 12x^2(1-x) \, dx = 12\int_0^1 (x^2 - x^3) \, dx = 12\left[\frac{x^3}{3} - \frac{x^4}{4}\right]_0^1 = 12\left(\frac{1}{3} - \frac{1}{4}\right) = 12 \times \frac{1}{12} = 1 ∫ 0 1 12 x 2 ( 1 − x ) d x = 12 ∫ 0 1 ( x 2 − x 3 ) d x = 12 [ 3 x 3 − 4 x 4 ] 0 1 = 12 ( 3 1 − 4 1 ) = 12 × 12 1 = 1 . Valid.
Mean:
E ( X ) = ∫ 0 1 12 x 3 ( 1 − x ) d x = 12 ∫ 0 1 ( x 3 − x 4 ) d x = 12 [ x 4 4 − x 5 5 ] 0 1 = 12 ( 1 4 − 1 5 ) = 12 × 1 20 = 3 5 = 0.6 E(X) = \int_0^1 12x^3(1-x) \, dx = 12\int_0^1 (x^3 - x^4) \, dx = 12\left[\frac{x^4}{4} - \frac{x^5}{5}\right]_0^1 = 12\left(\frac{1}{4} - \frac{1}{5}\right) = 12 \times \frac{1}{20} = \frac{3}{5} = 0.6 E ( X ) = ∫ 0 1 12 x 3 ( 1 − x ) d x = 12 ∫ 0 1 ( x 3 − x 4 ) d x = 12 [ 4 x 4 − 5 x 5 ] 0 1 = 12 ( 4 1 − 5 1 ) = 12 × 20 1 = 5 3 = 0.6
Second moment:
E ( X 2 ) = ∫ 0 1 12 x 4 ( 1 − x ) d x = 12 ∫ 0 1 ( x 4 − x 5 ) d x = 12 [ x 5 5 − x 6 6 ] 0 1 = 12 ( 1 5 − 1 6 ) = 12 × 1 30 = 2 5 = 0.4 E(X^2) = \int_0^1 12x^4(1-x) \, dx = 12\int_0^1 (x^4 - x^5) \, dx = 12\left[\frac{x^5}{5} - \frac{x^6}{6}\right]_0^1 = 12\left(\frac{1}{5} - \frac{1}{6}\right) = 12 \times \frac{1}{30} = \frac{2}{5} = 0.4 E ( X 2 ) = ∫ 0 1 12 x 4 ( 1 − x ) d x = 12 ∫ 0 1 ( x 4 − x 5 ) d x = 12 [ 5 x 5 − 6 x 6 ] 0 1 = 12 ( 5 1 − 6 1 ) = 12 × 30 1 = 5 2 = 0.4
Variance:
Var ( X ) = 0.4 − 0.6 2 = 0.4 − 0.36 = 0.04 \text{Var}(X) = 0.4 - 0.6^2 = 0.4 - 0.36 = 0.04 Var ( X ) = 0.4 − 0. 6 2 = 0.4 − 0.36 = 0.04
SD ( X ) = 0.04 = 0.2 \text{SD}(X) = \sqrt{0.04} = 0.2 SD ( X ) = 0.04 = 0.2
This is a Beta(3, 2) distribution . The result E ( X ) = 3 / 5 E(X) = 3/5 E ( X ) = 3/5 matches the general formula E = α / ( α + β ) E = \alpha/(\alpha + \beta) E = α / ( α + β ) .
Worked Example 2: PDF with a Parameter
Let f ( x ) = ( n + 1 ) x n f(x) = (n + 1)x^n f ( x ) = ( n + 1 ) x n for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 , where n ≥ 0 n \geq 0 n ≥ 0 is a positive integer.
Verify: ∫ 0 1 ( n + 1 ) x n d x = ( n + 1 ) ⋅ 1 n + 1 = 1 \int_0^1 (n+1)x^n \, dx = (n+1) \cdot \frac{1}{n+1} = 1 ∫ 0 1 ( n + 1 ) x n d x = ( n + 1 ) ⋅ n + 1 1 = 1 . Valid for all n ≥ 0 n \geq 0 n ≥ 0 .
Mean:
E ( X ) = ∫ 0 1 ( n + 1 ) x n + 1 d x = ( n + 1 ) ⋅ 1 n + 2 = n + 1 n + 2 E(X) = \int_0^1 (n+1)x^{n+1} \, dx = (n+1) \cdot \frac{1}{n+2} = \frac{n+1}{n+2} E ( X ) = ∫ 0 1 ( n + 1 ) x n + 1 d x = ( n + 1 ) ⋅ n + 2 1 = n + 2 n + 1
As n → ∞ n \to \infty n → ∞ , E ( X ) → 1 E(X) \to 1 E ( X ) → 1 , which makes sense because the density concentrates near x = 1 x = 1 x = 1 .
Second moment:
E ( X 2 ) = ∫ 0 1 ( n + 1 ) x n + 2 d x = n + 1 n + 3 E(X^2) = \int_0^1 (n+1)x^{n+2} \, dx = \frac{n+1}{n+3} E ( X 2 ) = ∫ 0 1 ( n + 1 ) x n + 2 d x = n + 3 n + 1
Variance:
Var ( X ) = n + 1 n + 3 − ( n + 1 n + 2 ) 2 = ( n + 1 ) ( n + 2 ) 2 − ( n + 1 ) 2 ( n + 3 ) ( n + 3 ) ( n + 2 ) 2 \text{Var}(X) = \frac{n+1}{n+3} - \left(\frac{n+1}{n+2}\right)^2 = \frac{(n+1)(n+2)^2 - (n+1)^2(n+3)}{(n+3)(n+2)^2} Var ( X ) = n + 3 n + 1 − ( n + 2 n + 1 ) 2 = ( n + 3 ) ( n + 2 ) 2 ( n + 1 ) ( n + 2 ) 2 − ( n + 1 ) 2 ( n + 3 )
After simplification:
Var ( X ) = n + 1 ( n + 2 ) 2 ( n + 3 ) \text{Var}(X) = \frac{n+1}{(n+2)^2(n+3)} Var ( X ) = ( n + 2 ) 2 ( n + 3 ) n + 1
Worked Example 3: Expectation of a Function
Let X X X have PDF f ( x ) = 2 ( 1 − x ) f(x) = 2(1-x) f ( x ) = 2 ( 1 − x ) for 0 ≤ x ≤ 1 0 \leq x \leq 1 0 ≤ x ≤ 1 . Find E ( X 3 ) E(X^3) E ( X 3 ) .
E ( X 3 ) = ∫ 0 1 x 3 ⋅ 2 ( 1 − x ) d x = 2 ∫ 0 1 ( x 3 − x 4 ) d x = 2 [ x 4 4 − x 5 5 ] 0 1 = 2 ( 1 4 − 1 5 ) = 2 × 1 20 = 1 10 E(X^3) = \int_0^1 x^3 \cdot 2(1-x) \, dx = 2\int_0^1 (x^3 - x^4) \, dx = 2\left[\frac{x^4}{4} - \frac{x^5}{5}\right]_0^1 = 2\left(\frac{1}{4} - \frac{1}{5}\right) = 2 \times \frac{1}{20} = \frac{1}{10} E ( X 3 ) = ∫ 0 1 x 3 ⋅ 2 ( 1 − x ) d x = 2 ∫ 0 1 ( x 3 − x 4 ) d x = 2 [ 4 x 4 − 5 x 5 ] 0 1 = 2 ( 4 1 − 5 1 ) = 2 × 20 1 = 10 1