Number of ways of distributing $4$ identical red balls,$1$ green ball,$1$ black ball among $4$ persons

The question is to find out the number of ways of distributing :

• $4$ identical red balls
• $1$ white ball
• $1$ green ball
• $1$ black ball

among $4$ persons if each receives at least one ball and no one gets all identical red balls.

My attempt

Let $a_i$ denote the number of balls the $i^{th}$ person has. So we want the solution to the equation $$\sum a_i=7\quad\text{ where } 0<a_i<5$$ The total number of integral solution to this equation is $20$.

Since all balls are not identical the total number of ways become $20*\frac{7!}{4!}$ which is $4200$.

The number of ways in which a person gets all identical red balls is $\binom 41 3!$ we have to subtract this value. So the number of ways sought in the question should be $4200-24=4176$.

However this answer is incorrect. Can anyone explain where I went wrong.

Thanks.

• Consider the outcome where the first person receives every color ball and the others receive a red. Your answer counts this particular outcome several times, specifically $4!$ times, once for each arrangement of $rwgb$, when it should only have counted it once. Similarly, there are other outcomes you overcounted. Apr 6 '17 at 3:42
• For a correct solution, approach by inclusion-exclusion on whether a person didn't get any balls. Pick how the red balls are distributed. Once the red balls are distributed, then distribute the green ball. Then once that is done, distribute the black ball. Then distribute the white ball. Apr 6 '17 at 3:43
• @JMoravitz what properties I should choose for the inclusion exclusion principle. Apr 6 '17 at 3:54
• Let $A_i$ be the event that person $i$ has no balls. You want to count $|\bigcap A_i^c| = |\Omega|-|\bigcup A_i|$ Apr 6 '17 at 4:08
• @JMoravitz The number of ways in which there is no restriction is the number of integral solution of $\sum pi=7$ which is equal to $\binom {10}{7}*\frac{7!}{4!}$.The number of ways in which a person has no balls is $\binom 41 \binom 97*\frac{7!}{4!}$ two persons has no ball is $\binom{4}{2} \binom 87*\frac{7!}{4!}$.is this the correct way? Apr 6 '17 at 5:47

In the following, I call $A,B,C,D$ respectively the first, second, third and last player to get at least one stone. So the letters are not referring to a specific player. Instead this notation focuses on making clear how many players have been served so far during ball distribution.

• giving $1,1,1,1$ red balls : $1$ choice

$4$ people are served so we are free to distribute remaining balls

• giving green ball : $4$ choices
• giving white ball : $4$ choices
• giving black ball : $4$ choices

$\text{Subtotal}=1\times(4\times 4\times 4)=64$

• giving $1,1,2$ red balls : $\frac{4\times 3}{2}\times 2=12$ choices (we divide by $2$ because $1,1$ has no order)

$3$ people $A,B,C$ are now served

• giving green ball to $A,B,C$ : $3$ choices
• giving white ball to $A,B,C$ : $3$ choices
• giving black ball to $D$ : $1$ choice
• giving white ball to $D$ : $1$ choice
• giving black ball : $4$ choices

• giving green ball to $D$ : $1$ choice
• giving white ball : $4$ choices
• giving black ball : $4$ choices

$\text{Subtotal}=12\times\bigg(3\times\big((3\times 1)+(1\times 4)\big)+1\times(4\times 4)\bigg)=12\times(3\times7+16)=444$

• giving $2,2$ red balls : ${4 \choose 2}=6$ choices
• giving $1,3$ red balls : $4\times 3=12$ choices

In both cases only $2$ people $A,B$ are served.

• giving green ball to $A,B$ : $2$ choices
• giving white ball to $C$ : $2$ choices
• giving black ball to $D$ : $1$ choice

• giving green ball to $C$ : $2$ choices
• giving white ball to $A,B,C$ : $3$ choices
• giving black ball to $D$ : $1$ choice
• giving white ball to $D$ : $1$ choice
• giving black ball : $4$ choices

$\text{Subtotal}=(6+12)\times\bigg( 2\times (2\times 1)+2\times\big((3\times 1)+(1\times 4)\big)\bigg)=18\times(4+2\times7)=324$

$\text{Total}=64 + 444 + 324 = 832$

• instead 444 I'm getting 576. my method is 12*(select 1 ball from 3 ball which will be given to D and remaining 2 ball can go to any four persons) so answer should be 12*C(3,1)*4*4 = 576 Jan 16 '20 at 6:45