# Difference between revisions of "1998 AHSME Problems/Problem 24"

## Problem

Call a $7$-digit telephone number $d_1d_2d_3-d_4d_5d_6d_7$ memorable if the prefix sequence $d_1d_2d_3$ is exactly the same as either of the sequences $d_4d_5d_6$ or $d_5d_6d_7$ (possibly both). Assuming that each $d_i$ can be any of the ten decimal digits $0,1,2, \ldots, 9$, the number of different memorable telephone numbers is

$\mathrm{(A)}\ 19,810 \qquad\mathrm{(B)}\ 19,910 \qquad\mathrm{(C)}\ 19,990 \qquad\mathrm{(D)}\ 20,000 \qquad\mathrm{(E)}\ 20,100$

## Solution A

In this problem, we only need to consider the digits $\overline{d_4d_5d_6d_7}$. Each possibility of $\overline{d_4d_5d_6d_7}$ gives $2$ possibilities for $\overline{d_1d_2d_3}$, which are $\overline{d_1d_2d_3}=\overline{d_4d_5d_6}$ and $\overline{d_1d_2d_3}=\overline{d_5d_6d_7}$ with the exception of the case of $d_4=d_5=d_6=d_7$, which only gives one sequence. After accounting for overcounting, the answer is $(10 \times 10 \times 10 \times 10) \times 2 - 10=19990 \Rightarrow \boxed{\mathrm{(C)}}$

## Solution B

Let $A$ represent the set of telephone numbers with $\overline{d_1d_2d_3} = \overline{d_4d_5d_6}$ (of which there are $1000$ possibilities for $\overline{d_1d_2d_3}$ and $10$ for $d_7$), and $B$ those such that $\overline{d_1d_2d_3} = \overline{d_5d_6d_7}$. Then $A \cap B$ (the telephone numbers that belong to both $A$ and $B$) is the set of telephone numbers such that $d_1 = d_2 = d_3 = d_4 = d_5 = d_6 = d_7$, of which there are $10$ possibilities. By the Principle of Inclusion-Exclusion,

$$|A \cup B| = |A| + |B| - |A \cap B| = 1000 \times 10 + 1000 \times 10 - 10 = 19990 \Rightarrow \mathrm{(C)}$$