To solve this problem, we need to compute the number of ways to:
- Assign loaders to wagons.
- Distribute the 400 distinguishable packages into the four wagons, ensuring all wagons are non-empty.
Step 1: Assigning Loaders to Wagons
- Selecting Loaders: We have 7 loaders, and we need to select 4 loaders to assign to the 4 wagons. The number of ways to choose 4 loaders from 7 is given by the combination formula:
[
\text{Number of ways} = C(7, 4) = \frac{7!}{4!(7-4)!} = 35
]
- Assigning Loaders to Wagons: Once we have selected the 4 loaders, we need to assign each to a specific wagon. Since the wagons are distinct (A, B, C, D) and the loaders are distinct, the number of ways to assign the loaders to wagons is (4! = 24).
- Total Ways to Assign Loaders:
[
\text{Total loader assignments} = 35 \times 24 = 840
]
Step 2: Distributing Packages into Wagons
We need to distribute 400 distinguishable packages into 4 distinguishable wagons, ensuring that no wagon is empty.
- Total Ways Without Restrictions: Without any restrictions, each package can go into any of the 4 wagons, so the total number of ways is (4^{400}).
- Subtracting Invalid Distributions: We need to exclude distributions where one or more wagons are empty. We'll use the Inclusion-Exclusion Principle.
Let:
- (N) be the total number of ways to distribute the packages without restrictions.
- (N_A) be the number of ways where Wagon A is empty ((3^{400}) ways, since each package can go into Wagons B, C, or D).
- Similarly for (N_B, N_C, N_D).
- (N_{AB}) be the number of ways where Wagons A and B are empty ((2^{400}) ways).
- (N_{ABC}) be the number of ways where Wagons A, B, and C are empty ((1^{400} = 1) way).
Applying the Inclusion-Exclusion Principle:
[
\begin{align*}
\text{Number of ways where at least one wagon is empty} &= \left[ C(4,1) \times 3^{400} \right] - \left[ C(4,2) \times 2^{400} \right] + \left[ C(4,3) \times 1^{400} \right] \
&= \left[ 4 \times 3^{400} \right] - \left[ 6 \times 2^{400} \right] + \left[ 4 \times 1 \right]
\end{align*}
]
- Total Valid Distributions:
[
\begin{align*}
\text{Valid distributions} &= N - \text{(Number of invalid distributions)} \
&= 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 3: Calculating the Total Number of Ways
Multiply the number of loader assignments by the number of valid package distributions:
[
\text{Total ways} = 840 \times \left( 4^{400} - 4 \times 3^{400} + 6 \times 2^{400} - 4 \right)
]
Final Answer:
[
\boxed{840,\times,\left(4^{400}\ -\ 4\times3^{400}\ +\ 6\times2^{400}\ -\ 4,\right)}
]
An explicit expression:
840 × [4⁴⁰⁰ − 4·3⁴⁰⁰ + 6·2⁴⁰⁰ − 4]; that is,
number of ways = 840 × [4^400 − 4·3^400 + 6·2^400 − 4]