Miyu is giving out 9 identical chocolates to her 7 friends, including Dhruv. All possible distributions are equally likely. What is the probability that Dhruv gets exactly 2 chocolates?
First we use Stars and bars to find all possible cases:
\({x}_{1}+{x}_{2}+{x}_{3}...+{x}_{7}=9\)
Stars and bars tells us that there are (9+7-1) choose (7-1) = 5005 nonnegative integer solutions to this.
Now we assume Dhruv (assume that he is x7) gets 2 chocolates. We can find the number of cases which Dhruv gets 2 chocolates.
\({x}_{1}+{x}_{2}...+{x}_{6} = 7\)
Now we use stars and bars again to find that there are (7+6-1) choose (6-1) = 792 nonnegative integer solutions.
So the probability that Dhruv gets 2 chocolates is (792/5005) = (72/455)
(There might be a calculation error if there is tell me)