0

I need help solvinf this task, if anyone had a similar problrm it would help me.

The task is:

Calculate :

$\sum_{i=0}^ni^2{n\choose i} $

I tried this:

$ \sum_{i=0}^ni^2{n\choose i}\\ \sum_{i=0}^ni^2\frac{n!}{i!(n-i)!}\\ \sum_{i=0}^ni\frac{n!}{(i-1)!(n-i)!}\\ n!\sum_{i=0}^ni\frac{1}{(i-1)!(n-i)!}\\ \frac{n!}{(n-1)!}\sum_{i=0}^ni\frac{(n-1)!}{(i-1)!(n-i)!}\\ n\sum_{i=0}^ni{n-1\choose i-1} $

And now, i have no idea how to get solution $2^{n-2}n(n+1) $

Thanks in advance !

LogicNotFound
  • 465
  • 2
  • 6

3 Answers3

2

Hint

Write $i^2$ as $$i(i-1)+i$$

For $i\ge2,$ $$i^2\binom ni$$

$$=i(i-1)\binom ni+i\binom ni$$

$$=n(n-1)\binom{n-2}{i-2}+n\binom{n-1}{i-1}$$

Check for $i=0,1$

Use $$(1+1)^m=\sum_{j=0}^m\binom mj$$

1

Evaluate$$\begin{align}\sum_{i=0}i^2\binom{n}{i}x^i&=\left(x\frac{d}{dx}\right)^2\underbrace{\sum_{i=0}\binom{n}{i}x^i}_{(1+x)^n}\\&=nx\frac{d}{dx}((1+x)^n-(1+x)^{n-1})\\&=nx(1+x)^{n-2}(1+nx)\end{align}$$at $x=1$ as $n(n+1)2^{n-2}$.

Another option is a double-counting argument. Given $n$ people, choose a committee of $i$ people, and independently choose a president and vice president thereof, possibly identical, in $i^2$ ways. Then $\sum_{i=0}i^2\binom{n}{i}$ is the number of possible appointments. Equivalently, there are $n^2$ ways to choose the president and vice president, and $2^{n-2}$ ways to choose other committee members.

J.G.
  • 115,835
1

First we have:

$$\sum_{i=0}^n \binom n i x^i = (1+x)^n$$

Differentiating we have:

$$\sum_{i=0}^n i \binom n i x^{i-1} = n (1+x)^{n-1}$$ $$\sum_{i=0}^n i(i-1)\binom n i x^{i-2} = n(n-1)(1+x)^{n-2}$$

At $x=1$, we have the equations:

$$\sum_{i=0}^n i \binom n i = n 2^{n-1}$$ $$\sum_{i=0}^n i(i-1)\binom n i = n(n-1)2^{n-2}$$

Summing up the results:

$$\begin{align} \sum_{i=0}^n i^2\binom n i &= \sum_{i=0}^n i \binom n i + \sum_{i=0}^n (i^2-i)\binom n i\\~\\&= n 2^{n-1} + n(n-1)2^{n-2} \\~\\&= n2^{n-2}(2+n-1) \\~\\&= n(n+1)2^{n-2}\end{align}$$

player3236
  • 16,413