Variance of Random Variable Calculator

This variance of random variable calculator finds Var(X) and the standard deviation of a discrete random variable from its probability table.

Checks on your data

  • The shortcut E[X²] − μ² and the direct sum Σ(x − μ)²·P(x) give the same value.
  • A shift b does not change the variance. Only the multiplier a matters, and it enters squared.

Results

Variance Var(X)
0.81
Standard deviation
0.9
Mean E[X]
1.7
E[X²]
3.7
Var(2X + b)
3.24
adding b does not change the variance
Check: Σ(x − μ)²·P(x)
0.81
Probability distribution
00.10.20.30.40: 0.100.11: 0.310.32: 0.420.43: 0.230.2
Calculation table
xP(x)x·P(x)x²·P(x)(x − μ)²·P(x)
00.1000.289
10.30.30.30.147
20.40.81.60.036
30.20.61.80.338
Show step-by-step solution
  1. Mean μ = Σ x·P(x) = 1.7.
  2. E[X²] = Σ x²·P(x) = 3.7.
  3. Var(X) = E[X²] − μ² = 3.7 − 2.89 = 0.81.
  4. Standard deviation = √0.81 = 0.9.
  5. Var(aX + b) = a² Var(X) = 4 × 0.81 = 3.24.
VarianceE[X²] − μ²
LinearVar(aX+b) = a² Var(X)
SD√Var(X)

What Is Variance of Random Variable?

The variance of a random variable measures how spread out its values are around the mean. It is the probability-weighted average of the squared distances from the mean.

You can compute it as E[X²] − μ², or directly as the sum of (x − μ)² times P(x). The calculator does both and shows that they agree.

It also gives the variance of aX + b. Adding b does not change the spread, and multiplying by a multiplies the variance by a².

How to Use the Variance of Random Variable Calculator

  1. Enter the values and their probabilities.
  2. Read the variance and standard deviation.
  3. Use a to get the variance of aX + b.

Variance of Random Variable Formula

Variance

σ2=∑(x−μ)2P(x)=E[X2]−μ2\sigma^2=\sum (x-\mu)^2P(x)=E[X^2]-\mu^2

Linear change

Var(aX+b)=a2 Var(X)Var(aX+b)=a^2\,Var(X)

Variance of Random Variable Variables Explained

SymbolMeaningNotes
μMean of XΣ x·P(x)
E[X²]Mean of the squared valuesΣ x²·P(x)
Var(X)VarianceE[X²] − μ²
σStandard deviation√Var(X)

Variance of Random Variable Worked Example

With the example values loaded in the calculator above, the steps are:

  1. Mean μ = Σ x·P(x) = 1.7.
  2. E[X²] = Σ x²·P(x) = 3.7.
  3. Var(X) = E[X²] − μ² = 3.7 − 2.89 = 0.81.
  4. Standard deviation = √0.81 = 0.9.
  5. Var(aX + b) = a² Var(X) = 4 × 0.81 = 3.24.

Result: Variance Var(X) = 0.81; Standard deviation = 0.9.

Worked example

Take X = 0, 1, 2, 3 with probabilities 0.1, 0.3, 0.4, 0.2. The mean is 1.7 and E[X²] = 0 + 0.3 + 1.6 + 1.8 = 3.7.

Var(X) = 3.7 − 1.7² = 3.7 − 2.89 = 0.81, so the standard deviation is 0.9. For Y = 2X + 1, Var(Y) = 4 × 0.81 = 3.24.

Why a is squared

Scaling every value by a stretches the distances from the mean by a, and the variance uses squared distances. Adding b moves every value the same amount, so the spread does not change.

Where Variance of Random Variable Is Used

Probability homework

Find the variance and SD from a probability table.

Risk comparison

Compare the spread of two payoffs with the same mean.

Linear transforms

Find Var(aX + b) without recomputing the table.

Common Variance of Random Variable Mistakes to Avoid

  • The shortcut formula is faster, but check it against the direct sum when learning.
  • Report the standard deviation when you need the same units as X.

Variance of Random Variable Terms and Definitions

Variance
The expected squared distance of X from its mean.
Standard deviation
The square root of the variance.

Variance of Random Variable FAQs

How do you find the variance of a random variable?

Compute E[X²] and the mean, then subtract the mean squared from E[X²].

What is Var(aX + b)?

a² times Var(X). The constant b does not matter.

Can the variance be negative?

No. It is an average of squares.

How is it different from sample variance?

This is a population-style variance from known probabilities. Sample variance estimates it from data and divides by n − 1.

Related calculators

Last updated 2026-11-09. See our disclaimer.