The digit sum of a positive integer is the sum of all its digits. For example, the digit sum of the integer \(2345\) is \(2+3+4+5=14\).
Ayumi announced that her favourite number is a three-digit positive integer with a digit sum of \(9\). Vinnie then wrote down a three-digit positive integer with a digit sum of \(9\). What is the probability that the number Vinnie wrote was Ayumi’s favourite number?
There are twelve triples of digits that sum to \(9\). These are: \((9,0,0)\), \((8,1,0)\), \((7,2,0)\), \((7,1,1)\), \((6,3,0)\), \((6,2,1)\), \((5,4,0)\), \((5,3,1)\), \((5,2,2)\), \((4,4,1)\), \((4,3,2)\), and \((3,3,3)\).
We will count the number of three-digit positive integers whose digit sum is \(9\) by counting the number of positive integers formed by the digits in each triple above. We will consider cases based on the number of zeroes in each triple, since a three-digit integer cannot have a leading digit of \(0\).
Case 1: Two zeroes
The only triple with two zeros is \((9,0,0)\). Since the first digit of the
three-digit integer cannot be zero, the only possible three-digit
integer is \(900\). Thus, there is only
\(1\) possible three-digit integer with
two zeroes.
Case 2: One zero
The triples with one zero are \((8,1,0)\), \((7,2,0)\), \((6,3,0)\), and \((5,4,0)\). Consider \((8,1,0)\). Since the zero cannot be in the
first position, there are four integers that can be formed with these
three digits: \(810\), \(801\), \(180\), and \(108\). Since this is true for any of the
four triples in this case, there are \(4\times
4=16\) possible three-digit integers with one zero.
Case 3: No zeroes
In this case, we will further separate the triples based on the number of repeated digits.
Case 3a: Three repeated digits
The only triple with three repeated digits is \((3,3,3)\) and the only integer formed by these digits is \(333\). Thus, there is only \(1\) possible three-digit integer in this case.
Case 3b: Two repeated digits
The triples with two repeated digits are \((7,1,1)\), \((5,2,2)\), and \((4,4,1)\). Consider \((7,1,1)\). There are three integers that can be formed by these three digits: \(711\), \(171\), and \(117\). Since this is true for any of the three triples in this case, there are \(3 \times 3=9\) possible three-digit integers in this case.
Case 3c: No repeated digits
The triples are \((6,2,1)\), \((5,3,1)\), and \((4,3,2)\). Consider \((6,2,1)\). There are six integers that can be formed by these three digits: \(621\), \(612\), \(261\), \(216\), \(162\), and \(126\). Since this is true for any of the three triples in this case, there are \(3 \times 6=18\) possible three-digit integers in this case.
Therefore, there are \(1+ 9 + 18 = 28\) possible three-digit integers with no zeroes.
Therefore, the total number of three-digit positive integers that have a digit sum of \(9\) is \(1+ 16 + 28 = 45\). Since Vinnie wrote down only one of these integers, the probability that this integer was Ayumi’s favourite number is \(\frac{1}{45}\).
Note: It is a known fact that an integer is divisible by \(9\) exactly when its digit sum is divisible by \(9\). For example, \(32\,814\) has a digit sum of \(3+2+8+1+4=18\). Since \(18\) is divisible by \(9\), then \(32\,814\) is divisible by \(9\). On the other hand, \(32\,810\) has a digit sum of \(3+2+8+1+0=14\). Since \(14\) is not divisible by \(9\), then \(32\,810\) is not divisible by \(9\).
As a consequence of this fact, Ayumi’s favourite number must be divisible by \(9\).