Variance (of a discrete random variable)

Thanks for visiting NZMaths.
We are preparing to close this site by the end of August 2024. Maths content is still being migrated onto Tāhūrangi, and we will be progressively making enhancements to Tāhūrangi to improve the findability and presentation of content.
 

For more information visit https://tahurangi.education.govt.nz/updates-to-nzmaths

A measure of spread for a distribution of a random variable that determines the degree to which the values of a random variable differ from the expected value.

The variance of random variable X is often written as Var(X) or σ2 or σ2x.

For a discrete random variable the variance is calculated by summing the product of the square of the difference between the value of the random variable and the expected value, and the associated probability of the value of the random variable, taken over all of the values of the random variable.

In symbols, Var(X) = (x - µ)2 P(X = x)  

An equivalent formula is, Var(X) = E(X2) – [E(X)]2

The square root of the variance is equal to the standard deviation.

Example

Random variable X has the following probability function:

 

 

x 0 1 2 3
P(X = x) 0.1 0.2 0.4 0.3


Using Var(X) = (x - µ)2 P(X = x)

 

 

µ    = 0 x 0.1 + 1 x 0.2 + 2 x 0.4 + 3 x 0.3
        = 1.9

Var(X)    = (0 – 1.9)2x 0.1 + (1 – 1.9)2x 0.2 + (2 – 1.9)2x 0.4 + (3 – 1.9)2x 0.3
    = 0.89
 
Using Var(X) = E(X2) – [E(X)]2  

E(X)    = 0 x 0.1 + 1 x 0.2 + 2 x 0.4 + 3 x 0.3
    = 1.9

E(X2)    = 02 × 0.1 + 12 × 0.2 + 22 × 0.4 + 32 × 0.3
        = 4.5

Var(X)    = 4.5 – 1.92  
        = 0.89

See: population variance, variance

Curriculum achievement objectives reference
Probability: (Level 8)