Probability Descriptive Statistics Random Variables 22 min read July 22, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Mean vs Expected Value: What's the Difference?

You roll a die six times and get a mean of 3.67. The expected value of that die is 3.5. Those two numbers came from completely different calculations — one from data you observed, the other from probabilities you defined. Understanding that difference is one of the conceptual turning points in learning statistics and probability.

This guide explains the mean and expected value side by side: exact definitions, formulas, when they agree, when they don't, and how each is used in real problems involving dice, insurance, finance, and machine learning. An interactive expected value calculator is included at the bottom.

What You'll Learn
  • ✓ The precise definitions of mean and expected value
  • ✓ The arithmetic mean, sample mean, and population mean formulas
  • ✓ The expected value formula for discrete and continuous distributions
  • ✓ Exactly when mean = expected value (and when they differ)
  • ✓ Worked examples: dice, coin tosses, insurance, investment returns
  • ✓ Real-world applications across finance, data science, and decision theory
  • ✓ How to calculate expected value in Python, R, and Excel
  • ✓ Common misconceptions and how to avoid them

Mean vs Expected Value: The Core Difference

📌
Quick Answer — Mean vs Expected Value

The mean is a summary of observed data: add the values and divide by the count. The expected value is a weighted average over a probability distribution: multiply each outcome by its probability and sum the products. When every data point has equal probability, the two formulas produce the same number — but they are different concepts from different branches of statistics.

Symbol for sample mean
μ
Symbol for population mean
E[X]
Symbol for expected value
3.5
E[X] for a fair six-sided die

What Is the Mean?

Definition — The Arithmetic Mean
The mean is the sum of all values in a data set divided by the number of values. It describes the center of a distribution of actual, observed measurements. The mean answers: "What is the typical value in this data?"
x̄ = (x₁ + x₂ + ⋯ + xₙ) / n = (Σxᵢ) / n

The word "mean" without any qualifier usually refers to the arithmetic mean. But the term covers several related concepts depending on context:

Sample Mean (x̄)

The sample mean is calculated from a subset of the population — the data you actually collected. It is an estimate of the true population mean.

Sample Mean Formula
x̄ = (1/n) Σᵢ₌₁ⁿ xᵢ
= sample mean n = number of observations xᵢ = each individual value

Example: You record the test scores of 5 students: 72, 88, 91, 65, 84. The sample mean is (72 + 88 + 91 + 65 + 84) / 5 = 400 / 5 = 80.

Population Mean (μ)

The population mean uses the same formula as the sample mean, but it is applied to the entire population rather than a sample. Because collecting data on every member of a population is rarely possible, μ is usually estimated using x̄. The complete guide to the mean covers how sample size affects the accuracy of this estimate.

Population Mean Formula
μ = (1/N) Σᵢ₌₁ᴺ xᵢ
μ = population mean N = total population size xᵢ = each value in the population
⚡ Mean — Key Facts
  • Input: Actual data values you have observed or measured
  • Symbol: x̄ (sample), μ (population)
  • Formula: Sum of values ÷ count of values
  • Weights: Equal — each data point counts the same
  • When it exists: Only after you have collected data
  • Branch of statistics: Descriptive statistics

What Is Expected Value?

Definition — Expected Value (Expectation)
The expected value of a random variable X, written E[X] or μₓ, is the probability-weighted average of all possible outcomes. It represents the long-run average you would observe if you repeated a random experiment an infinite number of times. The expected value answers: "What will happen on average in the long run?"
E[X] = Σ xᵢ · P(X = xᵢ) [discrete]

The concept was developed from the mathematical theory of probability — it predates modern statistics by two centuries. The formalization you learn today traces back to the work of Christiaan Huygens (1657), Abraham de Moivre, and Pierre-Simon Laplace.

Expected Value: Discrete Random Variables

When a random variable can take on a finite or countably infinite number of values — like dice outcomes, counts of defects, or number of customer arrivals — the expected value uses a sum over all outcomes.

Expected Value — Discrete Random Variable
E[X] = Σᵢ xᵢ · P(X = xᵢ)
E[X] = expected value xᵢ = each possible outcome P(X = xᵢ) = probability of that outcome Σ = sum over all outcomes

Expected Value: Continuous Random Variables

When a random variable can take any value in an interval — like heights, temperatures, or time-to-failure — the sum becomes an integral over the probability density function (PDF), f(x).

Expected Value — Continuous Random Variable
E[X] = ∫₋∞^∞ x · f(x) dx
f(x) = probability density function x = value of the random variable = integral over all possible values
⚡ Expected Value — Key Facts
  • Input: A probability distribution, not observed data
  • Symbol: E[X], 𝔼[X], μₓ, or ⟨X⟩
  • Formula: Sum (or integral) of outcome × probability
  • Weights: Unequal — each outcome weighted by its probability
  • When it exists: Before any data is collected; it's a property of the distribution
  • Branch of statistics: Probability theory
  • Can it be impossible? Yes — E[X] = 3.5 for a fair die; you can't roll 3.5
Expected value formalization: de Moivre, A. (1718). The Doctrine of Chances. London. Axiomatic probability framework: Andrey Kolmogorov (1933). Foundations of the Theory of Probability.

Key Differences: Mean vs Expected Value

The table below compares the two concepts across every dimension that matters for statistics students and practitioners. Study the "Data source" and "When to use" rows — those capture the most important distinction.

Dimension Mean (x̄ or μ) Expected Value E[X]
Data source Observed, collected data Theoretical probability distribution
Symbol x̄ (sample), μ (population) E[X], 𝔼[X], μₓ
Core formula (Σxᵢ) / n Σ xᵢ · P(X = xᵢ)
Weights Equal (1/n per point) Unequal (P(X=xᵢ) per outcome)
Exists before data? No — needs actual observations Yes — it's a property of the distribution
Can be impossible? No — it's in the range of the data Yes — E[die] = 3.5; you can't roll 3.5
Branch Descriptive statistics Probability theory
Primary use Summarizing collected data Decision-making under uncertainty
Convergence Stabilizes as n → ∞ Sample mean → E[X] as n → ∞ (Law of Large Numbers)
Related concept Variance, standard deviation Variance of X, E[X²] − (E[X])²

When Are Mean and Expected Value Equal?

Mean and expected value produce the same number in two related situations:

1

Uniform Distribution (Equal Probabilities)

If every outcome in a data set has equal probability — as in a simple list where each value is equally likely — then the expected value formula reduces exactly to the arithmetic mean formula. For a data set {2, 4, 6}, each value has probability 1/3, so E[X] = 2(1/3) + 4(1/3) + 6(1/3) = 4, which equals (2 + 4 + 6)/3 = 4.

2

Large Sample Convergence (Law of Large Numbers)

As you collect more data, the sample mean x̄ converges to the true expected value E[X]. This is precisely what the Law of Large Numbers guarantees. Roll a fair die thousands of times: your running average will creep toward 3.5 even though each individual roll is a whole number from 1 to 6.

⚠️
Common Misconception

Students sometimes write E[X] = x̄ unconditionally. That is only true under uniform probabilities or in the limit of infinite samples. In a loaded die where P(6) = 0.5, E[X] ≠ (1+2+3+4+5+6)/6 = 3.5 — the expected value must account for the unequal probabilities.

Worked Examples: Mean vs Expected Value

Each example below calculates both quantities side by side. The contrast shows exactly where the two diverge — and where they agree.

Example 1 — Fair Six-Sided Die

Worked Example 1 — Dice Roll

You roll a fair six-sided die 12 times and record: 3, 1, 5, 2, 6, 4, 3, 1, 2, 5, 6, 4. Calculate the sample mean and the theoretical expected value. Compare them.

Fair Die Probability Distribution
P(X = k) = 1/6 for k = 1, 2, 3, 4, 5, 6
1

Sample mean from observed data:
Sum = 3+1+5+2+6+4+3+1+2+5+6+4 = 42
x̄ = 42 / 12 = 3.50

2

Expected value from the probability distribution:
E[X] = 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6)
E[X] = (1+2+3+4+5+6)/6 = 21/6 = 3.5

3

Why are they equal here? Because the die is fair — each face has probability 1/6 = 1/n, which is exactly a uniform distribution. When all outcomes have equal probability, E[X] = x̄ by algebraic identity.

✅ For this specific roll: x̄ = 3.50 and E[X] = 3.5. They match because the die is fair. With a different 12-roll sequence, x̄ would vary (e.g., 3.67 or 3.17), but E[X] stays fixed at 3.5 regardless of what you rolled.

Example 2 — Loaded Die (Non-Uniform Probabilities)

Worked Example 2 — Loaded Die

A biased die has P(6) = 0.5 and P(1) = P(2) = P(3) = P(4) = P(5) = 0.1. What is E[X]? How does this differ from the simple arithmetic mean of the outcomes?

1

Simple arithmetic mean of the six faces (ignoring probabilities):
(1+2+3+4+5+6)/6 = 21/6 = 3.5

2

Expected value using the actual probability distribution:
E[X] = 1(0.1) + 2(0.1) + 3(0.1) + 4(0.1) + 5(0.1) + 6(0.5)
E[X] = 0.1 + 0.2 + 0.3 + 0.4 + 0.5 + 3.0 = 4.5

✅ The arithmetic mean of the six numbers is 3.5. The expected value for this biased die is 4.5. They differ because the die is not fair. This example shows why you cannot use E[X] = "sum of outcomes / number of outcomes" unless the distribution is uniform. The expected value correctly weights each outcome by its actual probability.

Example 3 — Insurance Premium (Real-World Finance)

Worked Example 3 — Insurance

An insurance company models claims. In any given year, a policyholder has a 2% chance of making a $20,000 claim, a 5% chance of making a $5,000 claim, and a 93% chance of making no claim ($0). What is the expected annual claim? What is the mean of historical payouts from 1,000 past policyholders?

1

Expected value (from the probability model):
E[Claim] = $20,000(0.02) + $5,000(0.05) + $0(0.93)
E[Claim] = $400 + $250 + $0 = $650

2

Observed mean from 1,000 policyholders:
Approx. 20 had $20,000 claims → 20 × $20,000 = $400,000
Approx. 50 had $5,000 claims → 50 × $5,000 = $250,000
Total paid = $650,000 → Mean = $650,000 / 1,000 = $650

3

Why are they equal? With 1,000 policyholders whose observed frequencies match the theoretical probabilities almost exactly, the sample mean closely approximates E[X]. The Law of Large Numbers guarantees this convergence.

✅ E[Claim] = $650 per policyholder per year. Insurance companies use this number — the expected value — to set premiums (they charge more than $650 to cover administrative costs and maintain a profit margin). The sample mean from past data confirms the model's accuracy.

Example 4 — Coin Flip (Expected Value vs Possible Outcomes)

Worked Example 4 — Coin Flip

Let X = number of heads in a single fair coin flip. X can be 0 (tails) or 1 (heads), each with probability 0.5. Find E[X] and explain why it is not a possible outcome.

1

Calculate E[X]:
E[X] = 0(0.5) + 1(0.5) = 0 + 0.5 = 0.5

2

Interpretation: You can never flip half a head. The expected value 0.5 is not a possible outcome — it is the long-run average. If you flip a coin 1,000 times, the average number of heads per flip will be very close to 0.5. This is the Law of Large Numbers in action.

✅ E[X] = 0.5 heads per flip. This is impossible on any single flip, but the sample mean over many flips converges to exactly 0.5. This example makes clear that expected value is a theoretical long-run property, not a prediction for any single trial.

Example 5 — Investment Return

Worked Example 5 — Portfolio Return

An investor models a stock. Next year, the stock has a 30% chance of gaining 20%, a 50% chance of gaining 5%, and a 20% chance of losing 10%. Calculate the expected return. How does this compare to simply averaging 20%, 5%, and −10%?

1

Simple average of outcomes (unweighted mean):
(20% + 5% + (−10%)) / 3 = 15% / 3 = 5%

2

Expected value (probability-weighted):
E[Return] = 20%(0.30) + 5%(0.50) + (−10%)(0.20)
E[Return] = 6% + 2.5% − 2% = 6.5%

✅ The unweighted average suggests 5% return; the expected value (correctly weighted by probabilities) gives 6.5%. The difference matters for investment decisions. Finance uses E[X] — not simple averages — because each scenario has a different likelihood. The probability-weighted approach is the correct one for expected value problems in risk management.

Expected value in finance: Ross, S. (2019). Introduction to Probability Models (12th ed.). Academic Press. Investment return modeling: Yale Statistics Department — Random Variables and Expected Value.

The Law of Large Numbers: Where They Meet

The bridge between the sample mean and the expected value is the Law of Large Numbers (LLN). The LLN states that as the sample size n grows without bound, the sample mean x̄ converges to the expected value E[X] with probability 1.

Law of Large Numbers (Weak Form)
lim n→∞ P(|x̄ₙ − E[X]| > ε) = 0
x̄ₙ = sample mean with n observations E[X] = true expected value ε = any positive tolerance

In practical terms: roll a die twice and your sample mean might be 2.0 or 5.5 — far from 3.5. Roll it 10,000 times and your sample mean will be very close to 3.5. The Law of Large Numbers is why casinos are profitable (they know their expected value per game) and why insurance companies can price policies accurately (their expected claim costs converge as portfolio size grows).

The Connection in One Sentence

The expected value E[X] is what the sample mean converges to as you collect more data. The sample mean is what you observe; the expected value is the theoretical target it is converging toward.

Expected Value Across Probability Distributions

Different probability distributions have known expected value formulas. The table below lists the most common ones.

Distribution Parameters E[X] Formula Example E[X]
Uniform (discrete) a, b (integers) (a + b) / 2 Fair die: (1+6)/2 = 3.5
Binomial n, p np 10 flips, p=0.5: E[X] = 5
Poisson λ λ λ=3: E[X] = 3
Normal μ, σ² μ N(100, 225): E[X] = 100
Exponential λ 1/λ λ=0.25: E[X] = 4
Geometric p 1/p p=0.2: E[X] = 5
Uniform (continuous) a, b (a + b) / 2 U(0,1): E[X] = 0.5

Notice that for the normal distribution, E[X] = μ — the parameter μ in the normal distribution is literally its expected value. This makes the normal distribution a natural bridge: the population mean μ and the expected value E[X] are the same quantity, which is why the notation overlaps.

Properties of Expected Value

Expected value has algebraic properties that make it powerful for calculations. Understanding these separates working knowledge from deep understanding. These properties hold for any random variables X and Y and any constants a and b.

Property Formula What It Means
Linearity (scaling) E[aX] = a · E[X] Scale the variable by a, scale the expectation by a
Linearity (addition) E[X + Y] = E[X] + E[Y] Always true regardless of independence
Constant E[a] = a The expectation of a constant is the constant itself
Shift E[X + b] = E[X] + b Adding a constant shifts the expected value by that constant
Product (independent) E[XY] = E[X] · E[Y] Only when X and Y are independent
Jensen's inequality E[f(X)] ≥ f(E[X]) if f is convex E[X²] ≥ (E[X])²; basis of variance formula

The linearity of expectation is particularly useful. It means E[X+Y] = E[X] + E[Y] regardless of whether X and Y are correlated — a result that has no equivalent for the variance. This property makes complex problems tractable: the expected total on two dice is E[die 1] + E[die 2] = 3.5 + 3.5 = 7, without needing to enumerate all 36 outcomes.

Real-World Applications

🎰

Casino Games

The house edge is an expected value calculation. Every game has E[player winnings] < 0. In roulette, E[X] on a $1 bet on red is −$0.053 (American roulette, with two green slots).

🛡️

Insurance Pricing

Actuaries calculate E[claim cost per policy] to set premiums. The premium must exceed E[X] to keep the company solvent. Historical data (sample mean) validates the model.

📈

Finance

Portfolio theory uses E[return] to compare investments. The expected return weights each scenario by its probability — not a simple average of historical returns.

🤖

Machine Learning

Loss functions are expectations: the Mean Squared Error (MSE) is E[(ŷ − y)²]. Training a model minimizes this expected value over the data distribution.

🏥

Clinical Trials

The expected treatment effect guides sample size calculations. Researchers need enough participants for the sample mean to accurately estimate E[effect].

📦

Operations & Supply Chain

E[demand] determines optimal inventory levels. Setting stock below E[demand] risks stockouts; setting it too high increases holding costs. Both are expected value trade-offs.

🧪

A/B Testing

The observed mean conversion rate for each variant is compared statistically. The goal is to estimate E[conversion | version A] and E[conversion | version B]. See the guide on A/B testing with statistics.

📊

Data Science

Exploratory data analysis uses the sample mean as a quick summary. Modeling uses expected value to define the target the mean is estimating. These are complementary, not competing, tools. See exploratory data analysis.

Decision Guide: Which One Should You Use?

Mean vs Expected Value: Which to Calculate?

Do you have actual observed data (a list of measurements)?
Calculate the sample mean x̄
Do you have a probability distribution or known probabilities for outcomes?
Calculate the expected value E[X]
Are you predicting long-run behavior from a theoretical model?
Use expected value E[X]
Are you summarizing past measurements for reporting?
Use the arithmetic mean x̄
Are you making a decision under uncertainty (finance, insurance, strategy)?
Use expected value E[X] (possibly with variance too)
Are your outcomes not equally likely?
Use the weighted mean or E[X] — never the simple average

Common Misconceptions

Misconception Wrong Thinking Correct Understanding
Mean = Expected value, always They're the same formula Equal only under uniform distribution or in the limit as n → ∞
E[X] predicts the next outcome The die will land on 3.5 E[X] is a long-run average; individual outcomes vary
Expected value must be a possible outcome E[X] = 3.5 is wrong because you can't roll 3.5 E[X] can be any number, including impossible outcomes
Larger samples give you E[X] exactly With 1,000 flips, x̄ = 0.5 exactly x̄ converges toward E[X] probabilistically, with some residual variance
Weighted mean and expected value are different things They use different formulas They are mathematically identical when weights are probabilities
Sample mean = population mean x̄ equals μ x̄ estimates μ; they differ unless the entire population is sampled

Calculating Mean and Expected Value in Software

All three major tools for statistical work — Python, R, and Excel — make both calculations straightforward. The differences in syntax reflect the difference in concept: the mean function operates on data arrays, while expected value requires you to supply probabilities explicitly.

Python (NumPy / SciPy)

# ── Mean of observed data ── import numpy as np data = [1, 3, 5, 2, 6, 4, 3, 1] sample_mean = np.mean(data) print(f"Sample mean: {sample_mean}") # 3.125 # ── Expected value from a probability distribution ── outcomes = np.array([1, 2, 3, 4, 5, 6]) probs = np.array([1/6] * 6) # fair die expected_val = np.dot(outcomes, probs) print(f"Expected value: {expected_val}") # 3.5 # ── Loaded die example ── probs_loaded = np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.5]) ev_loaded = np.dot(outcomes, probs_loaded) print(f"Loaded die E[X]: {ev_loaded}") # 4.5

R

# ── Mean of observed data ── data <- c(1, 3, 5, 2, 6, 4, 3, 1) mean(data) # 3.125 # ── Expected value from probability distribution ── outcomes <- 1:6 probs <- rep(1/6, 6) sum(outcomes * probs) # 3.5 # ── Verify Law of Large Numbers ── set.seed(42) rolls <- sample(1:6, size = 10000, replace = TRUE) mean(rolls) # converges to ~3.5

Excel

' ── Sample mean ── ' Put your data in A1:A8, then use: =AVERAGE(A1:A8) ' Returns the arithmetic mean ' ── Expected value ── ' Outcomes in A1:A6, probabilities in B1:B6 =SUMPRODUCT(A1:A6, B1:B6) ' Returns E[X] ' ── For a fair die ── ' A1:A6 = {1,2,3,4,5,6}, B1:B6 = {1/6,1/6,...,1/6} =SUMPRODUCT({1,2,3,4,5,6},{1/6,1/6,1/6,1/6,1/6,1/6}) ' Returns 3.5
NumPy documentation: numpy.org — numpy.mean. SciPy stats: scipy.org — scipy.stats.

Expected Value Calculator

Enter up to 6 outcomes and their probabilities below. The calculator computes E[X], the mean of the outcomes (assuming equal weights), and their difference. Probabilities must sum to 1.

Expected Value Calculator

Outcome (xᵢ)
Probability P(X = xᵢ)

Glossary: Mean, Expected Value, and Related Terms

Term Symbol Definition
Arithmetic mean x̄ or μ Sum of values divided by count; the standard "average"
Sample mean Mean calculated from a subset (sample) of the population
Population mean μ Mean calculated from every member of the population
Expected value E[X], μₓ Probability-weighted average of all outcomes of a random variable
Expectation 𝔼[X] Same as expected value; notation preferred in measure theory
Random variable X A variable whose value is determined by a random process
Probability distribution P(X = x) A function that assigns probabilities to all possible outcomes of X
PMF P(X = xᵢ) Probability Mass Function; gives the probability of each discrete outcome
PDF f(x) Probability Density Function; continuous analog of the PMF
Weighted mean x̄w Mean where each value is multiplied by a weight; identical to E[X] when weights are probabilities
Variance Var(X), σ² Expected value of the squared deviation from the mean: E[(X − μ)²]
Standard deviation σ Square root of variance; same units as X
Law of Large Numbers LLN As n → ∞, x̄ → E[X] with probability 1
Central Limit Theorem CLT For large n, the distribution of x̄ approaches Normal with mean E[X]
Discrete distribution A probability distribution over countable outcomes (e.g., die, binomial)
Continuous distribution A probability distribution over an interval (e.g., normal, exponential)

Frequently Asked Questions

The mean is calculated from observed data by averaging the values in a sample or population. The expected value is calculated from a probability distribution by multiplying each possible outcome by its probability and summing the results. The mean summarizes collected data, while the expected value represents the theoretical long-run average of a random variable.
Not always. The expected value describes the theoretical average based on a probability distribution, whereas the mean summarizes observed data. As the sample size becomes very large, the sample mean approaches the expected value according to the Law of Large Numbers. They are equal only in special situations, such as when all observed outcomes are equally likely.
Yes. For example, the expected value of rolling a fair six-sided die is 3.5, even though no single roll can produce 3.5. Expected value represents the average outcome over many repetitions, not the result of an individual observation.
For a discrete random variable, the expected value is calculated using E(X) = Σ[x × P(x)]. Multiply each possible outcome by its probability and add the products together. For a fair die, this calculation gives an expected value of 3.5.
Many machine learning algorithms define their objective as minimizing an expected loss over the underlying data distribution. During training, this expectation is approximated using the average loss across the available training data or mini-batches. As more data are collected, the sample average becomes a better estimate of the true expected loss.
When the weights in a weighted mean represent probabilities and sum to 1, the weighted mean and the expected value are mathematically identical. Both use the same formula, but the term weighted mean is commonly used for data summaries, whereas expected value is used in probability theory.
For a normal distribution with parameters N(μ, σ²), the expected value is μ. Because the normal distribution is symmetric, the mean, median, mode, and expected value are all equal to μ.
Larger sample sizes produce more accurate estimates of the expected value because the standard error decreases as 1/√n. As the sample size increases, the sample mean becomes more stable and is more likely to be close to the true population mean or expected value.

Sources and Further Reading

  • DeGroot, M.H. & Schervish, M.J. (2012)Probability and Statistics (4th ed.). Addison-Wesley. Chapter 4: Expectation; Chapter 7: Estimation. The standard graduate-level reference for probability and statistical theory.
  • Wackerly, D., Mendenhall, W. & Scheaffer, R. (2008)Mathematical Statistics with Applications (7th ed.). Cengage. Core undergraduate reference covering E[X] and sample means side by side.
  • OpenStax (2022)Introductory Statistics (OpenStax). Free, peer-reviewed textbook covering both descriptive statistics (means) and probability (expected value). openstax.org
  • NIST/SEMATECH (2023)e-Handbook of Statistical Methods. Authoritative government reference covering the mean, expected value, and probability distributions. itl.nist.gov
  • Khan AcademyExpected Value. Free video lessons covering E[X] for discrete distributions with worked examples. khanacademy.org
  • MIT OpenCourseWare (2018)6.041 Probabilistic Systems Analysis. Free lecture notes and problem sets on expected value and its properties. ocw.mit.edu