Variance and Standard Deviation

Definition of the Variance

Mathematical Definition of the Variance

Variance

Let XX be a random variable with E(X)=μE(X) = \mu. If E[(X−μ)2]E[(X - \mu)^2] exists, then: D(X)=E[(X−μ)2]=E[(X−E(X))2]D(X) = E[(X - \mu)^2] = E[(X - E(X))^2]

is called the variance of XX, denoted by D(X)D(X) or Var(X)Var(X).

Computation Formula for the Variance

Discrete random variable: D(X)=∑i=1∞(xi−μ)2piD(X) = \sum_{i=1}^{\infty} (x_i - \mu)^2 p_i

Continuous random variable: D(X)=∫−∞+∞(x−μ)2f(x)dxD(X) = \int_{-\infty}^{+\infty} (x - \mu)^2 f(x) dx

Simplified Computation Formula for the Variance

Simplified Computation Formula for the Variance

D(X)=E(X2)−[E(X)]2D(X) = E(X^2) - [E(X)]^2

Proof: D(X)=E[(X−μ)2]=E(X2−2μX+μ2)=E(X2)−2μE(X)+μ2=E(X2)−μ2=E(X2)−[E(X)]2D(X) = E[(X - \mu)^2] = E(X^2 - 2\mu X + \mu^2) = E(X^2) - 2\mu E(X) + \mu^2 = E(X^2) - \mu^2 = E(X^2) - [E(X)]^2

Intuitive Understanding of the Variance

Understanding: the variance is the average of the squared deviations of the values of a random variable from its expectation; it reflects the degree of dispersion of the values taken by a random variable.

Examples of the Variance

Example 1: rolling a fair die, with XX denoting the number that appears

  • E(X)=3.5E(X) = 3.5
  • E(X2)=∑i=16i2⋅16=1+4+9+16+25+366=916E(X^2) = \sum_{i=1}^6 i^2 \cdot \frac{1}{6} = \frac{1+4+9+16+25+36}{6} = \frac{91}{6}
  • D(X)=E(X2)−[E(X)]2=916−(72)2=916−494=3512D(X) = E(X^2) - [E(X)]^2 = \frac{91}{6} - (\frac{7}{2})^2 = \frac{91}{6} - \frac{49}{4} = \frac{35}{12}

Example 2: a random variable XX uniformly distributed on the interval [0,1][0, 1]

  • E(X)=12E(X) = \frac{1}{2}
  • E(X2)=∫01x2⋅1dx=x33∣01=13E(X^2) = \int_0^1 x^2 \cdot 1 dx = \frac{x^3}{3}\big|_0^1 = \frac{1}{3}
  • D(X)=E(X2)−[E(X)]2=13−(12)2=13−14=112D(X) = E(X^2) - [E(X)]^2 = \frac{1}{3} - (\frac{1}{2})^2 = \frac{1}{3} - \frac{1}{4} = \frac{1}{12}

Definition of the Standard Deviation

Mathematical Definition of the Standard Deviation

Standard Deviation

The standard deviation of a random variable XX is defined as the arithmetic square root of its variance: σ=D(X)=E[(X−E(X))2]\sigma = \sqrt{D(X)} = \sqrt{E[(X - E(X))^2]}

Intuitive Understanding of the Standard Deviation

Understanding: the standard deviation has the same dimension as the random variable, and it directly reflects the degree of dispersion of the values taken by a random variable.

Examples of the Standard Deviation

Example 3: continuing Example 1, the standard deviation of the die roll

  • σ=D(X)=3512≈1.71\sigma = \sqrt{D(X)} = \sqrt{\frac{35}{12}} \approx 1.71

Example 4: continuing Example 2, the standard deviation of the uniform distribution

  • σ=D(X)=112≈0.289\sigma = \sqrt{D(X)} = \sqrt{\frac{1}{12}} \approx 0.289

Properties of the Variance

Non-negativity

Property 1: D(X)≥0D(X) \geq 0

Proof: D(X)=E[(X−μ)2]≥0D(X) = E[(X - \mu)^2] \geq 0, because the squared term is non-negative.

Variance of a Constant

Property 2: D(c)=0D(c) = 0, where cc is a constant.

Proof: D(c)=E[(c−c)2]=E(0)=0D(c) = E[(c - c)^2] = E(0) = 0

Variance under a Linear Transformation

Property 3: D(aX+b)=a2D(X)D(aX + b) = a^2 D(X), where a,ba, b are constants.

Proof: D(aX+b)=E[(aX+b−E(aX+b))2]=E[(aX+b−aE(X)−b)2]=E[(aX−aE(X))2]=a2E[(X−E(X))2]=a2D(X)D(aX + b) = E[(aX + b - E(aX + b))^2] = E[(aX + b - aE(X) - b)^2] = E[(aX - aE(X))^2] = a^2 E[(X - E(X))^2] = a^2 D(X)

Variance of Independent Random Variables

Property 4: if XX and YY are independent, then D(X+Y)=D(X)+D(Y)D(X + Y) = D(X) + D(Y)

Proof: D(X+Y)=E[(X+Y−E(X+Y))2]=E[(X−E(X)+Y−E(Y))2]D(X + Y) = E[(X + Y - E(X + Y))^2] = E[(X - E(X) + Y - E(Y))^2] =E[(X−E(X))2]+E[(Y−E(Y))2]+2E[(X−E(X))(Y−E(Y))]= E[(X - E(X))^2] + E[(Y - E(Y))^2] + 2E[(X - E(X))(Y - E(Y))] Since XX and YY are independent, E[(X−E(X))(Y−E(Y))]=E(X−E(X))E(Y−E(Y))=0E[(X - E(X))(Y - E(Y))] = E(X - E(X))E(Y - E(Y)) = 0, so: D(X+Y)=D(X)+D(Y)D(X + Y) = D(X) + D(Y)

Additivity of the Variance

Property 5: if X1,X2,…,XnX_1, X_2, \dots, X_n are pairwise independent, then: D(X1+X2+⋯+Xn)=D(X1)+D(X2)+⋯+D(Xn)D(X_1 + X_2 + \dots + X_n) = D(X_1) + D(X_2) + \dots + D(X_n)

Variance of Common Distributions

Two-Point Distribution

Variance of the Two-Point Distribution

Distribution law: P(X=k)=pk(1−p)1−kP(X = k) = p^k(1-p)^{1-k}, k=0,1k = 0, 1

Variance: D(X)=p(1−p)D(X) = p(1-p)

Proof:

  • E(X)=pE(X) = p
  • E(X2)=02⋅(1−p)+12⋅p=pE(X^2) = 0^2 \cdot (1-p) + 1^2 \cdot p = p
  • D(X)=E(X2)−[E(X)]2=p−p2=p(1−p)D(X) = E(X^2) - [E(X)]^2 = p - p^2 = p(1-p)

Binomial Distribution

Variance of the Binomial Distribution

Distribution law: P(X=k)=Cnkpk(1−p)n−kP(X = k) = C_n^k p^k(1-p)^{n-k}, k=0,1,2,…,nk = 0, 1, 2, \dots, n

Variance: D(X)=np(1−p)D(X) = np(1-p)

Proof:

  • E(X)=npE(X) = np
  • E(X2)=∑k=0nk2Cnkpk(1−p)n−kE(X^2) = \sum_{k=0}^n k^2 C_n^k p^k(1-p)^{n-k}
  • Computation gives E(X2)=np+n(n−1)p2E(X^2) = np + n(n-1)p^2
  • D(X)=E(X2)−[E(X)]2=np+n(n−1)p2−n2p2=np(1−p)D(X) = E(X^2) - [E(X)]^2 = np + n(n-1)p^2 - n^2p^2 = np(1-p)

Poisson Distribution

Variance of the Poisson Distribution

Distribution law: P(X=k)=λkk!e−λP(X = k) = \frac{\lambda^k}{k!} e^{-\lambda}, k=0,1,2,…k = 0, 1, 2, \dots

Variance: D(X)=λD(X) = \lambda

Proof:

  • E(X)=λE(X) = \lambda
  • E(X2)=∑k=0∞k2λkk!e−λ=λ+λ2E(X^2) = \sum_{k=0}^{\infty} k^2 \frac{\lambda^k}{k!} e^{-\lambda} = \lambda + \lambda^2
  • D(X)=E(X2)−[E(X)]2=λ+λ2−λ2=λD(X) = E(X^2) - [E(X)]^2 = \lambda + \lambda^2 - \lambda^2 = \lambda

Uniform Distribution

Variance of the Uniform Distribution

Density function: f(x)={1b−a,a≤x≤b0,otherwisef(x) = \begin{cases} \frac{1}{b-a}, & a \leq x \leq b \\ 0, & \text{otherwise} \end{cases}

Variance: D(X)=(b−a)212D(X) = \frac{(b-a)^2}{12}

Proof:

  • E(X)=a+b2E(X) = \frac{a+b}{2}
  • E(X2)=∫abx2⋅1b−adx=b3−a33(b−a)=a2+ab+b23E(X^2) = \int_a^b x^2 \cdot \frac{1}{b-a} dx = \frac{b^3-a^3}{3(b-a)} = \frac{a^2+ab+b^2}{3}
  • D(X)=E(X2)−[E(X)]2=a2+ab+b23−(a+b2)2=(b−a)212D(X) = E(X^2) - [E(X)]^2 = \frac{a^2+ab+b^2}{3} - (\frac{a+b}{2})^2 = \frac{(b-a)^2}{12}

Exponential Distribution

Variance of the Exponential Distribution

Density function: f(x)={λe−λx,x≥00,x<0f(x) = \begin{cases} \lambda e^{-\lambda x}, & x \geq 0 \\ 0, & x < 0 \end{cases}

Variance: D(X)=1λ2D(X) = \frac{1}{\lambda^2}

Proof:

  • E(X)=1λE(X) = \frac{1}{\lambda}
  • E(X2)=∫0∞x2⋅λe−λxdx=2λ2E(X^2) = \int_0^{\infty} x^2 \cdot \lambda e^{-\lambda x} dx = \frac{2}{\lambda^2}
  • D(X)=E(X2)−[E(X)]2=2λ2−(1λ)2=1λ2D(X) = E(X^2) - [E(X)]^2 = \frac{2}{\lambda^2} - (\frac{1}{\lambda})^2 = \frac{1}{\lambda^2}

Normal Distribution

Variance of the Normal Distribution

Density function: f(x)=12πσe−(x−μ)22σ2f(x) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}

Variance: D(X)=σ2D(X) = \sigma^2

Proof:

  • E(X)=μE(X) = \mu
  • Computation by integration gives E(X2)=μ2+σ2E(X^2) = \mu^2 + \sigma^2
  • D(X)=E(X2)−[E(X)]2=μ2+σ2−μ2=σ2D(X) = E(X^2) - [E(X)]^2 = \mu^2 + \sigma^2 - \mu^2 = \sigma^2

Chebyshev’s Inequality

Statement of Chebyshev’s Inequality

Chebyshev's Inequality

Let the expectation of a random variable XX be μ\mu and its variance be σ2\sigma^2. Then for any positive number ε\varepsilon: P(∣X−μ∣≥ε)≤σ2ε2P(|X - \mu| \geq \varepsilon) \leq \frac{\sigma^2}{\varepsilon^2}

Proof

P(∣X−μ∣≥ε)=∫∣x−μ∣≥εf(x)dx≤∫∣x−μ∣≥ε(x−μ)2ε2f(x)dx≤1ε2∫−∞+∞(x−μ)2f(x)dx=σ2ε2P(|X - \mu| \geq \varepsilon) = \int_{|x-\mu| \geq \varepsilon} f(x) dx \leq \int_{|x-\mu| \geq \varepsilon} \frac{(x-\mu)^2}{\varepsilon^2} f(x) dx \leq \frac{1}{\varepsilon^2} \int_{-\infty}^{+\infty} (x-\mu)^2 f(x) dx = \frac{\sigma^2}{\varepsilon^2}

Applications of Chebyshev’s Inequality

Application 1: estimating the probability that a random variable deviates from its expectation Application 2: proving the law of large numbers Application 3: applications in statistical inference

Applications of the Variance

Applications in Statistics

Application 1: the sample variance The sample variance is an unbiased estimator of the population variance.

Application 2: parameter estimation The variance is an important indicator for measuring the quality of an estimator.

Applications in Finance

Application 3: risk assessment The variance is an important indicator for measuring investment risk.

Application 4: portfolio theory Portfolios are optimized through the variance.

Exercises

Exercise 1

Given E(X)=2,D(X)=3E(X)=2, D(X)=3, find D(3X−1)D(3X-1).

varianceproperties of variancecomputation

Approach: Use the properties of the variance.

Steps:

  1. D(3X−1)=32D(X)D(3X-1) = 3^2 D(X)
  2. =9×3=27= 9 \times 3 = 27
  3. Subtracting a constant does not change the variance, while the coefficient 33 enlarges the variance by a factor of 32=93^2 = 9.

Answer: D(3X−1)=27D(3X - 1) = 27.

Exercise 2

Given that the random variable XX follows an exponential distribution with parameter λ\lambda, find D(X)D(X).

varianceexponential distributionvariance computation

Approach: Use the variance formula of the exponential distribution.

Steps:

  1. The variance of the exponential distribution: D(X)=1λ2D(X) = \frac{1}{\lambda^2}
  2. Or compute it directly:
    • E(X)=1λE(X) = \frac{1}{\lambda}
    • E(X2)=∫0∞x2⋅λe−λxdx=2λ2E(X^2) = \int_0^{\infty} x^2 \cdot \lambda e^{-\lambda x} dx = \frac{2}{\lambda^2}
    • D(X)=E(X2)−[E(X)]2=2λ2−(1λ)2=1λ2D(X) = E(X^2) - [E(X)]^2 = \frac{2}{\lambda^2} - (\frac{1}{\lambda})^2 = \frac{1}{\lambda^2}

Answer: 1λ2\frac{1}{\lambda^2}

Exercise 3

Given that the random variable XX follows a binomial distribution with parameters n,pn, p, find D(X)D(X).

variancebinomial distributionvariance computation

Approach: Use the variance formula of the binomial distribution.

Steps:

  1. The variance of the binomial distribution: D(X)=np(1−p)D(X) = np(1-p)
  2. Or compute it directly:
    • E(X)=npE(X) = np
    • E(X2)=np+n(n−1)p2E(X^2) = np + n(n-1)p^2
    • D(X)=E(X2)−[E(X)]2=np(1−p)D(X) = E(X^2) - [E(X)]^2 = np(1-p)

Answer: np(1−p)np(1-p)

Exercise 4

Given the distribution law P(X=1)=0.2,P(X=2)=0.5,P(X=3)=0.3P(X=1)=0.2, P(X=2)=0.5, P(X=3)=0.3 of XX, find D(X)D(X).

variancecovariance formulacomputation

Approach: Use the simplified computation formula for the variance.

Steps:

  1. E(X)=1×0.2+2×0.5+3×0.3=2.1E(X) = 1 \times 0.2 + 2 \times 0.5 + 3 \times 0.3 = 2.1
  2. E(X2)=12×0.2+22×0.5+32×0.3=0.2+2.0+2.7=4.9E(X^2) = 1^2 \times 0.2 + 2^2 \times 0.5 + 3^2 \times 0.3 = 0.2 + 2.0 + 2.7 = 4.9
  3. D(X)=E(X2)−[E(X)]2=4.9−(2.1)2=4.9−4.41=0.49D(X) = E(X^2) - [E(X)]^2 = 4.9 - (2.1)^2 = 4.9 - 4.41 = 0.49

Answer: 0.490.49

Exercise 5

Given that the random variable XX follows a Poisson distribution with parameter λ\lambda, find D(X)D(X).

variancePoisson distributionvariance computation

Approach: Use the variance formula of the Poisson distribution.

Steps:

  1. The variance of the Poisson distribution: D(X)=λD(X) = \lambda
  2. Or compute it directly:
    • E(X)=λE(X) = \lambda
    • E(X2)=λ+λ2E(X^2) = \lambda + \lambda^2
    • D(X)=E(X2)−[E(X)]2=λ+λ2−λ2=λD(X) = E(X^2) - [E(X)]^2 = \lambda + \lambda^2 - \lambda^2 = \lambda

Answer: λ\lambda


Summary

Symbols Used in This Article

Greek LetterPronunciationDescription
ε\varepsilonEpsilon (epsilon)denotes an arbitrary positive number; in Chebyshev’s inequality it represents the degree of deviation
σ\sigmaSigma (sigma)denotes the standard deviation, the arithmetic square root of the variance

Found an issue with this content?

Tell us what could be improved.