To solve this problem, we need to determine the total number of ways to:
- Distribute 400 distinguishable packages into 4 wagons (A, B, C, D) such that no wagon is empty.
- Assign 7 loaders (O₁, O₂, ..., O₇) to the 4 wagons, with each wagon getting exactly one loader, and 3 loaders remaining unused.
Step 1: Distributing Packages to Wagons
Since the packages are distinguishable and the wagons are distinguishable, and each wagon must receive at least one package, we're dealing with the problem of counting the number of onto functions from a set of 400 elements to a set of 4 elements.
The total number of functions from the set of packages to the set of wagons is (4^{400}) (since each package can go into any of the 4 wagons). However, this includes scenarios where one or more wagons are empty, which we need to exclude.
We use the Inclusion-Exclusion Principle to count the number of functions where all wagons are used (i.e., no wagon is empty).
Let:
- (N_T =) Total number of functions (= 4^{400}).
- (N_1 =) Number of functions where at least one wagon is empty.
Our goal is to find (N = N_T - N_1), the number of functions where no wagons are empty.
Calculating (N_1):
First, we find the number of functions where one or more wagons are empty.
- Functions where one specific wagon is empty: For any one wagon (e.g., wagon A), the number of functions where it is empty is (3^{400}) (since packages can only go into the other 3 wagons). There are 4 such wagons, so the total is (4 \times 3^{400}).
- Functions where two specific wagons are empty: For any two wagons (e.g., wagons A and B), the number is (2^{400}). There are (\binom{4}{2} = 6) such pairs, so the total is (6 \times 2^{400}).
- Functions where three specific wagons are empty: For any three wagons (e.g., wagons A, B, and C), the number is (1^{400} = 1). There are (\binom{4}{3} = 4) such triplets, so the total is (4 \times 1 = 4).
- Functions where all four wagons are empty: This is impossible, so the number is 0.
Applying the Inclusion-Exclusion Principle:
[
\begin{align*}
N_1 &= \text{Total functions with at least one wagon empty} \
&= \left(4 \times 3^{400}\right) - \left(6 \times 2^{400}\right) + \left(4 \times 1\right) - 0 \
&= 4 \times 3^{400} - 6 \times 2^{400} + 4
\end{align*}
]
Calculating (N):
[
\begin{align*}
N &= N_T - N_1 \
&= 4^{400} - \left(4 \times 3^{400} - 6 \times 2^{400} + 4\right) \
&= 4^{400} - 4 \times 3^{400} + 6 \times 2^{400} - 4
\end{align*}
]
Step 2: Assigning Loaders to Wagons
We need to assign 4 loaders to the 4 wagons, with each wagon getting exactly one loader.
- Selecting 4 loaders out of 7: (\binom{7}{4} = 35) ways.
- Assigning the selected loaders to the 4 wagons: (4! = 24) ways.
Total loader assignments: (35 \times 24 = 840) ways.
Final Calculation:
The total number of ways to load the packages and assign the loaders is:
[
\begin{align*}
\text{Total ways} &= N \times \text{Total loader assignments} \
&= \left(4^{400} - 4 \times 3^{400} + 6 \times 2^{400} - 4\right) \times 840
\end{align*}
]
Answer:
An explicit expression: (4^400 – 4·3^400 + 6·2^400 – 4) × 840 ways to load the packages and assign loaders.