I have this formula:
$E(X)=$$\sum_{k=1}^n k$$n \choose k$$p^k$$(1-p)^{n-k}$
and I am trying to prove $E=(X)=pn$, by taking the derivative of with respect to y:
$(x+y)^n=$$\sum_{k=0}^n$$n \choose k$$x^{n-k}$$y^k$
Heres what I got:
so first I am going to do a substituation:
$=$$\sum_{k=1}^n $k $n \choose k$$p^k$$(1-p)^{n-k}$
$k$$n \choose k$$=$$k *$ $\frac {n!} {k!(n-k)!}$$=n*$$\frac {(n-1)!} {(k-1)!(n-k)!}$$=n*$${n-1} \choose {k-1}$
Giving me this:
$=n$$\sum_{k=1}^n$ ${n-1} \choose {k-1}$ $p^k$ $(1-p)^{n-k}$
$=n$$\sum_{l=0}^{n-1}$ ${n-1} \choose {l}$ $p^{l+1}$ $(1-p)^{n-1-l}$
$=pn$$\sum_{l=0}^{n-1}$ ${n-1} \choose {l}$ $p^{l}$ $(1-p)^{n-1-l}$ (newton's formula)
$\sum_{l=0}^{n-1}$ ${n-1} \choose {l}$ $p^{l}$ $(1-p)^{n-1-l}$ => $(x+y)^{n-1}$ $x=1-p; y=p$
thus,
we get $pn$
You gave a correct argument using manipulation of binomial coefficients. Here is an argument using derivatives.
For any fixed $y$, let $$g(x)=(x+y)^n=\sum_0^n \binom{n}{k}x^ky^{n-k}.$$ Then $$g'(x)=n(x+y)^{n-1}=\sum_1^n k\binom{n}{k}x^{k-1}y^{n-k},$$ and therefore $$xn(x+y)^{n-1}=\sum_1^n k\binom{n}{k}x^ky^{n-k}.$$ Now put $x=p$ and $y=1-p$.