Counting question
??????? question ?
\(\large \color{black}{\begin{align} \normalsize \text{In how many ways can u distribute 7 identical gifts among 5 children.}\hspace{.33em}\\~\\ \end{align}}\)
ok
say the stars are gifts : \[*~*~*~*~*~*~*\]
you want to split those 7 gifts into 5 parts, so place 4 bars in between them : \[*~*|~*|~*|~*~*|~*\]
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
see if you can tell what below arrangement represents : \[*|~*~*|~*|~*~*|~*\]
1 gifts to first child 2 gift to second child 1 gift to third child 2 gifts to fourth child 1 gift to fifth child
Perfect! notice, that string has 7 stars and 4 bars, so the total length of that string is 7+4 = 11
as you can see, the problem translates to finding the number of ways of choosing 4 positions for the bars from the 11 positions
I think now the answer is 11C4. as u are seleecting 11 objects in 4 ways
how many ways can you choose 4 different things(positions) from 11 different things(positions) ?
11C4
Thats it!
stars and bars indeed
Alternatively you could also think of it as forming different 11 letter words using 7 stars and 4 bars : 11!/(4!*7!)
\(\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}}\)
reserve 5 gifts, distribute the remaining 2, and then count the ways you can assign one of the reserved 5 to each child
you may use the same trick, consider 7 stars : \[*~*~*~*~*~*~*\]
you want to partition that into 5 nonempty parts, at what positions are you allowed to place the 4 bars ?
is below a valid arrangement ? \[*|~*|~*|~*~*|~*|~*\]
except the rear and front ends ?
yes,valid
im asking specifically if above arrangement is valid
good :)
how about below one : \[|*~*|~*~*~*|~*|~*\] what does it represent and is it a valid one ?
0 gifts to first child 2 gift to second child 3 gift to third child 1 gifts to fourth child 1 gift to fifth child invalid
right, that means you don't like the first child what about below one : \[*~*|~|~*~*~*|~*|~*\]
2 gifts to first child 0 gift to second child 3 gift to third child 1 gifts to fourth child 1 gift to fifth child invalid
so you cannot place bars next to each other and you cannot place bars on the ends
the only valid places for bars are : \[*~-*-~*-*-*-*-*\] those 6 dashes
four bars to place six positions to choose from how many total ways can u do it ?
6C4 ?
Yep!
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}\)
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}\)
Join our real-time social learning platform and learn together with your friends!