# How is this exactly equal to $N_1+N_2+\dots+N_r$?

There are $N$ boxes, each containing at most $r$ balls. If the number of boxes containing at least $i$ balls is $N_i$ for $i=1,2,\dots,r,$ then the total number of balls contained in these $N$ boxes is exactly equal to $N_1+N_2+\dots+N_r.$

How is that exactly equal to $N_1+N_2+\dots+N_r$? I can't understand why statement containing at least and at most turn to give this exact answer!

I tested for $N=4$ and $r=3$. Suppose that box 1 has 3 balls, box 2 has 2 balls, box 3 has 1 ball and box 4 has 3 balls. So, $N_1=4,N_2=3,N_3=2$ and the conclusion holds!

• How many times have you counted each of the boxes containing exactly $r$ balls? – Arthur Apr 5 '14 at 8:27
• I have shown my try. – Silent Apr 5 '14 at 8:28
• I know, and that's appreciated. I'm trying to hint you toward why this works. So, how many of the $N_i$ terms contain in them the boxes with exactly $r$ balls? – Arthur Apr 5 '14 at 8:31
• All the $N_i$s. – Silent Apr 5 '14 at 8:33

## 2 Answers

Note that the number of boxes that contains exactly $j$ balls is $N_j-N_{j+1}$. Then, the total number of balls is $$\sum_{j=1}^r j(N_j-N_{j+1})=\sum_{j=1}^{r+1}N_j(j-(j-1))=\sum_{j=1}^rN_j$$ since $N_{r+1}=0$.

• ☺♥ Thank you so much! – Silent Apr 5 '14 at 8:42
• How did you get $\sum_{j=1}^{r+1}N_j(j-(j-1))$? – Silent Apr 5 '14 at 9:02
• Take for example $r=3$ : $N_1-N_2+2N_2-2N_3+3N_3-3N_4=$ $=N_1(1-0)+N_2(2-1)+N_3(3-2)+N_4(4-3)$. Note that since $N_4=0$ you can multiplicate it by whatever you want. – ajotatxe Apr 5 '14 at 9:11

If a box contains $b$ balls, then it is counted into $N_1, N_2, \ldots, N_b$. For example a box with $3$ balls has "at least three balls", so it is counted in $N_3$, but it also has "at least two balls" and "at least one balls", so it also counted in $N_2$ and $N_1$ respectively. So you count each box as many times as is the number of balls the box contains.

• ☺♥ Thank you so much! – Silent Apr 5 '14 at 8:41