# Counting how many numbers have repeated digits

How many numbers are there in all from $6000$ to $6999$ (both $6000$ and $6999$ included) having at least one of their digits repeated ?

(a) $216$
(b) $356$
(c) $496$
(d) $504$

• What's P&C?${}{}{}$ – Omnomnomnom Aug 5 '14 at 17:36
• What does "repeated digits" mean? Would 6869 be not considered? – Ryan Aug 5 '14 at 17:41

Look first at the numbers that have all different digits: the first is a $6$, the second can be chosen from $0, \cdots ,9$ except for $6$, so from $9$ numbers, third from $8$ and fourth from $7$, which gives $9 \times 8 \times 7=504$. Subtract that from $6999-6000+1=1000$ and (c) is right.

Hint: try counting the numbers that don't have any of their digits repeated, and subtract those from the total. You should get answer (c).

we have $1000 - {}_9P_3 =1000 - 9 \times 8 \times 7 = 496$

• Calculate the number of unique-digit combinations, by choosing $3$ elements from the set $S=\{0,1,2,3,4,5,7,8,9\}$ which consists of $9$ elements, and then permuting them:

$$\binom{9}{3}\cdot3!=504$$

• Subtract the result from the total number of combinations:

$$1000-504=496$$