3. Consider the equation $0 . a b c d+0 . e f g h=1$, where each letter stands for a digit from 1 to 8 inclusive.
(a) Suppose each letter stands for a different digit. Prove that there are no solutions.
(b) Suppose instead that digits may be repeated. How many solutions are there? (You may give your final answer as a product of prime numbers if you wish.)
Note that $(0 . a b c d, 0 . e f g h)$ and $(0 . e f g h, 0 . a b c d)$ are considered to be the same solution.
SolUTION
(a) By writing 1 as 1.0000 we can see that $d+h$ must end in a zero, and as both $d$ and $h$ are single digits less than or equal to 8 this means that $d+h=10$.
We must also have $c+g+1=10$, where the 1 is due to the carry from $d+h$.
Similarly, we must have $b+f+1=10$ and $a+e+1=10$.
To summarise, after simplification we have that $d+h=10, c+g=9, b+f=9$ and $a+e=9$.
The possibilities for pairs of digits which sum to 9 are $(1,8),(2,7),(3,6)$ and $(4,5)$.
No matter which three of these pairs we choose the two remaining integers (from the set 1 to 8) will also sum to 9 and so we cannot satisfy the equation $d+h=10$. This means that there are no solutions to the given equation, if the digits are to be different.
(b) The equations derived in part (a) still hold but we may now repeat a digit, which we know is necessary for finding solutions to the given equation.
The pair of digits $(d, h)$ must sum to 10 and so the possibilities are:
$$
(2,8),(3,7),(4,6),(5,5),(6,4),(7,3) \text { and }(8,2) \text {. }
$$

Each of the pairs of digits $(c, g),(b, f)$ and $(a, e)$ must sum to 9 and so the possibilities are:
$$
(1,8),(2,7),(3,6),(4,5),(5,4),(6,3),(7,2) \text { and }(8,1) \text {. }
$$

As listed above, for the pair $(d, h)$ there are 7 choices and for each of the pairs $(c, g),(b, f)$ and $(a, e)$ there are 8 choices. By the product rule for counting, we can choose four relevant pairs in $7 \times 8 \times 8 \times 8=7 \times 2^{9}=3584$ ways.

This is not the number of solutions to the given equation because we have overcounted by a factor of two. This is because in making a choice for each of the pairs listed above we have counted, for example, $0.1234+0.8766$ and $0.8766+0.1234$ as distinct solutions. The question tells us that these are not distinct solutions.
This means that the number of solutions to the given equation is $7 \times 2^{8}=1792$.