## 8. Wooden Numbers

Little Marko is playing with numbers made of wood. He has two number 1s, seven number 2s, and one number 3. He wants to string them together one by one so that the numbers 1 and 3 are not adjacent. How many different ten-digit numbers can Marko get this way?

Result: $\quad \mathbf{2 2 4}$
## First Solution.

Text of the solution If the digit 3 is in the first position, the next one must be 2. The following 8 positions are filled with two 1s and the remaining 6 twos. It is sufficient to look at how many ways we can place 2 twos in 2 of the possible 8 positions. This can be done in $8 \cdot 7: 2=28$ ways.

If the digit 3 is in the second position, there must be one two before and one two after it. The remaining 5 twos and two ones need to be placed in the remaining 7 positions. It is sufficient to determine how many ways 2 ones can be placed in 2 of the possible 7 positions, which is $7 \cdot 6: 2=21$ ways.

If the digit 3 is in the 3rd, 4th, ..., 9th position, the number of ways will be the same.

If the digit 3 is in the last, 10th position, the number of ways is the same as when it is in the 1st position.

The total number of ways, therefore, is $2 \cdot 28 + 8 \cdot 21 = 56 + 168 = 224$.