Probability Density Functions
This lesson deepens your understanding of probability density functions (PDFs) for continuous random variables, covering how to find the mean, variance, mode, and median from a PDF, and how to apply these concepts in exam-style problems.
Mean (Expected Value) of a Continuous Distribution
The expected value of a continuous random variable X X X with PDF f ( x ) f(x) f ( x ) is:
E ( X ) = μ = ∫ − ∞ ∞ x ⋅ f ( x ) d x E(X) = \mu = \int_{-\infty}^{\infty} x \cdot f(x) \, dx E ( X ) = μ = ∫ − ∞ ∞ x ⋅ f ( x ) d x
More generally, for any function g ( X ) g(X) g ( X ) :
E ( g ( X ) ) = ∫ − ∞ ∞ g ( x ) ⋅ f ( x ) d x E(g(X)) = \int_{-\infty}^{\infty} g(x) \cdot f(x) \, dx E ( g ( X )) = ∫ − ∞ ∞ g ( x ) ⋅ f ( x ) d x
Worked Example
Let f ( x ) = 3 8 x 2 f(x) = \frac{3}{8}x^2 f ( x ) = 8 3 x 2 for 0 ≤ x ≤ 2 0 \leq x \leq 2 0 ≤ x ≤ 2 .
E ( X ) = ∫ 0 2 x ⋅ 3 8 x 2 d x = 3 8 ∫ 0 2 x 3 d x = 3 8 [ x 4 4 ] 0 2 = 3 8 × 4 = 3 2 = 1.5 E(X) = \int_0^2 x \cdot \frac{3}{8}x^2 \, dx = \frac{3}{8}\int_0^2 x^3 \, dx = \frac{3}{8}\left[\frac{x^4}{4}\right]_0^2 = \frac{3}{8} \times 4 = \frac{3}{2} = 1.5 E ( X ) = ∫ 0 2 x ⋅ 8 3 x 2 d x = 8 3 ∫ 0 2 x 3 d x = 8 3 [ 4 x 4 ] 0 2 = 8 3 × 4 = 2 3 = 1.5
E ( X 2 ) = ∫ 0 2 x 2 ⋅ 3 8 x 2 d x = 3 8 ∫ 0 2 x 4 d x = 3 8 [ x 5 5 ] 0 2 = 3 8 × 32 5 = 12 5 = 2.4 E(X^2) = \int_0^2 x^2 \cdot \frac{3}{8}x^2 \, dx = \frac{3}{8}\int_0^2 x^4 \, dx = \frac{3}{8}\left[\frac{x^5}{5}\right]_0^2 = \frac{3}{8} \times \frac{32}{5} = \frac{12}{5} = 2.4 E ( X 2 ) = ∫ 0 2 x 2 ⋅ 8 3 x 2 d x = 8 3 ∫ 0 2 x 4 d x = 8 3 [ 5 x 5 ] 0 2 = 8 3 × 5 32 = 5 12 = 2.4
Variance of a Continuous Distribution
Var ( X ) = E ( X 2 ) − ( E ( X ) ) 2 \text{Var}(X) = E(X^2) - (E(X))^2 Var ( X ) = E ( X 2 ) − ( E ( X ) ) 2
Using the values from above:
Var ( X ) = 2.4 − 1.5 2 = 2.4 − 2.25 = 0.15 \text{Var}(X) = 2.4 - 1.5^2 = 2.4 - 2.25 = 0.15 Var ( X ) = 2.4 − 1. 5 2 = 2.4 − 2.25 = 0.15
SD ( X ) = 0.15 = 0.387 \text{SD}(X) = \sqrt{0.15} = 0.387 SD ( X ) = 0.15 = 0.387
Exam Tip: Always compute E ( X ) E(X) E ( X ) and E ( X 2 ) E(X^2) E ( X 2 ) separately, then use Var ( X ) = E ( X 2 ) − ( E ( X ) ) 2 \text{Var}(X) = E(X^2) - (E(X))^2 Var ( X ) = E ( X 2 ) − ( E ( X ) ) 2 . Show both integrals in full.
Mode of a Continuous Distribution
The mode is the value of x x x at which f ( x ) f(x) f ( x ) is maximised.
To find the mode:
Differentiate f ( x ) f(x) f ( x ) with respect to x x x .
Set f ′ ( x ) = 0 f'(x) = 0 f ′ ( x ) = 0 and solve.
Verify it is a maximum (check f ′ ′ ( x ) < 0 f''(x) < 0 f ′′ ( x ) < 0 or by inspection).
Example: f ( x ) = 3 4 x ( 2 − x ) f(x) = \frac{3}{4}x(2 - x) f ( x ) = 4 3 x ( 2 − x ) for 0 ≤ x ≤ 2 0 \leq x \leq 2 0 ≤ x ≤ 2 .
f ( x ) = 3 4 ( 2 x − x 2 ) f(x) = \frac{3}{4}(2x - x^2) f ( x ) = 4 3 ( 2 x − x 2 )
f ′ ( x ) = 3 4 ( 2 − 2 x ) = 0 ⟹ x = 1 f'(x) = \frac{3}{4}(2 - 2x) = 0 \implies x = 1 f ′ ( x ) = 4 3 ( 2 − 2 x ) = 0 ⟹ x = 1
f ′ ′ ( x ) = 3 4 ( − 2 ) = − 3 2 < 0 (maximum) f''(x) = \frac{3}{4}(-2) = -\frac{3}{2} < 0 \quad \text{(maximum)} f ′′ ( x ) = 4 3 ( − 2 ) = − 2 3 < 0 (maximum)
The mode is x = 1 x = 1 x = 1 .
Note: For some PDFs (e.g., f ( x ) = 3 8 x 2 f(x) = \frac{3}{8}x^2 f ( x ) = 8 3 x 2 on [ 0 , 2 ] [0, 2] [ 0 , 2 ] ), the function is monotonically increasing, so the mode is at the right endpoint x = 2 x = 2 x = 2 . Always check the endpoints of the domain.
Median of a Continuous Distribution
The median m m m satisfies:
P ( X ≤ m ) = ∫ − ∞ m f ( x ) d x = 0.5 P(X \leq m) = \int_{-\infty}^m f(x) \, dx = 0.5 P ( X ≤ m ) = ∫ − ∞ m f ( x ) d x = 0.5
Worked Example
Find the median of f ( x ) = 3 8 x 2 f(x) = \frac{3}{8}x^2 f ( x ) = 8 3 x 2 for 0 ≤ x ≤ 2 0 \leq x \leq 2 0 ≤ x ≤ 2 .
∫ 0 m 3 8 x 2 d x = 0.5 \int_0^m \frac{3}{8}x^2 \, dx = 0.5 ∫ 0 m 8 3 x 2 d x = 0.5
3 8 × m 3 3 = 0.5 \frac{3}{8} \times \frac{m^3}{3} = 0.5 8 3 × 3 m 3 = 0.5
m 3 8 = 0.5 ⟹ m 3 = 4 ⟹ m = 4 3 ≈ 1.587 \frac{m^3}{8} = 0.5 \implies m^3 = 4 \implies m = \sqrt[3]{4} \approx 1.587 8 m 3 = 0.5 ⟹ m 3 = 4 ⟹ m = 3 4 ≈ 1.587