The digits $0,1,2,3,4,5,6$ are randomly arranged. What is the probability that we get a seven-digit number divisible by four? (The number cannot start with zero.)





Translating the text as requested, while preserving the line breaks and format.
Solution. From the given 7 numbers, we can form a total of $7!=5040$ numbers with at most seven digits. Among these, the numbers divisible by 4 are those whose last two digits are: 04, 12, 16, 20, 24, 32, 36, 40, 52, 56, 60, 64. Let's count how many seven-digit numbers there are whose last two digits already contain the zero. The first of the remaining places can be filled with 5 different numbers, the second with 4 different numbers, and so on. This totals $5 \cdot 4 \cdot 3 \cdot 2 \cdot 1=5$!, and since we have 4 such endings, the total number of possibilities is $4 \cdot 5$!.

From the other numbers divisible by 4, we need to exclude those that start with 0. Now, the first place can be filled with 4 different numbers, the second place can also be filled with 4 different numbers (now we allow the zero as well), and the other places can be filled with 3, 2, 1 different numbers, respectively. This totals $4 \cdot 4 \cdot 3 \cdot 2 \cdot 1=4 \cdot 4$!. Since we have 8 such endings, the number of numbers that can be formed is 8$\cdot$4$\cdot$4!. Let's sum up all the favorable cases: $4 \cdot 5!+8 \cdot 4 \cdot 4!=480+768=1248$. Therefore, the probability we are looking for is:

$$
P=\frac{1248}{5040}=24.76 \approx 25 \%
$$