Hexa Scholar

Jensen’s inequality: average before or after?

Two wooden trays of gold pebbles sit beside a navy bowl on a cream tabletop.
Trays of pebbles and a bowl stand for grouping values before combining them.

The question

Two distributions both have mean 3. Do they also have the same average after each value is squared?

Choose a distribution, then compare the two orders of calculation.

  1. 1 SeeCompare two probability distributions.
  2. 2 TryTest a different curve and meet goals.
  3. 3 ProveBuild the weighted-average proof.
  4. 4 ApplyUse the inequality in five problems.
Before you start · 3 quick checks on probability weights, expectation, and linearity

Two ideas before you start

2 ideas

Carry the probabilities with the values

Probability bars at zero and eight. Choose the weight at eight.

Changing a probability changes how much its value contributes to the mean. A transformed value keeps the same probability.

Exact definition

For a finite random variable \(X\), let \(x_i\) be its possible values and \(p_i\) their probabilities. The weights are nonnegative and sum to one. Write \(\mu=E[X]=\sum_i p_i x_i\). Applying a function first gives \(E[f(X)]=\sum_i p_i f(x_i)\); averaging first gives \(f(E[X])=f(\mu)\). The parentheses record which operation happens first.

The expectation and variance lesson develops weighted means and second moments. Here those calculations become a way to compare nonlinear transformations.

A shape condition on an interval

Choose the square curve or the absolute-value curve.

Both curves are convex. Convexity allows a corner; it does not require a derivative everywhere.

Exact definition

A real-valued function \(f\) is convex on an interval \(I\) if, for all \(a,b\in I\) and \(0\le t\le1\),

\[\begin{aligned}f((1-t)a+tb)\\&\le(1-t)f(a)+tf(b).\end{aligned}\]

The graph lies on or below the straight chord joining any two of its points. The interval condition keeps the weighted input inside the domain. A function is strictly convex if the inequality is strict whenever the points differ and both weights are positive. A straight line is convex but not strictly convex. The square function is strictly convex on the real line.

Scope: probabilities, not sample estimates

The activities specify finite distributions exactly. No sampling error is involved. Repeated values may be combined by adding their probabilities, and outcomes of probability zero may be discarded. Independence is not needed for Jensen’s inequality about one random variable. It will be used only in one explicit construction of a spread below.

All function values must exist on the stated interval. A formula with a singularity cannot be used across it merely because the mean happens to lie in its domain.

1 See

Compare before calculating

2 Try

Change the function

The first activity used a square. Keep the order of operations explicit as you test another transformation.

3 Prove

Combine weighted groups

Jensen’s inequality, finite form

Let \(f\) be real-valued and convex on an interval \(I\). Let \(x_1,\ldots,x_n\in I\), with nonnegative weights \(p_i\) that sum to one. Then

\[f\!\left(\sum_i p_i x_i\right)\le\sum_i p_i f(x_i).\]

Equivalently, \(f(E[X])\le E[f(X)]\). Equality holds exactly when \(f\) is affine (agrees with a straight line) on the interval from the smallest to the largest value with positive probability; a constant \(X\) is the case where that interval is a single point. A strictly convex function is affine on no interval of positive length, so for strictly convex \(f\), equality holds exactly when all values with positive probability coincide. For a concave function, the inequality reverses, with the same equality condition. Finite support makes all expectations in this statement finite.

Build the proof by induction on the number of positive weights. Remove zero weights first. The single-weight case is equality. In the induction step, assume the result for a group of one fewer positive weights, and use \(n\ge2\) positive weights summing to one. The symbol \(p\) below denotes the last weight, and \(q\) denotes the total of all earlier weights.

4 Apply

Choose the transformation and its domain

Use what you found above. Identify the random input, the function applied to it, and whether the question asks for an expectation, a gap, or only a bound. Each problem has a hint and a worked solution.

Key point A mean can give a bound on an expected nonlinear output without determining that output. Keep the equality conditions and the function’s domain beside the calculation.
Level Introductory undergraduatePrerequisites Expectation and variance; convexity is defined hereTime About 30 min

Related application: the bond convexity lesson studies how a fixed-payment price bends as yield changes. Its financial convexity measure is a normalized second derivative; the mathematical shape condition used here applies to the full function on an interval.

Further reading