24) A thief has seen Marco lock his bicycle using a padlock with a 4-digit combination (each digit ranges from 0 to 9). He was not able to see the combination but found out that at least two consecutive digits are the same. What is the maximum number of combinations the thief will have to try to steal Marco's bicycle?
(A) 2160
(B) 2530
(C) 2710
(D) 3000
(E) none of the above.
24) The answer is (C)

To carefully count the combinations that the thief will have to try, proceed as follows.

Count the combinations of the type $x y w w$ with $x$, y, and $w$ all different. There are $10 \times 9 \times 8$ and there are as many of those of the type xyyw and those of the type $x x y w$. The combinations $x y y y$ are as many as the $x x x y$ and are $10 \times 9$; those of the type $x x y x$ and $x y x x$ are $90 \times 2=180$. Finally, the $x x y y$ are $10 \times 9$ (as many as the $x y y x$) and the $x x x x$ are 10. Therefore, the number of combinations is

$$
720 \times 3 + 90 \times 2 + 90 \times 2 + 90 \times 2 + 10 = 2710.
$$

## SECOND SOLUTION.

The possible combinations of a 4-digit lock are $10^{4}=10000$ (each digit has 10 possible choices). Those that do NOT have two consecutive digits are $10 \times 9 \times 9 \times 9=7290$ (the first digit can be anything, for all the others, the possibility that they are the same as the previous one must be excluded). Therefore, those that have at least two consecutive digits are $10000-7290=2710$.