We have 7 balls each of different colors (red, orange, yellow, green, blue, indigo, violet) and 3 boxes each of different shapes (tetrahedron, cube, dodecahedron). How many ways are there to place these 7 balls into the 3 boxes such that each box contains at least 1 ball?

I solved it like this: Assuming that the 3 boxes have got 1 ball each no. of balls left$=4$ Let box $1,2,3$ get $a,b,c$ balls each $0\le a,b,c \le 4$ $$a+b+c=4$$ Possible solutions $={4+2 \choose 2}=15$

Now in the assumption ways of placing 3 balls in 3 boxes=$3!=6$

So total no. of ways $= 6 \times 15=90$

But answer is $1806$!! Where am i wrong?? Please help

  • $\begingroup$ Permutation matters. $\endgroup$ – Kenny Lau Sep 22 '17 at 14:47
  • $\begingroup$ @KennyLau Which permutation?? $\endgroup$ – sayan Sep 22 '17 at 14:47
  • 1
    $\begingroup$ Note that $1806={3\choose 3} 3^7-{3\choose 2} 2^7+{3\choose 1} 1^7-{3\choose 0} 0^7$. Both the balls and the boxes are distinguishable $\endgroup$ – Henry Sep 22 '17 at 14:49
  • $\begingroup$ Could someone tell which step am I making the mistake?? $\endgroup$ – sayan Sep 22 '17 at 14:54

The balls are distinguishable and for each ball we have three choices of where to put it. The number of possible ways, without restrictions, is thus $3^7=2187$.

The disallowed ways can be counted by inclusion–exclusion. If the balls are put into two boxes we have three choices for which boxes the balls get put into and two choices per ball, leading to $3×2^7=384$ disallowed ways. We counted the $3×1^7=3$ ways to put all balls into one box twice, so we subtract 3.

Finally, the number of allowed assignments of balls to boxes is $2187-384+3=1806$.

  • $\begingroup$ That was their solution. But where am i going wrong??That was what I wanted to know $\endgroup$ – sayan Sep 22 '17 at 14:53
  • 2
    $\begingroup$ @sayan You went wrong because you assumed the balls were identical to each other. $\endgroup$ – Parcly Taxel Sep 22 '17 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.