We are supposed to show that the Shannon entropy $H(X_p)$ is maximized for $p=\frac{1}{2}$ for a simple coin toss, where $X_p$ is a random variable saying that the result is $HEADS$ with probability $p$. We are given two hints:
- First compute $2^{H(X_p)}$
- Apply the weighted Arithmetic-Geometric Mean inequality, which states that for $x_1,w_1,x_2,w_2\geq0$ that $\frac{w_1x_1+w_2x_2}{w_1+w_2}\geq\sqrt[w_1+w_2]{x_1^{w_1}x_2^{w_2}}$
So I started with the first hint and get the result $2^{H(X_p)}=(1-p)^{p-1}\cdot(\frac{1}{p})^p$. At this point I am somehow struggling to use the second hint. Looking at the result I would set $x_1=1-p,w_1=p-1,x_2=\frac{1}{p},w_2=p$. Using the inequality, I get $\sqrt[w_1+w_2]{\cdots}\leq \frac{(p-1)(1-p)+\frac{1}{p}\cdot p}{(p-1)+p}=\frac{2p-p^2}{2p-1}$.
So my question is now how to use the inequality. Applying it like I did does not seem to be right because for $p=\frac{1}{2}$ there is no real solution for it.
I hope someone can help me with the second hint.