$$\sum_{k=0}^n k \left(\frac{1}{3}\right)^k\left(\frac{2}{3}\right)^{n-k} {n\choose k}$$
Is there a specific way to solve this exercise? (how to start or the basic idea of a solution at exercises like this one).
$$\sum_{k=0}^n k \left(\frac{1}{3}\right)^k\left(\frac{2}{3}\right)^{n-k} {n\choose k}$$
Is there a specific way to solve this exercise? (how to start or the basic idea of a solution at exercises like this one).
Differentiating both sides of $$\sum_{k=0}^n \binom{n}{k} x^k = (1+x)^n$$ with respect to $x$ yields $$\sum_{k=0}^n k \binom{n}{k} x^{k-1} = n(1+x)^{n-1},$$ so $$\sum_{k=0}^n k \binom{n}{k} x^k = nx(1+x)^{n-1}.$$ Now $$ \sum_{k=0}^n k \binom{n}{k} \left(\frac{1}{3}\right)^k \left(\frac{2}{3}\right)^{n-k} = \left(\frac{2}{3}\right)^n\sum_{k=0}^n k \binom{n}{k} \left(\frac{1}{2}\right)^k = \left(\frac{2}{3}\right)^n n\frac{1}{2}\left(\frac{3}{2}\right)^{n-1} = \frac{n}{3}.$$ Alternatively, recognize your sum as the expected number of successes from $n$ samples of a $\text{Bernoulli}(1/3)$ random variable. By linearity of expectation, this is $$n\cdot \mathbb{E}[\text{Bernoulli}(1/3)] = n\cdot (1/3)= n/3.$$