# Jensen's inequality

## In words...

Jensen's inequality is an extension of the basic inequality defining a convex function.

Given some random variable, it states that the expectation of a convex function of this variable cannot be smaller than function applied to the expectation of the variable.

## In maths...

Given a random variable $X$ taking values in $\X$ and a convex function $\varphi : \X \rightarrow \R$, Jensen's inequality states that

$$\varphi(\E_X X ) \leq \E_X [\varphi(X)] .$$

### Finite form of the inequality

The inequality also holds in the finite form $$\varphi\left( \frac{1}{n} \sum_{i=1}^n \g x_i \right) \leq \frac{1}{n} \sum_{i=1}^n \varphi( \g x_i)$$ with $n$ vectors $\g x_i \in \X$.
For instance, with $\X = \R$, $\varphi(x) = x^2$ and $n=2$, this yields $$\frac{1}{4}(a+b)^2 \leq \frac{1}{2}(a^2 + b^2) \qquad \Rightarrow \quad \frac{1}{2}(a+b)^2 \leq a^2 + b^2$$