## mathmath333 one year ago Counting question

1. Rushwr

??????? question ?

2. mathmath333

\large \color{black}{\begin{align} \normalsize \text{In how many ways can u distribute 7 identical gifts among 5 children.}\hspace{.33em}\\~\\ \end{align}}

3. mathmath333

ok

4. ganeshie8

say the stars are gifts : $*~*~*~*~*~*~*$

5. ganeshie8

you want to split those 7 gifts into 5 parts, so place 4 bars in between them : $*~*|~*|~*|~*~*|~*$

6. ganeshie8

that arrangement represents : 2 gifts to first child 1 gift to second child 1 gift to third child 2 gifts to fourth child 1 gift to fifth child

7. ganeshie8

see if you can tell what below arrangement represents : $*|~*~*|~*|~*~*|~*$

8. mathmath333

9. ganeshie8

Perfect! notice, that string has 7 stars and 4 bars, so the total length of that string is 7+4 = 11

10. ganeshie8

as you can see, the problem translates to finding the number of ways of choosing 4 positions for the bars from the 11 positions

11. mathmath333

I think now the answer is 11C4. as u are seleecting 11 objects in 4 ways

12. ganeshie8

how many ways can you choose 4 different things(positions) from 11 different things(positions) ?

13. mathmath333

11C4

14. ganeshie8

Thats it!

15. anonymous

stars and bars indeed

16. ganeshie8

Alternatively you could also think of it as forming different 11 letter words using 7 stars and 4 bars : 11!/(4!*7!)

17. mathmath333

\large \color{black}{\begin{align} & \normalsize \text{In how many ways can u distribute 7 identical gifts among 5 children.}\hspace{.33em}\\~\\ & \normalsize \text{such that each child gets at least 1 gift.}\hspace{.33em}\\~\\ \end{align}}

18. anonymous

reserve 5 gifts, distribute the remaining 2, and then count the ways you can assign one of the reserved 5 to each child

19. ganeshie8

you may use the same trick, consider 7 stars : $*~*~*~*~*~*~*$

20. ganeshie8

you want to partition that into 5 nonempty parts, at what positions are you allowed to place the 4 bars ?

21. ganeshie8

is below a valid arrangement ? $*|~*|~*|~*~*|~*|~*$

22. mathmath333

except the rear and front ends ?

23. mathmath333

yes,valid

24. ganeshie8

im asking specifically if above arrangement is valid

25. ganeshie8

good :)

26. ganeshie8

how about below one : $|*~*|~*~*~*|~*|~*$ what does it represent and is it a valid one ?

27. mathmath333

28. ganeshie8

right, that means you don't like the first child what about below one : $*~*|~|~*~*~*|~*|~*$

29. mathmath333

30. ganeshie8

so you cannot place bars next to each other and you cannot place bars on the ends

31. ganeshie8

the only valid places for bars are : $*~-*-~*-*-*-*-*$ those 6 dashes

32. ganeshie8

four bars to place six positions to choose from how many total ways can u do it ?

33. mathmath333

6C4 ?

34. ganeshie8

Yep!

35. ganeshie8

a bit more generally, the number of positive integer solutions to the equation $$\large a+b+c+d+e=n$$ is given by $$\large \dbinom{n-1}{4}$$

36. ganeshie8

similarly, the number of "non negative" integer solutions to the equation $$\large a+b+c+d+e=n$$ is given by $$\large \dbinom{n+4}{4}$$