---
title: "Expected Value and Variance of a Discrete Random Variable"
description: "Weight each value by its probability to get the long-run mean, and use E(X²) minus the square of E(X) for the variance. Both turn a distribution into a decision about whether something is worth doing."
canonical: https://lightmysky.com/learn/mathematics/expected-value-and-variance-of-a-discrete-random-variable-mt_PFdo0Nm3FP
source: https://lightmysky.com/learn/mathematics/expected-value-and-variance-of-a-discrete-random-variable-mt_PFdo0Nm3FP.md
retrieved: 2026-09-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# Expected Value and Variance of a Discrete Random Variable

Weight each value by its probability to get the long-run mean, and use E(X²) minus the square of E(X) for the variance. Both turn a distribution into a decision about whether something is worth doing.

Subject: Mathematics · Area: Probability · Ages 16 to 17
Page: https://lightmysky.com/learn/mathematics/expected-value-and-variance-of-a-discrete-random-variable-mt_PFdo0Nm3FP

## Ready when they can

- Calculate E(X) for a given distribution
- Calculate Var(X) from E(X²) and E(X)
- Decide whether a game with a stake is fair

## Lesson: One Number for a Whole Distribution

The fair's other spinner stall has its distribution written out. The prize X is 0, 1 or 5 pounds, with probabilities 0.6, 0.3 and 0.1. That table answers every question about one spin, and the stall needs something it cannot answer: what a go is worth on average, so a stake can be set. The whole table has to collapse into one number, and the way to do it is to let each prize pull with the weight of its own probability.

*(drawing: A hundred players sorted by prize. The tall bar wins nothing at all, and the short one takes most of the money out of the till.)*

Follow those hundred players. Sixty win nothing, which pays out 0 pounds. Thirty win a pound, which pays out 30. Ten win five, which pays out 50. The stall hands over 80 pounds across 100 goes, so a go is worth 0.80 on average. Written from the table, that is 0 × 0.6 + 1 × 0.3 + 5 × 0.1 = 0.8. Every value weighted by its own probability, then totalled: that answer is called the expected value, or E(X).

Now the thing to be careful about. Nobody wins 80p. The spinner pays 0, 1 or 5, and 0.80 is not one of them and never will be. E(X) is the long-run average per go, not a prediction of any single go, and it does not have to be a value the variable can take. It is the point where the distribution balances, in the same way a mean of 2.1 visits described members who all made whole visits.

*(drawing: The average of a set of prizes need not be one of the prizes. That is not a fault in the arithmetic; it is what an average is.)*

**Example.** E(X) says where the distribution sits. The variance says how far it spreads, and it is built the same way: Var(X) = E(X²) - [E(X)]². Square each value, weight it by its probability and add, which gives E(X²) = 0² × 0.6 + 1² × 0.3 + 5² × 0.1 = 2.8. Then take off the square of the mean: 2.8 - 0.8² = 2.8 - 0.64 = 2.16. Squaring first and subtracting after is the whole method, and because it is built from squares a variance can never come out negative.

The stall charges 1 pound a go and pays 0.80 on average, so it keeps 0.20 of every stake. A game is called fair when the stake equals the expected winnings, and this one is not: the player loses 20p a go in the long run. Across 400 goes the stall expects to keep 400 × 0.2 = 80 pounds, which is what pays for the marquee. Nothing dishonest in that, as long as nobody is told the odds are even. Position and spread are separate dials: a stall can leave E(X) exactly where it is and change how wildly the payouts swing.

**Recap.** The expected value E(X) is every value multiplied by its probability and added up, and it is the long-run average per go rather than a prediction of one go. It need not be a value the variable can ever take. The variance is E(X²) minus the square of E(X): square each value, weight, add, then subtract. A game is fair when the stake equals the expected winnings, and the gap between them is what the stall keeps per go.

## Practice

30 questions on this page, each with its working shown.

## Needs first

- [Relative Frequency and Expected Outcomes](https://lightmysky.com/learn/mathematics/relative-frequency-and-expected-outcomes-mt_OQCnzkcHUH)
- [Discrete Random Variables and Probability Distributions](https://lightmysky.com/learn/mathematics/discrete-random-variables-and-probability-distributions-mt_yKztNkvvq3)

## Opens up

- [Normalisation and Expectation Values](https://lightmysky.com/learn/science/normalisation-and-expectation-values-mt_6Y3DZ8P1qm)
- [Randomised Quicksort and Expected Running Time](https://lightmysky.com/learn/computing/randomised-quicksort-and-expected-running-time-mt_fcKF7zfzpX)
- [Expectation and Variance by Integration](https://lightmysky.com/learn/mathematics/expectation-and-variance-by-integration-mt_kRSaKgp3bs)
- [The Binomial Distribution](https://lightmysky.com/learn/mathematics/the-binomial-distribution-mt_X2kVGK67Md)
