Imagine I have the following sum: $$ \sum_{i=1}^N p_i (1-p_i) X_i^2 $$ where the $p_i$'s are probabilities and $X_i \in {1\dots N}$
Is there a bound on this sum?
Most of my $p_i$'s are either close to $0$ or close to $1$, imagine they represent the probability of belonging to a certain class. So either I am very sure I belong, or I am very sure I do not belong to a certain class. But what happens in the worst case, that is when all $p_i=0.5$?
If $p_i=0.5, p_i(1-p_i)=0.25$ and distributes out, so you just have a quarter of $\sum X_i^2$. Thus an upper bound:
$$ \sum_{i=1}^n p_i(1-p_i) X_i^2 \le \frac{1}{4} \sum_{i=1}^n X_i^2 $$