# Problem 4. (3 points)

Petya wrote the number 11234567 on the board, and then all the numbers obtained from it by rearranging the digits, in ascending order. What was the position of the number $46753211$?
Answer: 12240

## Solution:

The number of a number is the quantity of numbers that are listed no later than it. The numbers listed no later than 46753211 are:

(1) Numbers starting with 1. In this case, the remaining digits can be arranged in 7! = 5040 ways.

(2) Numbers starting with 2 or 3. For each variant of the first digit, the remaining digits can be arranged in $\frac{7!}{2}$ ways. In total, this results in another 5040 numbers.

(3) Numbers starting with 41. The remaining six digits can be arranged in 6! = 720 ways.

(4) Numbers starting with 42, 43, 45, and 46 (including our number, which is the last in the list of numbers starting with 46). The remaining six digits for each variant can be arranged in $\frac{6!}{2}$ ways.

In total, we get $5040 \cdot 2 + 720 + 360 \cdot 4 = 12240$.