Let S be the number of successes in n independent Bernoulli trials, with possibly different probabilities $p_1, ..., p_n$ on different trials. Show that for fixed $\mu=E(S)$, $Var(S)$ is largest in case the probabilities are all equal.
I figured out that $Var(S)=\sum_{i=1}^n p_i(1-p_i)$, and my question is why $p_i$ for i=1,2,..,n are all equal to make $Var(S)$ largest.
Thanks!
By Cauchy-Schwarz, we have $$ \mu=p_1+\cdots+p_n\leq \sqrt{n}\Big[\sum_ip_i^2\Big]^{\frac{1}{2}}$$ with equality when $(p_1,\cdots,p_n)$ and $(1,\cdots,1)$ are linearly dependent, i.e. when all of the $p_i$ are equal.
This means that for $\mu$ fixed, $\sum_ip_i^2$ is minimized when all of the $p_i$ are equal, and since $$ \mathrm{var}(S)=\sum_ip_i(1-p_i)=\mu-\sum_{i}p_i^2$$ it follows that $\mathrm{var}(S)$ is maximized when all of the $p_i$ are equal.