Army Formation 25D173
1. **Problem statement:**
We have 20 crews and 3 classes: Warrior, Archer, Mage.
(a) How many different armies can be formed?
(b) Given limited weapons: 19 swords, 19 bows, 19 potions, and each class requires a specific weapon.
(i) How many different armies can be formed under this weapon limitation?
(ii) How many different armies can be formed if each team has at least one Mage under the weapon limitation?
---
2. **Formulas and rules:**
- Each crew can be assigned to one of 3 classes.
- Total number of armies without restriction is the number of ways to assign 3 classes to 20 crews: $3^{20}$.
- Under weapon limits, the number of Warriors, Archers, and Mages cannot exceed 19 each.
- The number of armies corresponds to the number of integer solutions $(w,a,m)$ to $w+a+m=20$ with $0 \leq w,a,m \leq 19$, multiplied by the multinomial coefficient $\frac{20!}{w!a!m!}$.
- For (ii), at least one Mage means $m \geq 1$.
---
3. **Step (a):**
Number of different armies without restriction:
$$
3^{20}
$$
This is because each of the 20 crews independently chooses one of 3 classes.
---
4. **Step (b)(i):**
We must count the number of integer triples $(w,a,m)$ such that:
$$
w + a + m = 20
$$
with constraints:
$$
0 \leq w,a,m \leq 19
$$
Since the total is 20, the only forbidden case is when any of $w,a,m$ is 20 (which is impossible because sum is 20 and others would be zero).
So the only invalid cases are when one class has all 20 crews, which is not allowed because weapons are limited to 19.
Number of total solutions without constraints (nonnegative integers) is:
$$
\binom{20+3-1}{3-1} = \binom{22}{2} = 231
$$
Number of invalid solutions where one class is 20 and others 0 is 3 (all Warriors, all Archers, or all Mages).
So valid solutions count is:
$$
231 - 3 = 228
$$
For each valid $(w,a,m)$, the number of ways to assign classes is multinomial coefficient:
$$
\frac{20!}{w!a!m!}
$$
Therefore, total number of armies under weapon limits is:
$$
\sum_{w=0}^{19} \sum_{a=0}^{19} \sum_{m=0}^{19} \mathbf{1}_{w+a+m=20} \frac{20!}{w!a!m!}
$$
where $w,a,m \leq 19$ and $w+a+m=20$.
---
5. **Step (b)(ii):**
Add the condition that at least one Mage is required:
$$
m \geq 1
$$
So sum over $w,a,m$ with $w+a+m=20$, $0 \leq w,a \leq 19$, $1 \leq m \leq 19$.
Number of such solutions is total valid solutions (228) minus solutions with $m=0$:
When $m=0$, $w+a=20$ with $0 \leq w,a \leq 19$.
Number of solutions for $w+a=20$ with $w,a \leq 19$ is 0 because if $w=20$, $a=0$ or vice versa, both invalid due to weapon limit.
So solutions with $m=0$ are 0 valid solutions.
Hence, number of valid $(w,a,m)$ with $m \geq 1$ is 228 - 0 = 228.
Total number of armies is:
$$
\sum_{w=0}^{19} \sum_{a=0}^{19} \sum_{m=1}^{19} \mathbf{1}_{w+a+m=20} \frac{20!}{w!a!m!}
$$
---
**Final answers:**
(a) $3^{20} = 3486784401$
(b)(i) $\sum_{w=0}^{19} \sum_{a=0}^{19} \sum_{m=0}^{19} \mathbf{1}_{w+a+m=20} \frac{20!}{w!a!m!}$
(b)(ii) $\sum_{w=0}^{19} \sum_{a=0}^{19} \sum_{m=1}^{19} \mathbf{1}_{w+a+m=20} \frac{20!}{w!a!m!}$
These sums count the number of distinct armies under the given constraints.