Here is the question from my notes:
Suppose we wish to find a decipherable code that minimizes the expected value of $2^{l_x}$ for a probability distribution $p(x)$. Establish the lower bound $$E\big(2^{l_x}\big)\geq \bigg(\sum_x \sqrt{p(x)}\bigg)^2 \tag{1}$$ Hint: Use Cauchy-Schwarz
I am not really sure what to do in here but here is what I did: $E(l_x)=\sum_x p(x)l_x$ hence I say that $$E(2^{l_x})=\sum_x p(x)2^{l_x} \tag{2}$$ Hence $$\sum_x p(x)2^{l_x}\geq \bigg(\sum_x \sqrt{p(x)}\bigg)^2 \tag{3}$$ I take roots of both side and expand the summations: $$\sqrt{p(1)}+...\sqrt{p(n)}\leq\sqrt{p(1)2^{l_1}+...p(n)2^{l_n}}\tag{4}$$ The Cauchy Schwarz which I am supposed to use is I think something along those lines: $$|x_1y_1+...+x_ny_n|\leq\sqrt{x_1^2+...x_n^2}\sqrt{y_1^2+...y_n^2} \tag{5}$$ Any hints on what to do here would be greatly appreciated.
Notice that we are speaking here of "decipherable codes", so we must put that restriction in play somehow. Fortunately we have Kraft-McMillan inequality.
So we must have $\sum_x 2^{-l_x}\le 1$.
Let's call $a_x = 2^{-l_x}$ and $b_x = p_x 2^{l_x}=p_x a_x^{-1} $
Then we want to bound $E=\sum b_x$ subject to $\sum a_x \le 1$
Now, for any non-negative $a_x,b_x$ , we can write Cauchy-Schwarz as $$\sum_x \sqrt{a_x b_x} \le \sqrt{ \sum_x a_x}\sqrt{ \sum_x b_x} \tag{1}$$
In our case this gives
$$\sum_x \sqrt{p_x} \le \sqrt{E} \sqrt{ \sum_x a_x} \le \sqrt{E} \tag{2}$$
which gives the desired bound.