01 / 21

Jensen's
Inequality

Understand how convexity governs the relationship between the expectation of a function and the function of an expectation: a cornerstone of probability, optimization, and information theory.

Statistics Probability Theory

What Is a Convex Function?

A function \(\varphi\) is convex on an interval if, for every pair of points \(x_1, x_2\) and every \(\lambda \in [0,1]\):

$$\varphi\bigl(\lambda x_1 + (1-\lambda) x_2\bigr) \;\leq\; \lambda\,\varphi(x_1) + (1-\lambda)\,\varphi(x_2)$$

The Chord Above the Curve

x φ x₁ x₂ Gap φ(λx₁+(1-λ)x₂) λφ(x₁)+(1-λ)φ(x₂)

Concave Functions: The Mirror

A function \(\varphi\) is concave if \(-\varphi\) is convex. Equivalently, \(\varphi''(x) \leq 0\), and the chord lies below the curve. Jensen's inequality reverses for concave functions:

$$\varphi\bigl(E[X]\bigr) \;\geq\; E\bigl[\varphi(X)\bigr] \quad \text{(concave } \varphi\text{)}$$
Convex examples
\(x^2\), \(e^x\), \(|x|\), \(x\ln x\) for \(x > 0\)
Concave examples
\(\ln x\), \(\sqrt{x}\), \(-x^2\), \(\sin x\) on \([0,\pi]\)

The Formal Statement

Let \(X\) be a random variable with \(E[|X|] < \infty\), and let \(\varphi\) be a convex function such that \(E[|\varphi(X)|] < \infty\). Then:

$$\boxed{\;\varphi\bigl(E[X]\bigr) \;\leq\; E\bigl[\varphi(X)\bigr]\;}$$

Proof Sketch: Supporting Line

φ(E[X]) E[X] supporting line ℓ(x)
1
At the point \(\mu = E[X]\), draw a supporting line (tangent) \(\ell(x) = \varphi(\mu) + \varphi'(\mu)(x - \mu)\).
2
By convexity, \(\varphi(x) \geq \ell(x)\) for all \(x\). Therefore \(\varphi(X) \geq \ell(X)\) a.s.
3
Taking expectations: \(E[\varphi(X)] \geq E[\ell(X)] = \varphi(\mu)\). Done.

The Finite (Discrete) Form

For weights \(\lambda_1, \ldots, \lambda_n \geq 0\) with \(\sum \lambda_i = 1\) and a convex \(\varphi\):

$$\varphi\!\left(\sum_{i=1}^{n} \lambda_i x_i\right) \;\leq\; \sum_{i=1}^{n} \lambda_i\,\varphi(x_i)$$

Convex vs Concave: Direction Matters

Convex \(\varphi\) Concave \(\varphi\)
Second derivative \(\varphi'' \geq 0\) \(\varphi'' \leq 0\)
Chord vs curve Chord above Chord below
Jensen's direction \(\varphi(E[X]) \leq E[\varphi(X)]\) \(\varphi(E[X]) \geq E[\varphi(X)]\)
Typical examples \(x^2,\; e^x,\; -\ln x\) \(\ln x,\; \sqrt{x}\)
Equality condition \(X\) is constant a.s. or \(\varphi\) is affine on \(\mathrm{supp}(X)\)

Why Jensen's Inequality Matters

Probability
Proves \(\mathrm{Var}(X) \geq 0\) from \(E[X^2] \geq (E[X])^2\)
Information Theory
Underpins the non-negativity of KL divergence and mutual information
Optimization
Foundation of the EM algorithm's lower-bound construction (ELBO)

How to Apply Jensen's Inequality

1
Identify the random variable \(X\) and the function \(\varphi\) you want to move through the expectation.
2
Check convexity or concavity: compute \(\varphi''(x)\) and verify its sign on the support of \(X\).
3
Write the inequality: convex \(\Rightarrow\) \(\varphi(E[X]) \leq E[\varphi(X)]\); concave \(\Rightarrow\) reverse.
4
Check the equality condition: does equality hold? If \(\varphi\) is strictly convex and \(X\) is not constant, the inequality is strict.

Example 1: \(E[X^2] \geq (E[X])^2\)

Let \(\varphi(x) = x^2\). Since \(\varphi''(x) = 2 > 0\), the function is convex. Applying Jensen's inequality directly:

$$(E[X])^2 = \varphi(E[X]) \;\leq\; E[\varphi(X)] = E[X^2]$$

Example 2: AM-GM Inequality

Let \(\varphi(x) = -\ln x\), which is convex for \(x > 0\) (since \(\varphi''(x) = 1/x^2 > 0\)). Let \(X\) take values \(a_1, \ldots, a_n > 0\) each with probability \(1/n\).

$$-\ln\!\left(\frac{1}{n}\sum a_i\right) \;\leq\; \frac{1}{n}\sum(-\ln a_i)$$

Example 3: KL Divergence \(\geq 0\)

Let \(P\) and \(Q\) be distributions on the same space. Define \(\varphi(t) = -\ln t\) (convex). Let \(X = Q(x)/P(x)\) under \(P\):

$$D_{KL}(P\|Q) = E_P\!\left[-\ln\frac{Q(X)}{P(X)}\right] = E_P\!\left[\varphi\!\left(\frac{Q(X)}{P(X)}\right)\right]$$
1
By Jensen: \(E_P[\varphi(Q/P)] \geq \varphi(E_P[Q/P])\).
2
\(E_P[Q(X)/P(X)] = \sum P(x) \cdot Q(x)/P(x) = \sum Q(x) = 1\).
3
\(\varphi(1) = -\ln 1 = 0\). Therefore \(D_{KL}(P\|Q) \geq 0\). ✓

Example 4: Power Mean Inequality

For \(1 \leq p < q\), we can show \(M_p \leq M_q\) where \(M_r = \left(\frac{1}{n}\sum a_i^r\right)^{1/r}\). The key step uses Jensen with \(\varphi(x) = x^{q/p}\), which is convex for \(q/p \geq 1\):

$$\left(\frac{1}{n}\sum a_i^p\right)^{q/p} \;\leq\; \frac{1}{n}\sum \left(a_i^p\right)^{q/p} = \frac{1}{n}\sum a_i^q$$

Common Mistakes

✕ Wrong direction
Writing \(\varphi(E[X]) \geq E[\varphi(X)]\) for a convex function. The inequality goes the other way: convex means \(\leq\).
✕ Ignoring the domain
Applying Jensen with \(\varphi(x) = \ln x\) and calling it convex. On \((0,\infty)\), \(\ln x\) is concave: \(\varphi''(x) = -1/x^2 < 0\).
✕ Non-convex functions
Using Jensen on \(\varphi(x) = \sin x\) over all of \(\mathbb{R}\). The function must be convex (or concave) on the entire support of \(X\).

Summary of Key Applications

Application \(\varphi(x)\) Result
\(\mathrm{Var}(X) \geq 0\) \(x^2\) (convex) \(E[X^2] \geq (E[X])^2\)
AM-GM \(-\ln x\) (convex) \(\text{AM} \geq \text{GM}\)
\(D_{KL} \geq 0\) \(-\ln x\) (convex) Gibbs' inequality
Power means \(x^{q/p}\) (convex) \(M_p \leq M_q\)
EM algorithm \(\ln x\) (concave) \(\text{ELBO} \leq \log\text{-likelihood}\)

Question 1 of 5

If \(\varphi\) is a convex function and \(X\) is a non-constant random variable, which statement is true?

Question 2 of 5

Let \(X > 0\) be a non-constant random variable. By Jensen's inequality applied to \(\varphi(x) = \ln x\), which holds?

Question 3 of 5

Which classical inequality is a direct consequence of Jensen's inequality with \(\varphi(x) = -\ln x\)?

Question 4 of 5

Equality holds in Jensen's inequality (\(\varphi(E[X]) = E[\varphi(X)]\)) if and only if:

Question 5 of 5

In the EM algorithm, Jensen's inequality is applied to \(\varphi(x) = \ln x\) to construct a lower bound (ELBO). Why is the inequality in the correct direction for maximization?