# Expressing $0^2\binom{n}{0}+1^2\binom{n}{1}+\cdots+n^2\binom{n}{n}$ as $f(n)\,2^{g(n)}$ for polynomials $f$ and $g$

Simplify $$0^2 \binom{n}{0} + 1^2 \binom{n}{1} + 2^2 \binom{n}{2} + \cdots + n^2 \binom{n}{n}$$ where $$n \ge 2$$ and put the answer in the form of $$f(n) 2^{g(n)},$$ where $$f(n)$$ and $$g(n)$$ are polynomials in $$n$$ with integer coefficients.

My go at it: Let's say we have a group of $$n$$ people and they have to choose a committee which consists of at least $$0$$ members(a weird committee with $$0$$ people i would say). After having chosen the committee, we chosen a president and vice-president, but in this committee one person can take both roles. Therefore if the committee chose $$k$$ members, the number of ways to choose a vice and a president would be $$k^2 \cdot \binom{n}{k}$$ since they would first choose $$k$$ members and then you have $$k$$ possible presidents and likewise $$k$$ possible vices. This therefore forms the equation given in the problem.

Now we have to write an expression that also suffices this committee choosing. We can first choose people for presidency and vice presidency which gives us $$n^2.$$ For the remaining $$n-2$$ people, they can either be in the group or not be in the group so therefore the expression in the problem is equal to $$\boxed{n^2 2^{n-2}}.$$

However, this answer is wrong, but I can't see why it is wrong. Can anybody point out my flaw? Thanks!

• There's another way, differentiate $(1+x)^n$ wrt x, say you get $f(x)$. Again differentiate $xf(x)$ wrt x. Aug 31, 2020 at 6:29

As Mindjolt pointed out, your argument fails when the president and vice president are the same person. If you handle the case where the leaders are the same, you have $$n \cdot 2^{n-1}$$ ($$n$$ ways to choose the single leader, and the remaining $$n-1$$ people will either be in the group or not); if instead the leaders are different, you have $$n(n-1) 2^{n-2}$$. Adding them yields $$(n^2 + n)2^{n-2}$$.

Algebraic approach suggested by Zenix:

$$(1+x)^n = \sum_{k=0}^n \binom{n}{k} x^k$$ Differentiate once: $$n(1+x)^{n-1} = \sum_{k=1}^n \binom{n}{k} k x^{k-1}$$ Multiply by $$x$$: $$nx(1+x)^{n-1} = \sum_{k=1}^n \binom{n}{k} k x^k$$ Differentiate again: $$n(1+x)^{n-1} + n(n-1) x(1+x)^{n-2} = \sum_{k=1}^n \binom{n}{k} k^2 x^{k-1}$$ Plug in $$x=1$$: $$n2^{n-1} + n(n-1) 2^{n-2} = \sum_{k=1}^n \binom{n}{k} k^2$$

Do you always have $$n-2$$ people remaining? You did mention that a person could take up $$2$$ roles.

• Thanks I got the right answer! :) (+1) Aug 31, 2020 at 6:55

A version of your combinatorial argument can be made to work. Number the people $$1$$ through $$n$$, and put $$n+1$$ slips of paper numbered from $$0$$ through $$n$$ in a hat. Draw any two slips; this can be done in $$\binom{n+1}2$$ ways. If one of the two slips is the $$0$$ slip, the person whose number is on the other slip will be the president and vice president, and we choose any subset of the remaining $$n-1$$ slips to fill out the committee. If the $$0$$ slip is still in the hat, let the slips drawn have numbers $$\ell$$ and $$m$$ with $$\ell. We now draw any subset $$S$$ of the $$n-1$$ slips still in the hat. If the $$0$$ slip is in $$S$$, person number $$\ell$$ is president, person number $$m$$ is vice president, and the people whose slips are in $$S$$ make up the remainder of the committee. Otherwise, $$\ell$$ is the vice president, $$m$$ is the president, and again the people whose slips are in $$S$$ make up the rest of the committee. It’s not hard to see that we have counted each committee once and have a total of $$\binom{n+1}22^{n-1}=(n^2+n)2^{n-2}$$ committees.

There is also a purely algebraic argument using only very standard manipulations of binomial coefficients:

\begin{align*} \sum_{k=0}^nk^2\binom{n}k&=\sum_{k=1}^nk^2\binom{n}k\\ &=n\sum_{k=1}^nk\binom{n-1}{k-1}\\ &=n\sum_{k=0}^{n-1}(k+1)\binom{n-1}k\\ &=n\sum_{k=0}^{n-1}k\binom{n-1}k+n\sum_{k=0}^{n-1}\binom{n-1}k\\ &=n\sum_{k=1}^{n-1}k\binom{n-1}k+n2^{n-1}\\ &=n(n-1)\sum_{k=1}^{n-1}\binom{n-2}{k-1}+n2^{n-1}\\ &=n(n-1)\sum_{k=0}^{n-2}\binom{n-2}k+n2^{n-1}\\ &=n(n-1)2^{n-2}+n2^{n-1}\\ &=(n^2+n)2^{n-2} \end{align*}