Question 1204839
There is a group of five children, where two of the children are twins. In how
many ways can I distribute 18 identical pieces of candy to the children, if the
twins must get 7 pieces of candy?
<pre>
You didn't say "the twins must get 7 pieces of candy EACH" so I'll assume you
mean they get 7 pieces of candy together.

We put 7 pieces aside to give the twins.  So we have 11 pieces to distribute to
the 3 non-twin children. 

Suppose non-twin child A gets "a" pieces of candy, non-twin child B gets "b"
pieces of candy, and non-twin child C gets "c" pieces of candy. I will assume
everybody gets at least one piece of candy.

Then a+b+c=11, where a,b,c are all positive integers.

Let x=a-1, y=b-1, z=c-1, so a=x+1, b=y+1, c=z+1

a+b+c=11 so
(x+1)+(y+1)+(z+1)=11
x+y+z=8

So x, y, and z are, respectively, 1 fewer than the number of pieces of candy
that A,B, and C respectively get.

We make a row of 8 stars and 2 bars, for example ***|****|*.  The number of
stars left of the leftmost bar, is x. The number of stars between the two bars
is y, and the number of bars right of the rightmost bar is z

For the example ***|****|*, the 3 stars left of the first bar means that x=3 and
a=4. The 4 stars between the bars mean z=4, and b=5.  The 1 star on the end
means z=1 and c=2.

Take another example.  ****||**** x=4, y=0, z=4, so a=5, b=1, c=5.
Take another example. ||******** x=0, y=0, z=8, so a=1, b=1, c=9.

There are 8 stars and 2 bars.  The two bars are undistinguishable and the 8
stars are also undistinguishable. So there are 10!/(2!8!) = 45 ways to
distribute the 11 pieces of candy to the three non-twins.

Now we distribute the 7 pieces of candy to the twins. We could get the number of
ways to distribute with stars and only 1 bar.  But it's easier just to realize
that the first twin can get 1 through 6 pieces and the second twin gets the
rest.  So there are 6 ways to distribute the 7 pieces of candy to the twins.

So the answer is (45)(6) = 270 ways to distribute the 18 pieces of candy to
the 5 children.

Answer: 270 
   
Edwin</pre>