5. a) How many six-digit numbers can be written using the digits 1, 2, 3, 4, and 5, where not every digit has to be used?

b) How many six-digit numbers can be written using the digits 1, 2, 3, 4, and 5, such that each digit is used at least once?

Each task is scored out of 10 points.

The use of a pocket calculator or any reference materials is not allowed.
First method:

a) For each of the five digits, we have five possibilities.

Therefore, we have $5 \cdot 5 \cdot 5 \cdot 5 \cdot 5 \cdot 5=5^{6}=15625$ such numbers.

b) For each digit to be used at least once, one digit must be used twice, and all others once.

We have 5 possibilities for this - the digit that appears twice can be 1, 2, 3, 4, or 5.

1 POINT

For the chosen set of digits (e.g., 1, 1, 2, 3, 4, 5), we can choose the positions for the digit that appears twice in $\frac{6 \cdot 5}{2}$ ways.

After that, the remaining digits can be arranged in $4 \cdot 3 \cdot 2$ ways.

This can be done in a total of $\frac{6 \cdot 5}{2} \cdot 4 \cdot 3 \cdot 2=360$ ways. 4 POINTS We have 5 possibilities for choosing the digit that appears twice, so in total we have $5 \cdot 360=1800$ such numbers.