Why Equality Needs More Than Convexity
Jensen's inequality compares \(\phi(E[X])\) with \(E[\phi(X)]\) when \(\phi\) is convex. Convexity guarantees the direction of the comparison, but it does not by itself say whether the inequality is strict. The equality case depends on two things: how curved \(\phi\) is near the mean and where the distribution of \(X\) places its probability.
Strict convexity gives a particularly sharp answer: equality is possible only when \(X\) is constant with probability one. For a convex function that is not strictly convex, equality can also occur for a nonconstant random variable, provided its distribution is confined to a region on which the function is affine. This distinction applies to distributions with either atoms or continuous support.
Setup and Equality Criterion
A finite convex function on an open interval has at least one subgradient at each point of that interval. Geometrically, the line with slope \(s\) through \((\mu,\phi(\mu))\) lies below the graph of \(\phi\). Jensen's inequality follows by taking expectations of this pointwise bound. The equality criterion below identifies exactly when that expectation adds no positive gap.
Proof of the Equality Criterion
For the chosen subgradient, define the gap between the function and its supporting line by \(G(x)=\phi(x)-\phi(\mu)-s(x-\mu)\). By the definition of a subgradient, \(G(x)\geq 0\) for every \(x\in I\). The integrability assumptions make \(G(X)\) integrable, so its expectation is well-defined. Linearity of expectation and \(E[X]=\mu\) give
Thus Jensen's difference is the expectation of a nonnegative random variable. If \(E[\phi(X)]=\phi(E[X])\), then \(E[G(X)]=0\). A nonnegative random variable with expectation zero equals zero with probability one: indeed, if \(P(G(X)>0)>0\), then for some positive integer \(k\), \(P(G(X)\geq 1/k)>0\), which would imply \(E[G(X)]\geq P(G(X)\geq 1/k)/k>0\), a contradiction. Hence \(G(X)=0\) almost surely, which means \(P(X\in C_s)=1\).
Conversely, if \(P(X\in C_s)=1\), then \(G(X)=0\) almost surely and therefore \(E[G(X)]=0\). The displayed identity gives \(E[\phi(X)]=\phi(E[X])\). The argument applies to every subgradient selected at \(\mu\), proving the final claim as well. \(\square\)
How the Contact Set Relates to Support
The contact set is not just an arbitrary collection of points. For a convex function, it is an interval, possibly a single point or an unbounded interval. To see this, suppose \(x<z\) are both in \(C_s\), and take any \(y\) between them. The function is convex, so
But the subgradient inequality gives \(\phi(y)\geq\phi(\mu)+s(y-\mu)\). The two inequalities force equality, so \(y\in C_s\). In particular, \(\phi\) is affine on the entire interval between any two contact points. Equality in Jensen therefore requires the distribution to lie in an affine portion of the graph that includes the mean.
More precisely, the theorem says \(P(X\in C_s)=1\). Since \(C_s\) is closed relative to \(I\), this is equivalent to saying that the relative support of the distribution in \(I\) is contained in \(C_s\). If the distribution places positive probability outside the contact set, equality fails, even if most of its mass lies in a region that looks nearly linear.
Worked Example: Strict Convexity and a Two-Point Distribution
Let \(X\) equal \(0\) with probability \(3/4\) and \(2\) with probability \(1/4\), and let \(\phi(x)=x^2\). Compare the two sides of Jensen's inequality.
First calculate the mean: \(E[X]=(3/4)(0)+(1/4)(2)=1/2\). Therefore, \(\phi(E[X])=(1/2)^2=1/4\).
Next calculate the expectation of the transformed variable: \(E[\phi(X)]=(3/4)(0^2)+(1/4)(2^2)=1\). Thus the Jensen gap is \(1-1/4=3/4>0\).
The function \(x^2\) is strictly convex on \(\mathbb{R}\), and \(X\) takes two distinct values with positive probability. The strict inequality is consistent with the equality criterion: a supporting line at the mean cannot contact this strictly convex graph at both \(0\) and \(2\).
Worked Example: A Continuous Distribution on an Affine Region
Let \(X\) have the uniform distribution on \([1,3]\), and let \(\phi(x)=\max(0,x)\). The function is convex but is affine with slope \(1\) for \(x\geq 0\). Determine whether Jensen's inequality is an equality.
For a uniform distribution on \([1,3]\), \(E[X]=(1+3)/2=2\), so \(\phi(E[X])=\phi(2)=2\). Since every value of \(X\) is positive, \(\phi(X)=X\) with probability one. Consequently, \(E[\phi(X)]=E[X]=2\), and equality holds.
For a support-based check, take the supporting line \(x\mapsto x\) at \(\mu=2\). The contact set is \([0,\infty)\), which contains the entire support \([1,3]\). The distribution is not concentrated at one point, but the function is affine throughout the region occupied by the distribution.
Worked Example: Atoms on One Linear Piece
Let \(\phi(x)=\max(0,x)\), and suppose \(P(X=-2)=0.3\) and \(P(X=-1)=0.7\). Both atoms lie on the part of the graph where \(\phi(x)=0\). Check the equality directly.
The mean is \(E[X]=(0.3)(-2)+(0.7)(-1)=-0.6-0.7=-1.3\). Hence \(\phi(E[X])=\phi(-1.3)=0\).
At either possible value of \(X\), \(\phi(X)=0\). Thus \(E[\phi(X)]=(0.3)(0)+(0.7)(0)=0\), and \(E[\phi(X)]=\phi(E[X])\).
At the negative mean, the horizontal line \(y=0\) supports \(\phi\); its contact set is \((-\infty,0]\). Both atoms lie in that set, so the criterion predicts equality despite the fact that \(X\) is nonconstant.
Worked Example: Atoms on Opposite Sides of a Bend
Keep \(\phi(x)=\max(0,x)\), but now let \(P(X=-1)=P(X=1)=1/2\). The atoms lie on different affine pieces, with the bend at zero. Calculate both sides.
The mean is \(E[X]=(1/2)(-1)+(1/2)(1)=0\), so \(\phi(E[X])=\phi(0)=0\). On the other hand, \(\phi(-1)=0\) and \(\phi(1)=1\), giving \(E[\phi(X)]=(1/2)(0)+(1/2)(1)=1/2\). Jensen's inequality is strict.
For example, slope \(s=1/2\) is a subgradient at zero. Its supporting line is \(y=x/2\). At \(x=-1\), the gap from the line to the graph is \(0-(-1/2)=1/2\); at \(x=1\), the gap is \(1-1/2=1/2\). The gap is positive at both atoms, so equality is impossible.
Strict Convexity: The Special Case
To justify the corollary, choose a subgradient at \(\mu\). If its contact set contained a point \(x\ne\mu\), then \(\phi\) would agree with the supporting line at both \(x\) and \(\mu\). Convexity and the supporting-line bound would force it to agree with that line at every point between them, contradicting strict convexity. Thus the contact set is just \(\{\mu\}\), and the theorem makes equality equivalent to \(P(X=\mu)=1\). Conversely, if \(X=\mu\) almost surely, then both sides equal \(\phi(\mu)\).
Common Mistake and Practical Check
A common mistake is to claim that equality in Jensen's inequality always requires \(X\) to be constant. That reasoning silently assumes strict convexity. The two nonconstant examples above show why the claim is false for a general convex function: if the distribution stays within a region where \(\phi\) is affine, its expectation can pass through the function without creating a gap.
A reliable check is to identify the mean, find a supporting line there, and ask whether the distribution is concentrated entirely on its contact set. If the function is strictly convex, this reduces to checking whether the distribution is degenerate. If it is merely convex, inspect its affine regions and compare them with the support. A distribution that crosses a bend will generally produce a strict inequality, as the final example illustrates.
Check Your Understanding
Use the contact-set criterion and show enough calculation to justify each answer.
- For a strictly convex \(\phi\), can a random variable taking two distinct values with positive probability give equality in Jensen's inequality? Explain.
- Let \(\phi(x)=\max(0,x)\). If \(X\) is supported on \([-4,-1]\), what are \(E[\phi(X)]\) and \(\phi(E[X])\)? Why must they agree?
- For \(\phi(x)=x^2\) and \(P(X=-1)=P(X=1)=1/2\), calculate the Jensen gap and describe the contact set at the mean.
- In the equality theorem, why is it important that the gap between \(\phi(X)\) and its supporting line is integrable?
- Explain why a nonconstant distribution can give equality when the convex function has an affine region containing its support.