I am trying to compute this sum which at first glance seems to be easy but always either fail or get a result that is self-contradictory.
the sum : $$\mathscr{S} = \sum_{k=0}^nk{n \choose k}p^kq^{n-k}$$ where $p$ , $q$ ∈ $\Bbb{R^{*}+}$ and $p + q = 1$
My last try : ok so first of all because the first term is equal to zero I'm gonna change the start point from 0 to 1
$$\mathscr{S} = \sum_{k=1}^nk{n \choose k}p^kq^{n-k}$$
and then simplifiy $k{n \choose k}$
${n \choose k} = \frac{n!}{k!(n-k)!}$
$k{n \choose k} = \frac{n!}{k!(n-k)!} = \frac{n!}{(k-1)!(n-k)!}$
plug the result above in $\mathscr{S}$
$$\mathscr{S} = \sum_{k=1}^n\frac{n!}{(k-1)!(n-k)!}p^kq^{n-k}$$
and since $n$ is a free variable I can pull it out of the sum
$\mathscr{S} = n\sum_{k=1}^n\frac{(n-1)!}{(k-1)!(n-k)!}p^kq^{n-k} =n\sum_{k=1}^n\frac{(n-1)!}{(k-1)!((n-1)-(k-1))!}p^kq^{n-k} = n\sum_{k=1}^nk{n-1 \choose k-1}p^kq^{n-k}$
and since $p$ and $q$ are just like $n$ two free variables I'll pull one $p$ and one $q$ too from the sum and I'll get this
$\mathscr{S} = npq\sum_{k=1}^n{n-1 \choose k-1}p^{k-1}q^{n-(k-1)}$
now I'll change the start point to 0 and I get this :
$\mathscr{S} = npq\sum_{k=0}^n{n-1 \choose k}p^{k}q^{n-k} = pq\sum_{k=0}^n\frac{n!}{k!(n-k-1)!}p^{k}q^{n-k}$
now I divide and multiply the inside of the sum by $(n-k)$
$\mathscr{S} = pq\sum_{k=0}^n(n-k)\frac{n!}{k!(n-k-1)!(n-k)}p^{k}q^{n-k} =pq\sum_{k=0}^n(n-k)\frac{n!}{k!(n-k)!}p^{k}q^{n-k} = pq\sum_{k=0}^n$$(n-k)$${n \choose k}p^kq^{n-k}$
by rearranging I get this : $\mathscr{S} = pq\sum_{k=0}^nn{n \choose k}p^kq^{n-k}-pq\sum_{k=0}^nk{n \choose k}p^kq^{n-k} = npq\sum_{k=0}^n{n \choose k}p^kq^{n-k} -pq\mathscr{S}$
and according to the newton's binomial theorem we have that $$\sum_{k=0}^n{n \choose k}p^kq^{n-k} = (p+q)^n=1^n=1$$
so I concluded that $\mathscr{S}$ is basically equal to $\frac{npq}{1+pq}$
But for $n = 2$ and $q=p=1/2$
$$\sum_{k=0}^2k{2 \choose k}(0.5)^k(0.5)^{2-k} = 1 \neq \frac{2*0.5*0.5}{1+0.5*0.5} = 0.4$$
so I've made a mistake somewhere but can't find where exactly
please help me find my mistake and solve this problem.
thank you