Back to Calculators

Expectation Calculator

Calculate the expected value of discrete and continuous random variables.

E(X) = x₁p₁ + x₂p₂ + ... + xₙpₙ where x are the values and p are their probabilities

Enter values and probabilities:
Advertisement

What is Expected Value?

The expected value (or mathematical expectation) of a random variable is the long-run average value of repetitions of the experiment it represents. More precisely, the expected value is the weighted average of all possible values that a random variable can take, with the weights given by the respective probabilities.

Intuitively, the expected value represents the "center of mass" of a probability distribution, indicating where the distribution is balanced.

How to Calculate Expected Value

For Discrete Random Variables

If X is a discrete random variable that takes values x₁, x₂, ..., xₙ with probabilities p₁, p₂, ..., pₙ respectively, then the expected value of X is calculated as:

E(X) = x₁p₁ + x₂p₂ + ... + xₙpₙ = Σxᵢpᵢ

Example:

Consider rolling a fair six-sided die. The possible values are 1, 2, 3, 4, 5, and 6, each with a probability of 1/6.

E(X) = 1×(1/6) + 2×(1/6) + 3×(1/6) + 4×(1/6) + 5×(1/6) + 6×(1/6) = 3.5

For Continuous Random Variables

If X is a continuous random variable with probability density function f(x), then the expected value is calculated using the integral:

E(X) = ∫x·f(x)dx

Where the integral is taken over the entire range of X.

Example:

For a uniform distribution on the interval [a, b], the probability density function is f(x) = 1/(b-a) for a ≤ x ≤ b.

E(X) = ∫x·(1/(b-a))dx from a to b = (1/(b-a))·∫x·dx from a to b = (1/(b-a))·[x²/2]ᵃᵇ = (b²-a²)/(2(b-a)) = (a+b)/2

Thus, the expected value of a uniform distribution on [a, b] is (a+b)/2, which is the midpoint of the interval.

Properties of Expected Value

Linearity of Expectation

One of the most important properties of expected value is its linearity:

  • E(aX + b) = a·E(X) + b for any constants a and b
  • E(X + Y) = E(X) + E(Y) for any random variables X and Y

This property holds regardless of whether X and Y are independent.

Expected Value of a Product

If X and Y are independent random variables, then:

E(X·Y) = E(X)·E(Y)

However, if X and Y are not independent, this property may not hold.

Law of the Unconscious Statistician

If g is a function and X is a random variable, the expected value of g(X) can be calculated as:

E(g(X)) = Σg(xᵢ)·p(xᵢ) (discrete case)
E(g(X)) = ∫g(x)·f(x)dx (continuous case)

Applications of Expected Value

Decision Theory

Expected value is a key concept in decision theory, where it's used to evaluate different strategies or actions based on their potential outcomes and the associated probabilities.

Finance and Investment

In finance, expected value is used to calculate the expected return on investments, helping investors make informed decisions based on risk and potential reward.

Insurance

Insurance companies use expected value calculations to determine premium rates by estimating the expected payout for different types of insurance policies.

Game Theory

In game theory, expected value helps players determine optimal strategies by evaluating the potential outcomes of different actions.

Statistical Inference

Expected value is fundamental to many statistical methods and models, including hypothesis testing, regression analysis, and Bayesian inference.

Common Expected Values

Fair Coin Toss (0/1):

E(X) = 0.5

Fair Six-Sided Die:

E(X) = 3.5

Uniform Distribution [a,b]:

E(X) = (a+b)/2

Binomial (n,p):

E(X) = n·p

Poisson (λ):

E(X) = λ

Normal (μ,σ²):

E(X) = μ