# If $f$ is convex then $f\left(\sum_{i=1}^n\lambda_i x_i\right) \leq \sum_{i=1}^n\lambda_i f (x_i)$ [duplicate]

Show by induction that if $f:\mathbb{R}\to\mathbb{R}$ is convex, then for any $x_1,\dots ,x_n$ and $\lambda_1,\dots ,\lambda_n$ with $\sum_{i=1}^n\lambda_i = 1$, $$f\left(\sum_{i=1}^n\lambda_i x_i\right) \leq \sum_{i=1}^n\lambda_i f (x_i) .$$

I think this is similar to the Jensen's inequality, but am not sure how to formally proof this.

Thank you so much!

## marked as duplicate by grand_chat, Did, José Carlos Santos, Community♦Sep 25 '17 at 22:23

• This is an example of Jensen's inequality, assuming that the $\lambda_i$ are supposed to be non-negative. You just need to choose the probability space and the random variable $X$ appropriately. – carmichael561 Sep 25 '17 at 19:47
I will assume that the $\lambda_i$ are non-negative, as otherwise the inequality may not hold.
Suppose that $x_1,\dots,x_n$ are fixed real numbers, and define a probability space $\Omega=\{1,2,\dots,n\}$ with $\mathbb{P}(\{i\})=\lambda_i$. Let $X$ be the random variable defined by $X(i)=x_i$. Then $$\mathbb{E}[X]=\sum_{i}\lambda_ix_i$$ and $$\mathbb{E}[f(X)]=\sum_i\lambda_if(x_i)$$ so the desired result follows from Jensen's inequality. As Harry49 notes, it is also possible to use induction on $n$.