core practice · coding problem

Expectation and variance of a discrete RV

X takes values {0, 1, 2} with probabilities {0.2, 0.5, 0.3}. Compute E[X] and Var(X) = E[X²] − (E[X])².

The mechanism

A random variable is a function from outcomes to numbers. Expectation is the long-run average; variance measures spread. The CLT says sums of many independent pieces look Gaussian — which is why normal distributions are everywhere.

Study Random Variables & Distributions

Expected evidence

E[X] = 1.1, E[X²] = 1.5, Var(X) = 0.29.

Try this drill in the practice workspace →

Hints when you need them
  • E[X] = Σ x·P(X=x).
  • Compute E[X²] before subtracting the squared mean.

Watch for these mistakes

  • Confusing the PDF value with a probability (for continuous RVs)
  • Assuming small samples look like their population distribution
  • Using variance when you mean standard deviation in an explanation

Check the sources

Practice the same mechanism

Browse all practice briefs