Jensen's Inequality

For a real convex function f, with x_1, x_2, ..., x_n in its domain, and positive weights a_i, Jensen's inequality can be stated as: f \left({\frac {\sum a_{i}x_{i}}{\sum a_{i}}}\right)\leq {\frac {\sum a_{i} f (x_{i})}{\sum a_{i}}}Or, if in terms of positive weights p_i summing to one (so that they can be interpreted as probabilities):f \left(\sum p_i x_i \right)\leq \sum p_{i} f (x_{i})And if the function f is instead concave, the inequality is reversed: f \left({\frac {\sum a_{i}x_{i}}{\sum a_{i}}}\right) \geq {\frac {\sum a_{i} f (x_{i})}{\sum a_{i}}}Or if in terms of positive weights p_i summing to one (so that they can be interpreted as probabilities):f \left(\sum p_i x_i \right) \geq \sum p_{i} f (x_{i})Alternatively, in expectations notation if f is convex, f(E[X]) \leq E[f(X)], or concave f(E[X]) \geq E[f(X)].