3

Problem
I want to distribute $n=3$ distinguishable items to $r=3$ distinguishable groups such that

  • repetition of items is not allowed
  • each group contains one or more items.

Solution

We follow inclusion-exclusion principle which, in turn, takes form of Stirling number of second kind.

  • $3^3=27$ ways to distribute $3$ items to $3$ groups such that $3$ groups can contain zero or more items.
  • (Subtract) $2^3\times\binom{3}{1}=24$ ways to distribute $3$ items to $2$ groups such that $2$ groups can contain zero or more items (i.e., $1$ group is guaranteed to be empty).
  • (Add) $1^3\times \binom{3}{2}=3$ ways to distribute $3$ items to $1$ group such that $1$ group can contain zero or more items (i.e., $2$ groups are guaranteed to be empty).

Final answer $=27-24+3=6$. These six distributions corresponds to following distributions:

| Group 1 | Group 2 | Group 3 |
-------------------------------
| 1       | 2       | 3       |
| 1       | 3       | 2       |
| 2       | 1       | 3       |
| 2       | 3       | 1       |
| 3       | 1       | 2       |
| 3       | 2       | 1       |

Doubt

Though the answer seems to be correct, I am struggling to get to which distributions those components (27,24,3) corresponds to. I fully understand 27 corresponds to all the ways distributions can be done:

|    | Group 1 | Group 2 | Group 3 |
|----|---------|---------|---------|
| 1  | 123     |         |         | 123 in one group
| 2  |         | 123     |         |
| 3  |         |         | 123     |
------------------------------------
| 4  | 12      | 3       |         | 12 in one group
| 5  | 12      |         | 3       |
| 6  | 3       | 12      |         |
| 7  |         | 12      | 3       |
| 8  |         | 3       | 12      |
| 9  | 3       |         | 12      |
------------------------------------
| 10 | 23      | 1       |         | 23 in one group
| 11 | 23      |         | 1       |
| 12 | 1       | 23      |         |
| 13 |         | 23      | 1       |
| 14 |         | 1       | 23      |
| 15 | 1       |         | 23      |
------------------------------------
| 16 | 13      | 2       |         | 13 in one group
| 17 | 13      |         | 2       |
| 18 | 2       | 13      |         |
| 19 |         | 13      | 2       |
| 20 |         | 2       | 13      |
| 21 | 2       |         | 13      |
------------------------------------
| 22 | 1       | 2       | 3       | All digits/items in different groups
| 23 | 1       | 3       | 2       |
| 24 | 2       | 1       | 3       |
| 25 | 2       | 3       | 1       |
| 26 | 3       | 1       | 2       |
| 27 | 3       | 2       | 1       |

I am particularly struggling to get what distributions that $24$ corresponds to.

  • In solution, I said:

    $2^3\times\binom{3}{1}=24$ ways to distribute $3$ items to $2$ groups such that $2$ groups can contain zero or more items (i.e., $1$ group is guaranteed to be empty).

But there are only $21$ distributions (first $21$ in above list) in which $1$ group is guaranteed to be empty.

Q1. Then why there is mismatch between $24$, which we get by formula, and $21$, which we get through example?

  • I understand this:

    $1^3\times \binom{3}{2}=3$ ways to distribute $3$ items to $1$ group such that $1$ group can contain zero or more items (i.e., $2$ groups are guaranteed to be empty)

    corresponds to first three groups.

  • Q2. Can someone explain this to me by telling which distributions correspond to different parts of classic inclusion and exclusion example of circles:

enter image description here

N. F. Taussig
  • 76,571
RajS
  • 1,317

3 Answers3

1

Your answer is correct. There are $3! = 6$ ways to distribute three different items to three different containers since there are three ways to choose which item goes in the first container, two ways to choose which of the two remaining items goes in the second container, and one way to place the only remaining item in the third container.

Then why there is mismatch between $24$, which we get by formula, and $21$, which we get through example?

A container is left empty: There are $\binom{3}{1}$ ways to exclude one of the containers from receiving an item. The three items can be distributed to the remaining two containers in $2^3$ ways. Hence, the number of such distributions is $$\binom{3}{1}2^3$$ However, as you noted, the two containers that can receive the three items may contain zero or more items. In particular, one of those two containers may be left empty. Hence, among these $24$ cases are the three cases in which two of the three containers are left empty. The other $21$ cases are those in which exactly one container is left empty.

The reason we need to add those cases in which two containers are left empty to the number obtained by subtracting those cases in which a container is left empty from the total number of distributions is that we have subtracted those cases in which two containers are left empty twice, once for each way we could designate one of the two empty containers as the one that is to be left empty. We only want to subtract such cases once, so we must add them back.

Can someone explain this to me by explaining which distributions correspond to different parts of the Venn diagram?

Let $A$ be the set of distributions in which no items are placed in the first container.

Let $B$ be the set of distributions in which no items are placed in the second container.

Let $C$ be the set of distributions in which no items are placed in the third container.

Then $A \cup B \cup C$ is the set of distributions in which at least one container is left empty.

We wish to count $(A \cup B \cup C)^C = A^C \cap B^C \cap C^C$, which is found by subtracting $|A \cup B \cup C|$ from the $3^3 = 27$ ways to distribute three distinguishable items to three distinguishable containers.

By the Inclusion-Exclusion Principle, $$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|$$

$|A|$: If the first container is left empty, then the three items must be distributed to the remaining two containers, which can be done in $2^3$ ways. By symmetry, $$|A| = |B| = |C| = 2^3$$

$|A \cap B|$: If both the first and second containers are left empty, then the three items must be placed in the remaining container, which can be done in $1^3 = 1$ way. By symmetry, $$|A \cap B| = |A \cap C| = |B \cap C| = 1$$

$|A \cap B \cap C|$: It is not possible to leave all three containers empty since there would be nowhere to place the items. Hence, $$|A \cap B \cap C| = 0$$

Thus, the number of distributions in which at least one container is left empty is \begin{align*} |A \cup B \cup C| & = 8 + 8 + 8 - 1 - 1 - 1 + 0\\ & = 3 \cdot 2^3 - 3 \cdot 1^3 + 3 \cdot 0^3\\ & = \binom{3}{1}2^3 - \binom{3}{2}1^3 + \binom{3}{3}0^3\\ & = 21 \end{align*} Hence, the number of distributions in which no containers are left empty $$|A^C \cap B^C \cap C^C| = 3^3 - \binom{3}{1}2^3 + \binom{3}{2}1^3 - \binom{3}{3}0^3 = 6$$

Elliot Yu
  • 2,311
N. F. Taussig
  • 76,571
  • I wrote a question a bit similar to this one, can you check it out?: https://math.stackexchange.com/questions/4481749/probability-of-getting-k-different-colored-balls-from-an-urn-with-k-different-co – Quantum Guy 123 Jun 28 '22 at 18:39
1

Trying to N.F. Taussing's beautiful answer in more systematic manner to help newbies like me to understand.

  • $A=$ Number of distributions in which group 1 is empty $ =8$ (Rows 2,3,7,8,13,14,19,20)
  • $B=$ Number of distributions in which group 2 is empty $ =8$ (Rows 1,3,5,9,11,15,17,21,20)
  • $C=$ Number of distributions in which group 3 is empty $ =8$ (Rows 1,2,4,6,10,12,16,18)
  • $A\cap B= $ Number of distributions in which both group 1 and group 2 are empty $ =1$ (Rows 3)
  • $B\cap C= $ Number of distributions in which both group 2 and group 3 are empty $ =1$ (Rows 1)
  • $A\cap C= $ Number of distributions in which both group 1 and group 3 are empty $ =1$ (Rows 2)
  • $A\cap B\cap C= $ Number of distributions in which all groups are empty $ =0$
  • $A\cup B\cup C$
    • $=$ The number of distributions in which at least one group is empty. So this equals to first 21 rows, as each of these rows have at least one group empty and last six rows have no group empty.
    • $=$ We can find this count using inclusion exclusion principle as follows:
      $A\cup B\cup C$
      $=\underbrace{(A)+ (B)+ (C)}_{ ^3C_1\times 2^3}-\underbrace{(A\cap B)-(A\cap C) - (B\cap C)}_{ ^3C_2\times 1^3} + \underbrace{(A\cap B\cap C)}_{ ^3C3\times 0^3}$
      $=8+8+8-1-1-1+0=21$
    • Note that here first three 8s corresponds to rows listed in first three bullet points for $A,B$ and $C$. Then note that these bullet points contain rows $1, 2$ and $3$ twice. Thus we have to subtract one for each of these repeated rows. This is what exactly done by $-\underbrace{(A\cap B)}_{\text{row 3}}-\underbrace{(A\cap C)}_{\text{row 2}} - \underbrace{(B\cap C)}_{\text{row 1}}$.
  • $U=$ Number of ways to distribute 3 distinguishable items to three distinguishable groups $=3^3=27$
  • $A^c = $ Number of distributions in which group 1 is not left empty
  • $B^c = $ Number of distributions in which group 2 is not left empty
  • $C^c = $ Number of distributions in which group 3 is not left empty
  • $A^c\cap B^c \cap C^c = $ Number of distributions in which all groups are non empty, which is what we want to find here. This turns out to be
    $= U-(A\cup B\cup C) $
    $=U -((A)+ (B)+ (C)-(A\cap B)-(A\cap C) - (B\cap C)+ (A\cap B\cap C))$ $= 3^3-(3C_1\times 2^3- ^3C_2\times 1^3 + ^3C_3\times 0^3)$
    $= 3^3-3C_1\times 2^3 + ^3C_2\times 1^3 - ^3C_3\times 0^3$
    $= 27-24+3-0$
    $=6$
RajS
  • 1,317
0

There are eight arrangements missing "group 1", viz., rows 2, 3, 7, 8, 13, 14, 19, 20. (region A)

There are eight arrangements missing "group 2", viz., rows 1, 3, 5, 9, 11, 15, 17, 21. (region B)

There is one arrangement missing both group 1 and group 2, viz row 3 (region $A\cap B$) etc.

Region $A\cap B\cap C$ is empty, and of course, one is counting the arrangements outside $A\cup B\cup C$. The final answer is $27-8-8-8+1+1+1-0$.

Angina Seng
  • 158,341