# 2002 AIME II Problems/Problem 1

## Problem

Given that

$\begin{eqnarray*}&(1)& \text{x and y are both integers between 100 and 999, inclusive;}\qquad \qquad \qquad \qquad \qquad \\  &(2)& \text{y is the number formed by reversing the digits of x; and}\\  &(3)& z=|x-y|. \end{eqnarray*}$ (Error compiling LaTeX. ! Missing \endgroup inserted.)

How many distinct values of $z$ are possible?

## Solution

We count the number of three-letter and three-digit palindromes, then subtract the number of license plates containing both types of palindrome.

There are $10^3\cdot 26^2$ letter palindromes, $10^2\cdot 26^3$ digit palindromes, and $10^2\cdot26^2$ palindromes that contain both letters and digits.

Since there are $10^3\cdot26^3$ possible plates, the probability desired is $\frac{10^2\cdot26^2(10+26-1)}{10^2\cdot26^2\cdot 260}=\frac{35}{260}=\frac{7}{52}$. Thus $m+n=059$.