How many 8-digit numbers can be formed

a) using the digits $0,1,2$?

b) using the digits $0,0,0,1,2,2,2,2$? How many of the latter start with 1?
a) Since the order of the digits is also important, we are dealing with 8th class repetitive variations from 3 elements, which is denoted as $V_{3}^{\text {i,8}}$. However, groups starting with 'a' cannot form an 8-digit number. The number of such groups is the same as the number of 7th class repetitive variations that can be formed from 3 elements, i.e., $V_{3}^{i, 7}$. Therefore, the number of 8-digit numbers that can be formed is $V_{3}^{i, 8} - V_{3}^{i, 7} = 3^{8} - 3^{7} = 3^{7}(3-1) = 2187 \cdot 2 = 4374$.

b) Here we are dealing with permutations of 8 elements, among which 3 and 4 are identical. Therefore, the total number of groups is $P_{8}^{8,4}$. From this number, we need to subtract the number of groups that start with 0. The number of such groups is clearly the same as the number of permutations that can be formed from the elements $0,0,1,2,2,2,2$, which is $P_{7}^{2,4}$. Therefore, the number of 8-digit numbers that can be formed is

$$
P_{8}^{8,4} - P_{7}^{2,4} = \frac{8!}{3!4!} - \frac{7!}{2!4!} = \frac{5 \cdot 6 \cdot 7 \cdot 8}{1 \cdot 2 \cdot 3} - \frac{5 \cdot 6 \cdot 7}{1 \cdot 2} = 280 - 105 = 175
$$

Among these, the number that starts with 1 is the same as the number of permutations that can be formed from the elements $0,0,0,2,2,2,2$, which is $P_{7}^{3,4} = \frac{7!}{3!4!} = \frac{5 \cdot 6 \cdot 7}{1 \cdot 2 \cdot 3} = 35$