# How do I compute the sum $\sum_{i=0}^N \binom{N}{i} a^i (1-a)^{N-i}$

I got this question for an assignment. "Six dice are thrown 729 times. How many times do you expect at least three dice shows 5 or 6?"

I got a value $$a = 1- \sum_{i=0}^2\binom{6}{i}\cdot (\frac{1}{3})^i \cdot(\frac{2}{3})^{6-i}$$ Where $a$ is the probability of getting 5 or 6 on any three dice. Now I got a second equation which i can not solve.

How do I compute the sum $$\sum_{i=0}^N i \binom{N}{i} a^i (1-a)^{N-i}$$

• The summation is the expectation of a binomial random variable. Aug 25, 2017 at 19:08
• See this post. Aug 25, 2017 at 19:11
• You shouldn't write $\dfrac 2 3 ^3$ when you mean $\left( \dfrac 2 3\right)^3. \qquad$ Aug 25, 2017 at 19:24
• The number $a$ that you found is the probability of getting a $5$ or a $6$ on EXACTLY three dice, not on AT LEAST three dice. Aug 25, 2017 at 19:32
• @Michael Hardy. Sorry for this. I will take care next time and thanks for suggestions. Aug 25, 2017 at 20:32

If you have N events with probability a of success for each, the expected is $N\times a$ which is the value of your sum. In this case,

You can compute the sum directly as follows. You consider the summation:

$$f(p,q)=\sum_{i=0}^{N}\binom{N}{i}p^iq^{N-i}\tag{1}$$

where we consider $p$ and $q$ to be independent variables, so we don't put $q = 1-p$. By the binomial theorem, we have:

$$f(p,q) = (p+q)^N$$

To find the desired summation, we need to put in a factor of $i$ in the summand in Eq. (1). We can do that by differentiating both sides of Eq. (1) w.r.t. $p$. This yields:

$$N (p+q)^{N-1}=\sum_{i=0}^{N}\binom{N}{i}ip^{i-1}q^{N-i}$$

Multiplying both sides by $p$ then yields the desired summation:

$$N p (p+q)^{N-1}=\sum_{i=0}^{N}\binom{N}{i}ip^{i}q^{N-i}$$

We can now put $p = a$ and $q = 1-a$ to find that the summation is given by $N a$.

$$\sum_{i=0}^n i \frac{n!}{i!(n-i)!} a^i (1-a)^{n-i}=\sum_{i=0}^n \frac{n(n-1)!}{(i-1)!(n-i)!} a^i (1-a)^{n-i}\\ =na\sum_{i=1}^n\binom{n-1}{i-1}a^{i-1} (1-a)^{n-i}=na(1-a+a)^{n-1}=na.$$

• @RichardClare: why this comment ???
– user65203
Aug 26, 2017 at 12:06