Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Expected Value






Understanding Expected Value


Expected value is the number that describes the long-run average outcome of a random variable.If you could repeat the same random experiment over and over, the expected value tells you what the results would settle around on average.

It works the same way for:

• discrete random variables (like dice, counts, or outcomes from models), and
• continuous random variables (like time, distance, or measurements),

even though the way we calculate it differs.

Expected value is one of the most important ideas in probability.It connects the outcome of a random experiment to the overall behavior of a distribution and
provides the foundation for variance, covariance, risk calculations, and many principles in probability and statistics.



The Intuition Behind Expected Value


The simplest way to think about expected value is as the long-run average of a random variable.
If you could run the same random experiment again and again, the results would fluctuate from trial
to trial, but the average of all outcomes would settle around a single number. That number is the
expected value.

For discrete random variables, this average is formed by giving more weight to outcomes that are more likely.
For continuous variables, the density curve shows where values tend to concentrate, and the expected
value reflects the balance point of that curve.

The value that occurs most often and the expected value are not necessarily the same.
In fact, the expected value might not match any specific outcome at all.
It is simply the number that reflects the overall behavior of the distribution — a kind of “center of gravity” for probability.

Notation We Use for Expected Value


When we talk about expected value, a few symbols appear again and again.
Here is what they mean in plain language, without the formal overload.

E(X)E(X) or 𝔼[X]𝔼[X] — the expected value of the random variable XX.
This is the most common way to write “the long-run average of XX.”

ΣΣ (the summation sign) — used in the discrete case.
It tells us we are adding together the contributions from all possible values of XX,
each weighted by its probability.

(the integral sign) — used in the continuous case.
It represents adding up contributions continuously along the density curve.

p(x)p(x) — the probability that XX takes the value x (for discrete variables).
This comes from the PMF.

f(x)f(x) — the probability density at x (for continuous variables).
It shows where values tend to concentrate.

E[g(X)]E[g(X)] — the expected value of some function of XX.
This appears when computing variance, powers of XX, or transformations.

All of these symbols simply help express the same idea:
expected value is a weighted average based on the probability function of the variable.

See All Probability Symbols and Notations


How to Calculate Expected Value


Expected value is always computed the same way: we take each possible value of the random variable, give it the weight it deserves based on its probability, and combine all those weighted contributions into a single average. The only difference between discrete and continuous variables is how we perform this combination.

Discrete Random Variables (using empirical/tabulated probabilities)-general case
When probabilities are obtained from data or observations rather than a formula, we still compute expected value as a weighted sum. Each observed value xix_i is multiplied by its corresponding probability P(X=xi)P(X = x_i), and these products are summed.

This gives the formula:
E[X]=ixiP(X=xi)E[X] = \sum_{i} x_i \cdot P(X = x_i)


or equivalently, using pip_i to denote the probability of outcome ii:

E[X]=ixipiE[X] = \sum_{i} x_i \cdot p_i


This is the same weighted average principle, but applied to a specific set of values and their empirically determined probabilities—such as those found in a probability table or derived from experimental data.

Discrete Random Variables (using a PMF)
For discrete variables, we use a weighted sum: multiply each value xx by its probability p(x)p(x), then add all these products together.

This gives the formula:
E(X)=Σxp(x)E(X) = Σ x · p(x)


It is simply a probability-weighted average of all possible outcomes.

Continuous Random Variables (using a PDF)
For continuous variables, we replace the weighted sum with a weighted integral: multiply each x by its density f(x)f(x), and integrate over all possible values.

This gives the formula:

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


Here, the density f(x)f(x) plays a role similar to p(x)p(x), except probabilities come from the area under the curve rather than point values.

In both cases, the underlying idea is identical: expected value is the average of all possible outcomes, each weighted by how likely it is.

Special Formulas for Common Distributions
Every well-known probability distribution—both discrete and continuous—comes with its own closed-form formula for expected value. These formulas are derived once from the summation or integral definitions and then reused to make calculations much faster. For example, the binomial distribution has E(X)=npE(X) = np, the geometric has E(X)=1/pE(X) = 1/p, and the exponential has E(X)=1/λE(X) = 1/λ. Using these established results saves time and avoids repeating long sums or integrals each time.


Calculating Expected Value: General Case


To calculate an expected value, we start with two ingredients:

* a random variable, which assigns numerical values to outcomes of an experiment,
* a probability function, which assigns a probability to each possible value of that variable.

In this example, the probability function is not given by a formula. Instead, it is obtained empirically: probabilities are estimated from observed frequencies of outcomes in repeated, similar situations. This is common in practice when a theoretical model is not assumed in advance.

Example


Suppose we define some discrete random variable (X) as the number of items sold in a small shop on a given morning. Based on past observations, the probabilities are summarized as follows:


x (value of X) 0 1 2 3
P(X = x) 0.1 0.3 0.4 0.2

Here:


* (XX) is the random variable,
* the row of probabilities defines its probability mass function, constructed from data rather than a closed-form expression.

The expected value is calculated by multiplying each value by its probability and summing:

E[X]=00.1+10.3+20.4+30.2=1.7E[X] = 0\cdot0.1 + 1\cdot0.3 + 2\cdot0.4 + 3\cdot0.2 = 1.7


Intuition :


This calculation can be read as a balance: values that occur more often pull the average toward themselves, while rare values have little influence. If this morning were repeated many times under similar conditions, the average number of items sold would stabilize near (1.7).

In case of continuous random variable, the same idea applies, but probabilities are replaced by a density and the sum becomes an integral. That case is handled separately later.

In both discrete and continuous settings, the underlying calculation principle is identical: values are weighted by how likely they are to occur. The distinction between the two cases lies only in the mathematical operation used to carry out this weighting—a sum for discrete variables and an integral for continuous ones—not in the idea of expected value itself.



Expected Value for Discrete Random Variables (PMF)


When a discrete random variable is described by a probability mass function given in formula form, the expected value is computed directly from that function rather than from listed probabilities. In this setting, each possible value of the random variable is weighted by the probability assigned to it by the PMF.

If a discrete random variable XX has probability mass function p(x)=P(X=x)p(x)=P(X=x), its expected value is defined by

E[X]=xp(x)E[X]=∑x⋅p(x)


The summation runs over all values in the support of XX. The PMF provides the weights, and the summation combines all weighted contributions into a single number.

This formulation is especially useful when probabilities follow a clear rule or pattern, allowing the expected value to be computed algebraically rather than by listing outcomes individually. In later sections, this definition will be applied to specific distributions, where substituting the corresponding PMF into the sum leads to closed-form results.


Expected Value for Discrete Random Variables (PMF) — Formula-Based Example

Let a discrete random variable XX take the values 1,2,3,41, 2, 3, 4, and suppose its probability mass function is defined by the formula

p(x)=P(X=x)=x10,x=1,2,3,4.p(x) = P(X = x) = \frac{x}{10}, \quad x = 1, 2, 3, 4.


(Indeed, 1+2+3+410=1\frac{1+2+3+4}{10} = 1, so this is a valid PMF.)

Using the definition of expected value for a discrete random variable,

E[X]=xxp(x),E[X] = \sum_{x} x \cdot p(x),


we substitute the PMF formula directly:

E[X]=x=14xx10=110x=14x2.E[X] = \sum_{x=1}^{4} x \cdot \frac{x}{10} = \frac{1}{10} \sum_{x=1}^{4} x^2.


Now compute the sum:

E[X]=110(12+22+32+42)=110(1+4+9+16)=3010=3.E[X] = \frac{1}{10}(1^2 + 2^2 + 3^2 + 4^2) = \frac{1}{10}(1 + 4 + 9 + 16) = \frac{30}{10} = 3.


This example shows how expected value can be calculated directly from a probability function formula, without listing probabilities individually. The structure of the PMF determines the calculation.


Continuous Random Variables (using a PDF)


When a continuous random variable is described by a probability density function given in formula form, the expected value is computed directly from that function using integration. In this setting, each possible value of the random variable is weighted by the density assigned to it by the PDF.

If a continuous random variable XX has probability density function f(x)f(x), its expected value is defined by

E[X]=xf(x)dxE[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx


The integral runs over all values in the support of XX. The PDF provides the weights, and the integration combines all weighted contributions into a single number.

This formulation is especially useful when densities follow a clear rule or pattern, allowing the expected value to be computed algebraically rather than by approximating with discrete intervals. In later sections, this definition will be applied to specific distributions, where substituting the corresponding PDF into the integral leads to closed-form results.

Expected Value for Continuous Random Variables (PDF) — Formula-Based Example

Let a continuous random variable XX be defined on the interval [0,2][0, 2], and suppose its probability density function is defined by the formula

f(x)=x2,0x2.f(x) = \frac{x}{2}, \quad 0 \leq x \leq 2.


(Indeed, 02x2dx=12x2202=44=1\int_{0}^{2} \frac{x}{2} \, dx = \frac{1}{2} \cdot \frac{x^2}{2} \bigg|_{0}^{2} = \frac{4}{4} = 1, so this is a valid PDF.)

Using the definition of expected value for a continuous random variable,

E[X]=xf(x)dx,E[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx,


we substitute the PDF formula directly:

E[X]=02xx2dx=1202x2dx.E[X] = \int_{0}^{2} x \cdot \frac{x}{2} \, dx = \frac{1}{2} \int_{0}^{2} x^2 \, dx.


Now compute the integral:

E[X]=12x3302=1283=431.33.E[X] = \frac{1}{2} \cdot \frac{x^3}{3} \bigg|_{0}^{2} = \frac{1}{2} \cdot \frac{8}{3} = \frac{4}{3} \approx 1.33.


This example shows how expected value can be calculated directly from a probability density function formula, without approximating with discrete intervals. The structure of the PDF determines the calculation.


Expected Value Formulas for Specific Distributions


Unlike the general case where probabilities are empirical or tabulated, or cases where we work directly from a PMF or PDF formula, specific probability distributions have pre-derived expected value formulas that bypass the need for summation or integration.

Each standard probability distribution has a derived formula for its expected value. These formulas come from applying the general definitions—summation for discrete cases, integration for continuous ones—to the specific probability functions that define each distribution.

Once derived, these formulas become standard results that can be used directly without repeating the original calculations. For instance:


Expected Value Formulas for Discrete Distributions

DistributionFormulaParameters
Discrete UniformE[X]=a+b2E[X]=\frac{a + b}{2}aa = minimum value, bb = maximum value
BinomialE[X]=npE[X] = npnn = number of trials, pp = probability of success
GeometricE[X]=1pE[X] = \frac{1}{p}pp = probability of success on each trial
Negative BinomialE[X]=rpE[X] = \frac{r}{p}rr = number of successes needed, pp = probability of success
HypergeometricE[X]=nKNE[X] = n\frac{K}{N}nn = sample size, KK = successes in population, NN = population size
PoissonE[X]=λE[X] = \lambdaλ\lambda = average rate of occurrence per interval

Expected Value Formulas for Continuous Distributions

DistributionFormulaParameters
Continuous UniformE[X]=a+b2E[X] = \frac{a + b}{2}aa = lower bound of interval, bb = upper bound of interval
ExponentialE[X]=1λE[X] = \frac{1}{\lambda}λ\lambda = rate parameter (events per unit time)
NormalE[X]=μE[X] = \muμ\mu = mean (location parameter), σ2\sigma^2 = variance

The normal distribution is typically presented with its mean μμ already given as a parameter, so E(X)=μE(X) = μ by definition.

Using these established formulas makes calculations immediate. Instead of setting up integrals or sums from scratch, you simply identify the distribution type and its parameters, then apply the corresponding formula. This approach is both faster and less error-prone, especially when working with well-known distributions in applied problems.

Properties of Expected Value


Expected value follows a small set of structural rules that make it one of the most useful ideas in probability. These properties describe how expectation behaves when random variables are combined or transformed, and they allow many calculations to be broken into simpler parts.

Linearity of Expectation (Expected Value of a Sum)
The most important property is linearity: E(X+Y)=E(X)+E(Y)E(X + Y) = E(X) + E(Y). This works for any random variables, even if they are dependent. The idea extends to any number of variables: E(X1+X2+...+Xn)=E(X1)+E(X2)+...+E(Xn)E(X1 + X2 + ... + Xn) = E(X1) + E(X2) + ... + E(Xn). Linearity is what allows us to compute the average of a complicated expression by breaking it into smaller pieces whose expectations are known.

Scaling and Shifting
If we multiply a random variable by a constant or shift it by adding a constant, the expected value behaves in a predictable way:
E(aX+b)=aE(X)+bE(aX + b) = aE(X) + b.
This shows how expectation responds to changes of units, rescaling, or adding fixed adjustments.

Expectation of a Product (Independence Case)
For independent variables, expectation interacts cleanly with multiplication: E(XY)=E(X)E(Y)E(XY) = E(X)E(Y). This is not true in general when X and Y are dependent, but it is an important special case that appears often in probability and statistics.

When Expected Value Exists
Expected value is not guaranteed to be finite for every distribution. Some distributions, such as the Cauchy distribution, have no defined expected value because the integral diverges. This reminds us that expectation is a mathematical quantity that depends on the shape and behavior of the probability function.

These properties make expectation a powerful tool: they let us simplify expressions, evaluate combinations of random variables, and understand how averages behave under transformations.

Expected Value of a Function


Sometimes we are not interested in the expected value of XX itself, but in the expected value of some function of XX. This happens in many situations: when computing variance, when working with powers of XX, when modeling profits or losses, or any time we transform the random variable into something new. The idea is exactly the same as before: we weight the values of g(X)g(X) by the probability function of XX.

Discrete Case
For discrete variables, we take all possible values of XX, apply the function gg to each one, multiply by the probability p(x)p(x), and add the results. The formula is E[g(X)]=Σg(x)p(x)E[g(X)] = Σ g(x) · p(x). This gives the long-run average of the transformed quantity g(X)g(X).

Continuous Case
For continuous variables, we do the same but with an integral instead of a sum. We multiply g(x)g(x) by the density f(x)f(x) and integrate across all possible values. The formula is E[g(X)]=g(x)f(x)dxE[g(X)] = ∫ g(x) f(x) dx. The density determines how much each transformed value contributes to the final average.

Expected value of a function is a fundamental idea because it appears everywhere: in variance, in risk analysis, in moments of distributions, and in many applied calculations where the quantity of interest is built from XX rather than XX itself.

Expected Value of a Sum


A key fact about expected value is that it adds up cleanly when random variables are added. If we combine two random variables by adding them, the expected value of the total is simply the sum of their individual expected values. In symbols, E(X+Y)=E(X)+E(Y)E(X + Y) = E(X) + E(Y). This rule works whether the variables are independent or dependent, which makes it unusually powerful.

The same idea extends to any number of variables: E(X1+X2+...+Xn)=E(X1)+E(X2)+...+E(Xn)E(X1 + X2 + ... + Xn) = E(X1) + E(X2) + ... + E(Xn). This property allows complicated expressions to be handled piece by piece, turning difficult problems into simple ones whose individual expectations are easy to compute. Because of this, linearity of expectation is one of the most widely used tools in probability.

Examples of Expected Value


These short examples show how expected value works for different types of random variables. They are not full derivations, just quick illustrations of the idea.

Fair Die
A fair six-sided die has outcomes 1 through 6, all equally likely. The expected value is the average of these values with equal weights, which gives E(X)=3.5E(X) = 3.5. This number does not need to be one of the outcomes.

Bernoulli (p)(p)
A Bernoulli variable takes the value 11 with probability pp and 00 with probability 1p1 − p. The expected value is E(X)=pE(X) = p, reflecting the long-run proportion of successes.

Exponential (λ)(λ)
An exponential distribution with rate λ has expected value E(X)=1/λE(X) = 1/λ. This gives the average waiting time between events in many real-world models.

Simple Profit Model
If a game pays +10 with probability 0.2 and −4 with probability 0.8, the expected profit is E(X) = 10·0.2 + (−4)·0.8 = −1.2. This tells you the average change in wealth per play over the long run.

These examples highlight how expected value captures the broad tendency of a random variable, whether the situation is discrete, continuous, or based on a practical scenario.