Probability BasicsTopic #12 of 33

Expected Value and Variance

Mean and variance of random variables: E(X), Var(X), and their properties.

Overview

Expected value and variance are the two most important properties of a random variable, describing its center and spread.

Expected Value (Mean)

The expected value is the long-run average value of a random variable.

Discrete Random Variable

E(X)=μ=xi×P(X=xi)E(X) = \mu = \sum x_i \times P(X = x_i)

Continuous Random Variable

E(X)=μ=x×f(x)dxE(X) = \mu = \int x \times f(x) \, dx

Properties of Expected Value

E(c)=c(constant)E(c) = c \quad \text{(constant)} E(cX)=c×E(X)(scalar multiplication)E(cX) = c \times E(X) \quad \text{(scalar multiplication)} E(X+Y)=E(X)+E(Y)(addition, always true)E(X + Y) = E(X) + E(Y) \quad \text{(addition, always true)} E(XY)=E(X)E(Y)(subtraction)E(X - Y) = E(X) - E(Y) \quad \text{(subtraction)} E(aX+b)=a×E(X)+b(linear transformation)E(aX + b) = a \times E(X) + b \quad \text{(linear transformation)}

For independent XX and YY:

E(XY)=E(X)×E(Y)E(XY) = E(X) \times E(Y)

Variance

Variance measures the spread around the mean.

Definition

Var(X)=σ2=E[(Xμ)2]\text{Var}(X) = \sigma^2 = E[(X - \mu)^2]

Computational Formula

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

Discrete Random Variable

Var(X)=(xiμ)2×P(X=xi)\text{Var}(X) = \sum (x_i - \mu)^2 \times P(X = x_i)

or equivalently:

Var(X)=xi2×P(X=xi)μ2\text{Var}(X) = \sum x_i^2 \times P(X = x_i) - \mu^2

Standard Deviation

σ=SD(X)=Var(X)\sigma = SD(X) = \sqrt{\text{Var}(X)}

Properties of Variance

Var(c)=0(constant has no variance)\text{Var}(c) = 0 \quad \text{(constant has no variance)} Var(cX)=c2×Var(X)(scalar squared)\text{Var}(cX) = c^2 \times \text{Var}(X) \quad \text{(scalar squared)} Var(X+c)=Var(X)(shifting doesn’t change spread)\text{Var}(X + c) = \text{Var}(X) \quad \text{(shifting doesn't change spread)} Var(aX+b)=a2×Var(X)(linear transformation)\text{Var}(aX + b) = a^2 \times \text{Var}(X) \quad \text{(linear transformation)}

For independent XX and YY:

Var(X+Y)=Var(X)+Var(Y)\text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) Var(XY)=Var(X)+Var(Y)(note: still addition!)\text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y) \quad \text{(note: still addition!)}

Standardization

Converting XX to a standard form with mean 0 and SD 1:

Z=XμσZ = \frac{X - \mu}{\sigma} E(Z)=0,Var(Z)=1E(Z) = 0, \quad \text{Var}(Z) = 1

Covariance and Correlation

Covariance

Cov(X,Y)=E[(XμX)(YμY)]=E(XY)E(X)E(Y)\text{Cov}(X, Y) = E[(X - \mu_X)(Y - \mu_Y)] = E(XY) - E(X)E(Y)

Correlation

ρ=Corr(X,Y)=Cov(X,Y)σX×σY\rho = \text{Corr}(X, Y) = \frac{\text{Cov}(X, Y)}{\sigma_X \times \sigma_Y}

Where 1ρ1-1 \leq \rho \leq 1

For Linear Combinations

E(aX+bY)=a×E(X)+b×E(Y)E(aX + bY) = a \times E(X) + b \times E(Y) Var(aX+bY)=a2×Var(X)+b2×Var(Y)+2ab×Cov(X,Y)\text{Var}(aX + bY) = a^2 \times \text{Var}(X) + b^2 \times \text{Var}(Y) + 2ab \times \text{Cov}(X,Y)

If XX and YY are independent:

Var(aX+bY)=a2×Var(X)+b2×Var(Y)\text{Var}(aX + bY) = a^2 \times \text{Var}(X) + b^2 \times \text{Var}(Y)

Examples

Example 1: Expected Value

Die roll XX:

E(X)=1(16)+2(16)+3(16)+4(16)+5(16)+6(16)E(X) = 1\left(\frac{1}{6}\right) + 2\left(\frac{1}{6}\right) + 3\left(\frac{1}{6}\right) + 4\left(\frac{1}{6}\right) + 5\left(\frac{1}{6}\right) + 6\left(\frac{1}{6}\right) E(X)=216=3.5E(X) = \frac{21}{6} = 3.5

Example 2: Variance

For the die:

E(X2)=12(16)+22(16)+32(16)+42(16)+52(16)+62(16)E(X^2) = 1^2\left(\frac{1}{6}\right) + 2^2\left(\frac{1}{6}\right) + 3^2\left(\frac{1}{6}\right) + 4^2\left(\frac{1}{6}\right) + 5^2\left(\frac{1}{6}\right) + 6^2\left(\frac{1}{6}\right) E(X2)=916=15.17E(X^2) = \frac{91}{6} = 15.17 Var(X)=15.17(3.5)2=15.1712.25=2.92\text{Var}(X) = 15.17 - (3.5)^2 = 15.17 - 12.25 = 2.92 σ=2.92=1.71\sigma = \sqrt{2.92} = 1.71

Example 3: Linear Transformation

If E(X)=50E(X) = 50 and Var(X)=16\text{Var}(X) = 16, find E(Y)E(Y) and Var(Y)\text{Var}(Y) where Y=3X+10Y = 3X + 10:

E(Y)=3×50+10=160E(Y) = 3 \times 50 + 10 = 160 Var(Y)=32×16=144\text{Var}(Y) = 3^2 \times 16 = 144 SD(Y)=12SD(Y) = 12

Example 4: Sum of Independent Variables

If XX has mean 100, SD 15 and YY has mean 80, SD 10 (independent):

E(X+Y)=100+80=180E(X + Y) = 100 + 80 = 180 Var(X+Y)=225+100=325\text{Var}(X + Y) = 225 + 100 = 325 SD(X+Y)=325=18.03SD(X + Y) = \sqrt{325} = 18.03