Possible ways for non-mandatory distribution of $b$ unique bottles and $p$ unique pens to $n$ unique students

38 Views Asked by At

Assuming that $n$ students in a classroom have to be distributed $k$ unique bottles and $q$ unique pens, how many unique ways of doing that is possible?

$n \geq k$ and $n \geq q$

  • A student may or may not get anything, since distribution is not mandatory.
  • A student may get only a bottle.
  • A student may get only a pen.
  • A student may get both a bottle and a pen, but not more.

Example-1: {$ 1 $ student, $ 1 $ bottle, $ 1 $ pen} scenario gives four possibilities

  1. $ (S_1, B_1, P_1) $
  2. $ (S_1, B_1) $
  3. $ (S_1, P_1) $
  4. $ (S_1) $

Example-2: {$ 2 $ students, $ 1 $ bottle, $ 1 $ pen} scenario gives nine possibilities

  1. $(S_1, B_1, P_1), (S_2)$
  2. $(S_1, B_1), (S_2)$
  3. $(S_1, P_1), (S_2)$
  4. $(S_1), (S_2)$
  5. $(S_1), (S_2, B_1, P_1)$
  6. $(S_1), (S_2, B_1)$
  7. $(S_1), (S_2, P_1)$
  8. $(S_1, B_1), (S_2, P_1)$
  9. $(S_1, P_1), (S_2, B_1)$

EDITED

Example-3: {$ 2 $ students, $ 2 $ bottles, $ 2 $ pens} scenario gives 49 possibilities

  1. $(S_1, B_1, P_1), (S_2, B_2, P_2)$
  2. $(S_1, B_2), (S_2, B_1)$
  3. $(S_1, B_1, P_1), (S_2, P_2)$
  4. $(S_1, B_1), (S_2)$
  5. $(S_1, B_2, P_2), (S_2, P_1)$
  6. $(S_1, B_1), (S_2, B_2, P_2)$
  7. $(S_1), (S_2, B_2, P_1)$
  8. $(S_1, B_2), (S_2, B_1, P_1)$
  9. $(S_1), (S_2, P_1)$
  10. $(S_1, B_1, P_2), (S_2, B_2, P_1)$
  11. $(S_1, P_1), (S_2, P_2)$
  12. $(S_1, B_1, P_1), (S_2)$
  13. $(S_1, B_2, P_1), (S_2, B_1)$
  14. $(S_1, B_2, P_2), (S_2)$
  15. $(S_1, P_1), (S_2, B_2, P_2)$
  16. $(S_1), (S_2, B_2)$
  17. $(S_1, P_2), (S_2, B_1, P_1)$
  18. $(S_1, B_1), (S_2, B_2)$
  19. $(S_1, P_2), (S_2, P_1)$
  20. $(S_1, B_1, P_2), (S_2, B_2)$
  21. $(S_1, B_2, P_1), (S_2, P_2)$
  22. $(S_1, B_2), (S_2)$
  23. $(S_1), (S_2, B_2, P_2)$
  24. $(S_1, B_2), (S_2, B_1, P_2)$
  25. $(S_1), (S_2, B_1, P_1)$
  26. $(S_1, B_2, P_1), (S_2, B_1, P_2)$
  27. $(S_1), (S_2)$
  28. $(S_1, B_1, P_2), (S_2, P_1)$
  29. $(S_1, B_2, P_1), (S_2)$
  30. $(S_1, P_1), (S_2)$
  31. $(S_1, B_1), (S_2, B_2, P_1)$
  32. $(S_1, P_1), (S_2, B_1, P_2)$
  33. $(S_1), (S_2, B_1)$
  34. $(S_1, B_2, P_2), (S_2, B_1, P_1)$
  35. $(S_1, B_1, P_1), (S_2, B_2)$
  36. $(S_1, B_1, P_2), (S_2)$
  37. $(S_1, B_2, P_2), (S_2, B_1)$
  38. $(S_1, P_2), (S_2)$
  39. $(S_1, P_2), (S_2, B_2, P_1)$
  40. $(S_1), (S_2, B_1, P_2)$
  41. $(S_1), (S_2, P_2)$
  42. $(S_1, P_1), (S_2, B_1)$
  43. $(S_1, P_1), (S_2, B_2)$
  44. $(S_1, P_2), (S_2, B_1)$
  45. $(S_1, P_2), (S_2, B_2)$
  46. $(S_1, B_1), (S_2, P_1)$
  47. $(S_1, B_1), (S_2, P_2)$
  48. $(S_1, B_2), (S_2, P_1)$
  49. $(S_1, B_2), (S_2, P_2)$

1

There are 1 best solutions below

2
On BEST ANSWER

Suppose that $b$ bottles are distributed, where $b$ can be any number from $0$ to $k$. Since the bottles are distinguishable, there are $\binom kb$ ways to choose which bottles to distribute.

Since each student gets at most one bottle, there are $\binom nb$ to choose which students will get a bottle. Finally, there are $b!$ ways to distribute the bottles to the students.

The total number of way to distribute the bottles is $$\sum_{b=0}^k\binom kb\binom nb b!$$

Similarly, the number to ways to distribute the pens is $$\sum_{p=0}^q\binom qp\binom np p!$$

By the multiplication principle, the number of ways to do both is $$\sum_{b=0}^k\binom kb\binom nb b!\sum_{p=0}^q\binom qp\binom np p!$$

When $k=q=n=2$ this gives $49$ ways.

EDIT

The number of ways of distributing the bottles is the number of ways to place any number from $0$ to $k$ non-attacking rooks on a $k\times n$ chessboard. Think of the rows as students and the columns as bottles. Whenever a rook is placed on the board, the student corresponding to the row gets the bottle corresponding to the column of the square the rook was placed on. We can only have one rook in a row, so a student gets at most one bottle, and we can only have one rook in a column so that a bottle is given to a single student.

This turns out to be A176120 in OEIS, where the formula I derived above is also given.

Similar remarks apply to the pens, of course.