.
This problem has FANTASTICALLY beautiful solution.
Consider the linear expression X + Y + Z + W of four variables X, Y, Z and W, and consider its 8-th degree .
If you FOIL this expression and collect like terms, you will get the sum
= . (1)
consisting of monoms with integer coefficients C(i,j,k,m) that depend on the sets of non-negative integer indexes (i, j, k, m).
The sum (1) is spread (is distributed) over all such sets of non-negative integer indexes that i+j+k+m = 8.
We can interpret each monom (or each set (i,j,k,n) ) as a distribution sample of 8 teachers (= 8 objects)
i teachers in the school X;
j teachers in the school Y;
k teachers in the school Z and
m teachers in the school W
among 4 school (=4 boxes). Doing in this way, we do not personalize the teachers - we distinct and consider only "signatures" (i,j,k,n),
attaching and connecting them to school X, Y, Z and W.
But if we personalize the teachers, we will get the coefficients C(i,j,k,m) showing HOW MANY personalized combinations of teachers
we will have for each given signature (i,j,k,m).
So, each given coefficient C(i,j,k,m) shows how many personalized combinations are there for each given numerical signature (i,j,k,m).
But in this problem we are not interested in knowing each and every coefficient C(i,j,k,m) individually and separately -
we are interested only to know the sum of all coefficients C(i,j,k,m).
The last observation is that this sum is nothing else as the value of at X= 1, Y= 1, Z=1 and W= 1.
Thus the sum of all coefficients
= = .
And it gives the ANSWER to the problem's question:
There are ways to distribute 8 teachers among 4 school.
Solved, completed, answered and explained.
-------------
For more general problem
In how many ways N distinguishable objects can be distributed among n different boxes
the solution and the answer are similar: in ways.
This problem is, obviously, far above the average school level.
It is typical problem of the Math Circle level at a respectful university.