Mean and SD of Random Variables

A random variable is a numerical outcome of a random process — for example, the number showing when you roll a die, or the amount of rainfall in a city on a randomly chosen day. Rather than asking about a single outcome, we often want to summarize the entire probability distribution with just a few numbers. The two most important summaries are the expected value (mean) and the standard deviation. The expected value μ (also written E[X]) tells you the long-run average: if you repeated the random experiment thousands of times and averaged all the results, you would get closer and closer to E[X]. It is a weighted average of every possible value, where each value is weighted by its probability. The standard deviation σ measures how spread out the outcomes are around that mean — a small σ means outcomes cluster tightly near μ, while a large σ means they scatter widely. These two parameters appear everywhere in statistics, science, finance, and engineering. Understanding how to calculate and interpret them for discrete random variables is a foundational skill that unlocks hypothesis testing, confidence intervals, the Central Limit Theorem, and much more.

Key takeaways
  • Set Up the Probability Distribution
  • Calculate the Expected Value (Mean)
  • Calculate the Variance
  • Calculate the Standard Deviation
  • Linear Transformations

Set Up the Probability Distribution

Write a table listing every possible value x that the random variable X can take, along with the corresponding probability P(X = x). Every probability must be between 0 and 1, and all probabilities must sum to exactly 1: ΣP(X = x) = 1. For example, a fair six-sided die has values {1, 2, 3, 4, 5, 6} each with probability 1/6.

Calculate the Expected Value (Mean)

Multiply each value x by its probability P(X = x) and add all those products together. This gives μ = E[X] = Σ x · P(X = x). For the fair die: μ = 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 21/6 = 3.5. Note that 3.5 is not itself a possible outcome — the expected value is a theoretical long-run average, not necessarily an observable value.

Calculate the Variance

The variance σ² measures the average squared distance from the mean. Compute (x − μ)² for each value, multiply by P(X = x), and sum: σ² = Var(X) = Σ (x − μ)² · P(X = x). An equivalent shortcut formula is σ² = E[X²] − (E[X])², where E[X²] = Σ x² · P(X = x). This shortcut is often faster when doing calculations by hand.

Calculate the Standard Deviation

Take the positive square root of the variance: σ = √(Var(X)). The standard deviation is in the same units as X itself, making it easier to interpret than the variance. For the die: σ² = (1−3.5)²(1/6) + (2−3.5)²(1/6) + ... + (6−3.5)²(1/6) = (6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 6.25)/6 = 17.5/6 ≈ 2.917, so σ ≈ 1.708.

Linear Transformations

If Y = aX + b for constants a and b, then E[Y] = a·E[X] + b and Var(Y) = a²·Var(X), giving σ_Y = |a|·σ_X. Adding a constant b shifts the distribution but does not change its spread; multiplying by a scales both the mean and the standard deviation. This rule is essential when converting units or standardizing variables.

The Key Equation

μ=E[X]=∑ixi P(X=xi),σ=∑i(xi−μ)2 P(X=xi)\mu = E[X] = \sum_{i} x_i \, P(X = x_i), \qquad \sigma = \sqrt{\sum_{i}(x_i - \mu)^2 \, P(X = x_i)}
  • \mu — Expected value (mean) (same as X): The probability-weighted average of all possible values; the long-run average outcome.
  • x_i — Possible value (same as X): The i-th specific outcome that the random variable X can take.
  • P(X = x_i) — Probability (dimensionless): The probability that X equals the specific value x_i; all probabilities sum to 1.
  • \sigma — Standard deviation (same as X): A measure of how spread out the distribution is around the mean; square root of the variance.
  • (x_i - \mu)^2 — Squared deviation (square of X's unit): The squared distance of each outcome from the mean, measuring how far that outcome strays.

Worked Example

Problem. A carnival game awards prizes based on spinning a wheel. The wheel can land on 0(probability0.50),0 (probability 0.50), 2 (probability 0.30), 5(probability0.15),or5 (probability 0.15), or 10 (probability 0.05). Find the expected prize money and the standard deviation of winnings.

E[X]=$1.85,σ≈$2.56E[X] = \$1.85, \quad \sigma \approx \$2.56

Answer. Expected value = 1.85;Standarddeviation≈1.85; Standard deviation \approx 2.56

Figure
Diagram
Probability Distribution: Carnival Wheel00.20.40.60.500.300.150.05$0$2$5$10Prize Amountμ = $1.85Probability
Origins · 1 minChristiaan Huygens and how this was discovered
CH
Christiaan Huygens
1629–1695 · Dutch

Huygens published 'De Ratiociniis in Ludo Aleae' (On Reasoning in Games of Chance) in 1657, the first printed work on probability theory. In it he introduced the concept of 'expectation' — the expected value — as the fair price to pay for entering a game of chance. He formalized the idea that a rational gambler should value a game by the probability-weighted average of its prizes, laying the direct mathematical foundation for E[X]. Huygens was also a prolific inventor who built the first pendulum clock and discovered Saturn's moon Titan — he applied the same rigorous mathematical thinking to astronomy, physics, and probability.

  • Discrete Random Variables and Probability Distributions — Understanding probability distributions is the prerequisite for computing expected value and standard deviation — you must first know how to assign probabilities to each outcome.
  • Binomial Distribution — The binomial distribution is a key discrete random variable with mean μ = np and standard deviation σ = √(np(1−p)), providing a direct application of these formulas.
  • Central Limit Theorem — The CLT describes what happens to the mean of many independent random variables — it relies directly on E[X] and σ to describe the sampling distribution.
  • Normal Distribution — The normal distribution is fully defined by its mean μ and standard deviation σ, making these two parameters the essential bridge between random variables and the bell curve.