7

How many ways are there to distribute 5 distinguishable balls between 3 kids such that each of them gets at least one ball?

My approach is $ \binom{5}{3} 3! $ + $ \binom{2}{2} \binom{3}{2}2!$ which is equal to $66$?

N. F. Taussig
  • 76,571
mohit
  • 85
  • 1
    This question was asked in IIT JEE 1981 and IIT JEE 2012 papers. (Indian Institute of Technology, Joint Entrance Exam). The wording and setting were slightly changed, but essentially the same question. – Shailesh Jun 21 '16 at 06:42

5 Answers5

12

It’s not the quickest or most elegant approach, but this problem is straightforwardly done by considering cases. If each kid gets at least one ball, the balls must be distributed either $3$-$1$-$1$ or $2$-$2$-$1$.

  • $3$-$1$-$1$: There are $\binom31=3$ ways to choose which kid gets $3$ balls, and $\binom53=10$ ways to choose $3$ balls for that kid. There are then $2$ ways to distribute the remaining $2$ balls to the other $2$ kids. This case therefore accounts for $3\cdot10\cdot2=60$ possible distributions.

  • $2$-$2$-$1$: There are $3$ ways to choose which kid gets only $1$ ball, and $5$ ways to pick the ball for that kid. There are then $\binom42=6$ ways to choose which $2$ balls go to the next kid in line, and the remaining kid gets the remaining $2$ balls. This case accounts for another $3\cdot5\cdot6=90$ possible distributions.

The correct total, therefore, is $60+90=150$.

Added: It appears to me that you reasoned something like this: First we choose $3$ of the $5$ balls and distribute one of them to each kid; that can be done in $\binom533!$ ways. Then we take both of the remaining $2$ balls, pick $2$ of the $3$ kids, and distribute the last $2$ balls in one of the $2$ possible ways to the $2$ lucky kids. There are several problems with this approach.

  1. You’ve considered only the second of my two cases.

  2. You’re combining the results of successive choices, not the counts of disjoint cases, so you should be multiplying, not adding: $\binom533!\cdot\binom22\binom322!=60\cdot6=360$.

  3. You’re overcounting. Suppose that the balls are labelled A, B, C, D, and E. Then you’ve counted the distribution AD | BE | C four times:

    • once as the result of distributing A, B, and C in the first step and then distributing D and E to the first and second kids in the second step;
    • once as the result of distributing D, B, and C in the first step and then distributing A and E to the first and second kids in the second step;
    • once as the result of distributing A, E, and C in the first step and then distributing D and B to the first and second kids in the second step; and
    • once as the result of distributing D, E, and C in the first step and then distributing A and B to the first and second kids in the second step.
Brian M. Scott
  • 616,228
9

There is a reasonably nice Inclusion/Exclusion way of counting. Forget temporarily about the at least one ball restriction. For each ball, there are $3$ choices for who will get it, for a total of $3^5$.

Now let's count the bad distributions, where one or more kid is left out. We can choose who gets left out in $\binom{3}{1}$ ways. For each choice, there are $2^5$ ways to distribute the balls, for a total of $\binom{3}{1}2^5$.

However, we have double counted the distributions in which a kid gets all the balls, so we must subtract $3$.

It follows that there are $93$ bad distributions. Subtract this from the $3^5=243$.

Remark: The idea generalizes.

André Nicolas
  • 507,029
9

$$\sum_{r_1+r_2+r_3=5,r_i\geq1}\binom{5}{r_1}\binom{5-r_1}{r_2}\binom{5-r_1-r_2}{r_3}=$$

$$=\sum_{r_1+r_2+r_3=5,r_i\geq1}\frac{5!}{r_1!r_2!r_3!}=\frac{5!}{1!1!3!}+\frac{5!}{1!3!1!}+\frac{5!}{3!1!1!}+\frac{5!}{1!2!2!}+\frac{5!}{2!1!2!}+\frac{5!}{2!2!1!}=$$ $$=3(20+30)=150$$

Adi Dani
  • 16,949
4

This is similar as total Number of onto functions from $m$ elements to $n$ elements:

$$\sum_{k=0}^n(-1)^k\binom{n}k(n-k)^m\;$$

Given that $m=5$ and $n=3$.

So, total number of ways such that each of them gets at least one ball

$=3^5-^3C_1(3-1)^5+^3C_2(3-2)^5-^3C_3(3-3)^5$

$=150$

1

Given the variety of methods applied in the previous answers, I can't resist demonstrating one more: an exponential generating function. Readers not familiar with generating functions can find many resources in the answers to this question: How can I learn about generating functions?

More generally, we might ask the question of how many ways we can distribute $r$ distinguishable balls among three kids, with each kid getting at least one ball. Let's say the answer is $a_r$, and define the exponential generating function of $a_r$ as $$f(x) = \sum_{r=0}^{\infty} \frac{1}{r!} a_r x^r$$

The exponential generating function of the number of ways to distribute $r$ balls to a single kid is $$x + \frac{1}{2!} x^2 + \frac{1}{3!} x^3 + \dots = e^x -1 $$ and the number of ways to distribute $r$ balls to three kids is the "star product" of three such sequences, so $$f(x) = (e^x-1)^3 = e^{3x} - 3 e^{2x} + 3 e^x -1$$ The answer to the general problem, $a_r$, is $r![x^r]f(x)$, i.e. $r!$ times the coefficient of $x^r$ when $f(x)$ is expanded as an infinite series. Recalling the infinite series for $e^x$, we see that $$a_r = 3^r - 3 \cdot 2^r + 3$$ for $r >0$. In the particular case $r=5$, this yields $a_5 = 150$.

awkward
  • 14,736
  • The series of e^x - 1 reads as : a score of one or score of two divide by two factorial and so on. My question is why is there two different ways to give one kid two balls? – tryst with freedom Jul 19 '20 at 20:40
  • @DDD4C4U There is only one way to give one kid two balls, and that is reflected in the EGF. The EGF for the sequence $a_0, a_1, a_2, \dots$ is defined as $$\sum_{n=0}^{\infty} \frac{1}{n!} a_n x^n$$ so the sequence $0,1,1,1, \dots$ has the EGF $e^x-1$. The factor $1/n!$ is what makes an exponential generating function different from an ordinary generating function. – awkward Jul 20 '20 at 12:31
  • if there is only one way how do you explain the 1/n! thing? – tryst with freedom Jul 20 '20 at 12:55
  • it's liek a fractional number of ways – tryst with freedom Jul 20 '20 at 12:55
  • @DDD4C4U The $1/n!$ factor comes from the definition of an exponential generating function of a sequence. It is not part of the sequence. It may seem strange by comparison with an ordinary generating function, but exponential generating functions have advantages in certain types of combinatorial problems (such as this one). – awkward Jul 20 '20 at 13:33
  • https://math.stackexchange.com/posts/comments/7741300?noredirect=1 pls see dis q – tryst with freedom Jul 20 '20 at 13:38
  • @DDD4C4U In case of confusion, it's probably best just to think of generating functions as abstract transforms: we start out with a sequence of numbers and end up with a function that captures all the information about the sequence. "A generating function is a clothesline on which we hang up a sequence of numbers for display." (Wilf, *generatingfunctionology", an excellent intro) It's true that some common operations in combinatorics map easily to operations on generating functions (that's what makes them useful tools), but not all. – awkward Jul 20 '20 at 14:40