Continuous Random Variables
View .md

Expected Value and Variance for Continuous RVs

Expected Value

For a continuous random variable XX with PDF fX(x)f_X(x):

E[X]=∫−∞∞x⋅fX(x) dxE[X] = \int_{-\infty}^{\infty} x \cdot f_X(x) \, dx

Intuition

  • Still the “center of mass” or “center of gravity” of the PDF
  • Represents the long-run average if you repeat the experiment many times
  • Same interpretation as for discrete random variables

Expected Value of Functions

For a function g(X)g(X):

E[g(X)]=∫−∞∞g(x)⋅fX(x) dxE[g(X)] = \int_{-\infty}^{\infty} g(x) \cdot f_X(x) \, dx

No need to find the PDF of g(X)g(X) first!

Key Insight

Same as discrete case: E[g(X)]≠g(E[X])E[g(X)] \neq g(E[X]) in general. Cannot interchange expectation and non-linear functions.


Variance

Var(X)=E[(X−E[X])2]=∫−∞∞(x−μ)2fX(x) dx\text{Var}(X) = E\left[(X - E[X])^2\right] = \int_{-\infty}^{\infty} (x - \mu)^2 f_X(x) \, dx

Alternative Formula

Var(X)=E[X2]−(E[X])2\text{Var}(X) = E[X^2] - (E[X])^2

This is often easier to compute.

Standard Deviation

σX=Var(X)\sigma_X = \sqrt{\text{Var}(X)}


Uniform Distribution Example

For X∼Uniform(a,b)X \sim \text{Uniform}(a, b):

fX(x)=1b−afor a≤x≤bf_X(x) = \frac{1}{b-a} \quad \text{for } a \leq x \leq b

Expected Value

By symmetry (or integration):

E[X]=a+b2E[X] = \frac{a + b}{2}

The mean is the midpoint of the interval.

Variance

Var(X)=(b−a)212\text{Var}(X) = \frac{(b-a)^2}{12}

Standard Deviation

σX=b−a12≈b−a3.46\sigma_X = \frac{b-a}{\sqrt{12}} \approx \frac{b-a}{3.46}

The standard deviation is proportional to the width of the interval.


Properties (Same as Discrete)

Linearity

  • E[aX+b]=aE[X]+bE[aX + b] = aE[X] + b
  • E[X+Y]=E[X]+E[Y]E[X + Y] = E[X] + E[Y] (always)

Variance Properties

  • Var(aX)=a2Var(X)\text{Var}(aX) = a^2 \text{Var}(X)
  • Var(X+b)=Var(X)\text{Var}(X + b) = \text{Var}(X)
  • Var(X+Y)=Var(X)+Var(Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) if X,YX, Y independent

Cumulative Distribution Function (CDF)

The CDF unifies discrete and continuous cases:

FX(x)=P(X≤x)F_X(x) = P(X \leq x)

For Continuous RVs

FX(x)=∫−∞xfX(t) dtF_X(x) = \int_{-\infty}^x f_X(t) \, dt

Properties

  1. FX(x)F_X(x) is non-decreasing
  2. lim⁡x→−∞FX(x)=0\lim_{x \to -\infty} F_X(x) = 0
  3. lim⁡x→∞FX(x)=1\lim_{x \to \infty} F_X(x) = 1
  4. P(a≤X≤b)=FX(b)−FX(a)P(a \leq X \leq b) = F_X(b) - F_X(a)

Relation to PDF

fX(x)=ddxFX(x)f_X(x) = \frac{d}{dx} F_X(x)

The PDF is the derivative of the CDF.


Conditional Expectation

Given an event AA:

E[X∣A]=∫−∞∞x⋅fX∣A(x) dxE[X | A] = \int_{-\infty}^{\infty} x \cdot f_{X|A}(x) \, dx

Same concept as discrete case: expected value in the “conditional universe.”