tgf wrote:palvarez wrote:Treat X as donuts, the bar | as splitting.
XX|X|XX, 2 donuts for the first person; 1 for the next; 2 for the last
Now the problem is: in how many ways can you shuffle 2 '|' in between 5 donuts.
Why 2 |s? For three people in the above example, you need 2 |'s
For n people, you need n -1.
x_1 + x_2 + ... +x_k =n
where 0 <= x_i < =n
Number of solutions: (n+k-1)C(k-1) = (n+k-1)Cn. Here you see k-1 +'s.
Could someone just clarify what the difference between this problem at the one that Stuart Kovinsky answer to on the laste page of this thread: ?
https://www.beatthegmat.com/combination-t41362.html
How is the "zeros" taken care of here? If ||XXXXX leaves all the donuts for the last person, then how is the two slots (||) in the same place counted in the combinations??
Thanks
Here is how you solve it: If x, y, and z are positive integers, and x + y + z = 9. How many combinations of x, y, and z are possible?
x+y+z = 9 1 <= x, y, z <=9
a +b +c = 6 0<= a, b, c <=6
#solutions to the latter equation gives the answer: 8C2 = 28
The method works when each variable is between 0 and k, where k = x+y+z. So, you need to change the equation a bit to accomodate that constraint.