From Weights to Jensen’s Inequality
A finite weighted-average problem asks us to compare a function of an average with an average of function values. The key is to keep those two calculations distinct: first average the inputs and then apply the function; separately apply the function to each input and average the results. Jensen’s inequality gives their order when the function is convex, but only when the weights are valid averaging weights.
We formulate the calculation on a finite probability space. Let \(X=\{1,\ldots,n\}\), let \(\mathcal{M}\) be the power set of \(X\), and let \(\mu\) be the probability measure defined by \(\mu(\{i\})=\lambda_i\), where \(\lambda_i\ge 0\) and \(\sum_{i=1}^n\lambda_i=1\). Thus \(\mu\) is finite, with total mass one. Define the real-valued measurable function \(f(i)=x_i\). Its integral is the weighted average \(\int_X f\,d\mu=\sum_i\lambda_i x_i\). All function equalities here hold everywhere on this finite space.
This is the finite-space form of Jensen’s inequality: the left side is \(\phi\) of the integral of \(f\), while the right side is the integral of \(\phi\circ f\). In calculations, it is useful to write the two sides explicitly before comparing them. Convexity determines the direction: a concave function reverses the inequality, and a function with no established convexity gives no Jensen comparison.
Why the Finite Inequality Holds
For clarity, the finite inequality follows from the definition of convexity. A function \(\phi\) on an interval is convex if, for \(u,v\in I\) and \(t\in[0,1]\), \(\phi(tu+(1-t)v)\le t\phi(u)+(1-t)\phi(v)\). The two-point case of the weighted inequality is exactly this definition.
Proof. We prove the finite statement by induction on the number of inputs. For \(n=1\), the weight condition forces \(\lambda_1=1\), and both sides are \(\phi(x_1)\). Now suppose the result holds for \(n-1\) inputs. If \(\lambda_n=1\), all the other nonnegative weights are zero, so both sides equal \(\phi(x_n)\). Otherwise put \(s=\sum_{i=1}^{n-1}\lambda_i=1-\lambda_n>0\), and set \(y=\sum_{i=1}^{n-1}(\lambda_i/s)x_i\). The coefficients \(\lambda_i/s\) are nonnegative and sum to one. Because \(I\) is an interval, \(y\in I\). The induction hypothesis gives \(\phi(y)\le\sum_{i=1}^{n-1}(\lambda_i/s)\phi(x_i)\). By convexity, $$ \phi\!\left(\sum_{i=1}^n\lambda_i x_i\right) =\phi(sy+\lambda_n x_n) \le s\phi(y)+\lambda_n\phi(x_n) \le\sum_{i=1}^n\lambda_i\phi(x_i). $$ This proves the assertion for \(n\), including zero weights among the first \(n-1\), and completes the induction. \(\square\)
When given raw weights \(w_i\ge0\), first calculate their total \(W=\sum_iw_i\). If \(W>0\), then \(\lambda_i=w_i/W\) are probability weights, and Jensen reads $$ \phi\!\left(\frac{\sum_iw_ix_i}{W}\right)\le\frac{\sum_iw_i\phi(x_i)}{W}. $$ Equivalently, multiplying both sides by \(W\) gives \(W\phi((\sum_iw_ix_i)/W)\le\sum_iw_i\phi(x_i)\). If \(W=0\), all the nonnegative raw weights are zero; there is no weighted average to normalize, and this formula does not apply.
Worked Example: A Quadratic with Three Normalized Weights
Take weights \(\lambda_1=\tfrac16,\lambda_2=\tfrac13,\lambda_3=\tfrac12\), inputs \(x_1=0,x_2=3,x_3=6\), and \(\phi(x)=x^2\) on \(I=\mathbb{R}\). The weights are nonnegative, and \(\tfrac16+\tfrac13+\tfrac12=\tfrac16+\tfrac26+\tfrac36=1\). The function is convex since \(\phi''(x)=2>0\) for every real \(x\).
First calculate the weighted input: $$ \sum_{i=1}^3\lambda_ix_i=\frac16(0)+\frac13(3)+\frac12(6)=0+1+3=4. $$ Applying \(\phi\) gives the left side, \(4^2=16\). The right side is $$ \sum_{i=1}^3\lambda_i\phi(x_i) =\frac16(0^2)+\frac13(3^2)+\frac12(6^2) =0+3+18=21. $$ Thus Jensen’s inequality is \(16\le21\).
Check: The difference between the two sides is \(21-16=5\). Directly, the weighted squared deviations from the mean \(4\) are \(\tfrac16(0-4)^2+\tfrac13(3-4)^2+\tfrac12(6-4)^2=\tfrac{16}{6}+\tfrac13+2=\tfrac83+\tfrac13+2=5\), agreeing with the difference.
Selecting the Convex Function
The function should be chosen to match the expression being compared. For example, squares are useful when a problem compares the square of a weighted average with an average of squares. Exponentials fit comparisons involving exponential values. On a positive interval, \(x\mapsto 1/x\) is convex because its second derivative is \(2/x^3>0\). Before calculating, state the domain on which the function is convex; a formula may fail to be defined or convex outside that domain.
Worked Example: An Exponential Comparison
Use weights \(\lambda_1=\tfrac14,\lambda_2=\tfrac34\), inputs \(x_1=0,x_2=\ln4\), and \(\phi(x)=e^x\) on \(\mathbb{R}\). The weights are nonnegative and \(\tfrac14+\tfrac34=1\). Also \(\phi''(x)=e^x>0\), so \(\phi\) is convex on the stated interval.
The weighted input is \(\tfrac14(0)+\tfrac34\ln4=\tfrac34\ln4\). Therefore the left side is $$ e^{(3/4)\ln4}=4^{3/4}. $$ The right side is \(\tfrac14e^0+\tfrac34e^{\ln4}=\tfrac14+\tfrac34(4)=\tfrac{13}{4}\). Jensen gives \(4^{3/4}\le\tfrac{13}{4}\). To check the comparison exactly, both sides are positive, so raising them to the fourth power preserves their order. The fourth powers are \(4^3=64\) and \((13/4)^4=28561/256\); since \(64=16384/256\le28561/256\), the inequality holds.
Check: The substitutions \(e^0=1\) and \(e^{\ln4}=4\) give the right-side value \(\tfrac14+\tfrac34\cdot4=\tfrac{13}{4}\), as calculated. No approximation of the exponential is needed.
Worked Example: Reciprocal Values on a Positive Interval
Take weights \(\lambda_1=\tfrac13,\lambda_2=\tfrac23\), inputs \(x_1=1,x_2=4\), and \(\phi(x)=1/x\) on \(I=(0,\infty)\). The inputs are positive, the weights are nonnegative and sum to one, and \(\phi''(x)=2/x^3>0\) throughout \(I\).
The weighted input is \(\tfrac13(1)+\tfrac23(4)=\tfrac13+\tfrac83=3\). Hence the left side is \(\phi(3)=\tfrac13\). The right side is $$ \frac13\phi(1)+\frac23\phi(4) =\frac13(1)+\frac23\left(\frac14\right) =\frac13+\frac16=\frac12. $$ Thus \(\tfrac13\le\tfrac12\). Both sides are exact, and their difference is \(\tfrac12-\tfrac13=\tfrac16>0\).
Check: Substituting the original inputs into the reciprocal first gives \(1\) and \(\tfrac14\); their weighted average is \(\tfrac13+\tfrac16=\tfrac12\). Taking the reciprocal after averaging the inputs instead gives \(1/3\), confirming that the two sides have not been confused.
Unnormalized Weights: A Common Pitfall
Weights that are nonnegative are not automatically averaging weights: their sum must also be one. Consider raw weights \(w_1=1,w_2=2\), inputs \(x_1=0,x_2=3\), and \(\phi(x)=x^2\). The raw weighted input is \(1\cdot0+2\cdot3=6\), not \(1\). A mistaken calculation might write \(1^2\le1(0^2)+2(3^2)\), or \(1\le18\), and claim this is Jensen’s inequality. That left side does not use the raw weighted input. The invalid raw calculation using that input would be \(6^2\le18\), namely \(36\le18\), which is false. The error is using weights whose sum is \(3\) as though they summed to one.
Normalize the weights: \(\lambda_1=1/3\) and \(\lambda_2=2/3\). The weighted input is \(\tfrac13(0)+\tfrac23(3)=2\), so applying the square gives \(2^2=4\). The weighted function values give \(\tfrac13(0^2)+\tfrac23(3^2)=0+6=6\). The valid comparison is \(4\le6\). Equivalently, in the raw-weight form, \(W=3\), so \(W\phi(6/3)=3\cdot4=12\le18=1\cdot0^2+2\cdot3^2\).
Several checks prevent this type of mistake:
- Verify \(\lambda_i\ge0\) and \(\sum_i\lambda_i=1\), or explicitly normalize the raw weights.
- Calculate \(\sum_i\lambda_ix_i\) before applying \(\phi\).
- Calculate \(\sum_i\lambda_i\phi(x_i)\) separately.
- Check that all inputs and their weighted average lie in the domain where \(\phi\) is convex.
- Keep the inequality direction consistent with convexity; concavity reverses it.
Finite weighted Jensen calculations are useful whenever a discrete average is passed through a nonlinear function. The method does not require guessing an equality case or estimating numerically: once the weights, domain, and convex function are verified, the finite inequality applies. In a numerical problem, exact arithmetic such as fractions and powers can then confirm that each side has been formed correctly.
Check Your Understanding
For each question, state the weight and domain checks before applying Jensen, and calculate both sides explicitly.
- For weights \(\tfrac14,\tfrac34\), inputs \(2,6\), and \(\phi(x)=x^2\), compute and compare both sides.
- Normalize raw weights \(2,3\) for inputs \(1,5\). With \(\phi(x)=x^2\), calculate the normalized Jensen inequality.
- For weights \(\tfrac12,\tfrac12\), inputs \(1,9\), and \(\phi(x)=1/x\) on \((0,\infty)\), calculate both sides and verify the comparison.
- Explain why weights \(\tfrac25,\tfrac45\) cannot be used as probability weights without normalization.
- For the raw weights \(1,2\) and inputs \(0,3\), write the correct unnormalized Jensen inequality for \(\phi(x)=x^2\).