can anyone help me with double-counting proof for this equation: $1^2\binom{n}{1} + 2^2\binom{n}{2}+3^2\binom{n}{3}+...+n^2\binom{n}{n}$ = $n(n+1)2^{n-2}$
I tried this example: we have n+1 bits and at least two "1" bits. it gives just the right side. and also looking at right side in $\binom{n+1}{2}2^{n-1}$ may help.
Both sides count the combinations of subsets of $[n]$ with ordered pairs of elements of that subset. On the left, we first choose one of $\binom nk$ subsets with $k$ elements and then choose one of the $k^2$ ordered pairs of its elements. On the right, we first choose an ordered pair of elements and then a subset containing the elements: For the $n(n-1)$ pairs of different elements there are $2^{n-2}$ subsets containing them, and for the $n$ pairs of identical elements there are $2^{n-1}$ subsets containing them, for a total of $n(n-1)2^{n-2}+n2^{n-1}=n(n+1)2^{n-2}$.