Problem 7.4. Consider seven-digit natural numbers, in the decimal representation of which each of the digits $1,2,3,4,5,6,7$ appears exactly once.

(a) (1 point) How many of them have the digits from the first to the sixth in ascending order, and from the sixth to the seventh in descending order?

(b) (3 points) How many of them have the digits from the first to the fifth in ascending order, and from the fifth to the seventh in descending order?
Answer: (a) 6. (b) 15.

Solution. (a) From the condition, it follows that the sixth digit is the largest, so it is 7. The last digit can be any digit from 1 to 6, and this uniquely determines the entire number (since the first five digits must be in ascending order). Therefore, there are exactly 6 such seven-digit numbers.

(b) From the condition, it follows that the fifth digit is the largest, so it is 7. The last two digits can be two different digits from 1 to 6, and this uniquely determines the entire number (since the first four digits must be in ascending order). Also, the sixth digit must be greater than the seventh, so there are exactly 15 possible pairs of the last two digits:

$$
65,64,63,62,61,54,53,52,51,43,42,41,32,31,21
$$

Accordingly, there are also 15 such seven-digit numbers.

Remark. The number of pairs in part (b) is equal to the number of ways to choose two digits from a set of 6 digits, i.e., $\mathrm{C}_{6}^{2}=\frac{6 \cdot 5}{2}=15$.