Solution
= Solution
Set $A=\sum_i p_i a_i>0$ and $x_i=a_i/A$. Then $\sum_i p_ix_i=1$, so part 1 gives $\prod_i(a_i/A)^{p_i}\le1$. Since $\sum_i p_i=1$, this becomes
$$
\boxed{\prod_i a_i^{p_i}\le\sum_i p_i a_i.}
$$
Equality holds exactly when $x_i=1$ for all $i$, equivalently all the $a_i$ are equal. This is the weighted arithmetic–geometric mean inequality.