[Math] How many ways can 8 teachers be distributed among $4 $ schools

combinatoricsprobability

There are several ways that the teachers can be divided amongst $4$ schools, namely here are the possible choices I came up with:

$1) 1 1 1 5$

$2) 1 1 2 4$

$3) 1 1 3 3$

$4) 1 2 2 3$

$5) 2 2 2 2$

now given the fact that say $2213$ is the same as $1 2 2 3$ it was omitted. With out repeats I believe these 5 are the only possibilities.

1)

${8 \choose 5} \times {3 \choose 1} \times {2 \choose 1} \times {1 \choose 1}$:

$\frac{8!}{5!3!} \times \frac{3!}{1!2!} \times \frac{2!}{1!1!} \times 1$

Which comes out to

$56 \times 3 \times 2 \times 1 = 336$

2)

${8 \choose 4} \times {4 \choose 2} \times {2 \choose 1} \times {1 \choose 1}$:

$\frac{8!}{4!4!} \times \frac{4!}{2!2!} \times \frac{2!}{1!1!} \times 1$

Which comes out to

$70 \times 6 \times 2 \times 1= 840$

3)

${8 \choose 3} \times {5 \choose 3} \times {2 \choose 1} \times {1 \choose 1}$

$\frac{8!}{3!5!} \times \frac{5!}{3!2!} \times \frac{2!}{1!1!} \times 1$

Which comes out to

$56 \times 10 \times \times 2 = 1,120$

4)

${8 \choose 3} \times {5 \choose 2} \times {3 \choose 2} \times {1 \choose 1}$

$\frac{8!}{3!5!} \times \frac{5!}{2!3!} \times \frac{3!}{2!1!} \times \frac{1!}{1!0!}$

Which comes out to:

If 8 new teachers are to be divided amongst 4 new schools how many divisions are possible?

$56 \times 10 \times 3 \times 1= 1,680$

5)

${8 \choose 2} \times {6 \choose 2} \times {4 \choose 2} \times {2 \choose 2}$

$\frac{8!}{2!6!} \times \frac{6!}{2!4!} \times \frac{4!}{2!2!} \times \frac{2!}{2!0!}$

Which comes out to:

$28 \times 15 \times 6 \times 1 = 2,520$

What am I missing?

Best Answer

With teachers and schools distinct and every school must have at least one teacher assigned to it, I would approach via inclusion-exclusion.

Let the schools be labeled $a,b,c,d$. Let the teachers be labeled $1,2,3,\dots,8$.

Let event $A$ be the event that school $a$ has no teachers assigned to it. Similarly $B,C,D$ are the events that school $b,c,d$ have no teachers assigned to them respectively.

Then $|A\cup B\cup C\cup D|$ is the set of ways to distribute the teachers which is "bad", yielding a school without a teacher in it.

$|A|$ (and similarly $|B|,|C|,|D|$) can be described as the functions from $\{1,2,3,\dots,8\}$ to $\{b,c,d\}$. From earlier example, we know that there are $3^8$ such functions.

$|A\cap B|$ (and similarly $|A\cap C|,|A\cap D|,\dots$) can be described as the functions from $\{1,2,\dots,8\}$ to $\{c,d\}$. From earlier example, we know that there are $2^8$ such functions.

Similarly, we calculate $|A\cap B\cap C|=1^8$ and $|A\cap B\cap C\cap D|=0^8$

Applying inclusion-exclusion then, we have $|A\cup B\cup C\cup D|=\binom{4}{1}3^8-\binom{4}{2}2^8+\binom{4}{3}1^8-\binom{4}{4}0^8=4\cdot 3^8-6\cdot 2^8+4=24712$

As those were the "bad" outcomes out of the $4^8$ total number of ways to distribute the teachers regardless, there are then $4^8-24712=40824$ good ways to distribute the teachers.


A shorter solution using more complicated formulae which take some time to learn appears in the chart I linked to in the comments above. We are able to describe this as trying to count the number of surjective functions from $\{1,2,\dots,8\}$ to $\{a,b,c,d\}$.

We can accomplish this by first counting how many ways there are to partition $\{1,2,\dots,8\}$ into $4$ nonempty subsets, and then choose how to label the subsets.

We can accomplish the first step in $\left\{\begin{array}{}8\\4\end{array}\right\}$ number of ways. (here $\left\{\begin{smallmatrix}n\\r\end{smallmatrix}\right\}$ represents the stirling number of the second kind $S(n,r)$). We can accomplish the second step in $4!$ number of ways, yielding a final total of $4!\cdot \left\{\begin{array}{}8\\4\end{array}\right\}=40824$ ways. (wolfram)