Matej told his friend Clare the following properties about his favourite number:
It is a positive seven-digit integer.
It contains each of the digits from \(1\) through \(7\) exactly once.
The first digit is not \(1\).
The second digit is not \(2\).
Clare then wrote down a number satisfying all these properties. What is the probability that the number Clare wrote was Matej’s favourite number?
Let \(abcdefg\) represent any seven-digit number where \(a\), \(b\), \(c\), \(d\), \(e\), \(f\), and \(g\) are different digits from \(1\) through \(7\).
Note that this solution uses factorial notation, as in \(4 \times 3 \times 2 \times 1 = 4!\). In general, if \(n\) is a positive integer, then \(n! = n \times (n-1) \times (n-2) \times \cdots \times 3 \times 2 \times 1\). We now proceed with two different approaches to solving the problem.
Solution 1
In this solution we determine the number of possible numbers that Clare could have written down directly. Thus, Clare’s number is of the form \(abcdefg\) where \(a \ne 1\) and \(b \ne 2\). We consider the following two cases:
Case 1: \(a=2\)
In this case, there are \(6\) choices for the digit \(b\), \(5\) choices for the digit \(c\), \(4\) choices for the digit \(d\), \(3\) choices for the digit \(e\), \(2\) choices for the digit \(f\), and \(1\) choice for the digit \(g\). Thus, there are \(6 \times 5 \times 4 \times 3 \times 2 \times 1 = 6!\) possibilities when \(a=2\).
Case 2: \(a \ne 2\)
In this case, there are \(5\) choices for the digit \(a\) (since we also have \(a \ne 1\)). Once digit \(a\) is chosen, there are \(5\) choices for the digit \(b\) (since we have \(b \ne 2\) and \(b\ne a\)), \(5\) choices for the digit \(c\), \(4\) choices for the digit \(d\), \(3\) choices for the digit \(e\), \(2\) choices for the digit \(f\), and \(1\) choice for the digit \(g\). Thus, there are \(5 \times 5 \times 5 \times 4 \times 3 \times 2 \times 1 = 25 \times 5!\) possibilities when \(a \ne 2\).
Thus, the total number of possible numbers Claire could have written down is \(6! + 25 \times 5! = 3720\). Since only one of these is Matej’s favourite number, the probability that the number Clare wrote was Matej’s favourite number is \(\frac{1}{3720}\).
Solution 2
In this solution we determine the number of possible numbers that Clare could have written down indirectly.
First, we determine the total number of numbers of the form \(abcdefg\) where \(a\), \(b\), \(c\), \(d\), \(e\), \(f\), and \(g\) are different digits from \(1\) through \(7\). There are \(7\) choices for the digit \(a\), \(6\) choices for the digit \(b\), \(5\) choices for the digit \(c\), \(4\) choices for the digit \(d\), \(3\) choices for the digit \(e\), \(2\) choices for the digit \(f\), and \(1\) choice for the digit \(g\). Thus, there are \(7 \times 6 \times 5 \times 4 \times 3 \times 2 \times 1 = 7!\) possibilities.
Next, we determine the number of possible seven-digit numbers of the form \(abcdefg\) where \(a = 1\) and/or \(b = 2\). We consider the following two cases:
Case 1: \(a=1\)
In this case, there are \(6\) choices for the digit \(b\), \(5\) choices for the digit \(c\), \(4\) choices for the digit \(d\), \(3\) choices for the digit \(e\), \(2\) choices for the digit \(f\), and \(1\) choice for the digit \(g\). Thus, there are \(6 \times 5 \times 4 \times 3 \times 2 \times 1 = 6!\) possibilities when \(a=1\).
Case 2: \(a \ne 1\) and \(b=2\)
In this case, there are \(5\) choices for the digit \(a\), \(5\) choices for the digit \(c\), \(4\) choices for the digit \(d\), \(3\) choices for the digit \(e\), \(2\) choices for the digit \(f\), and \(1\) choice for the digit \(g\). Thus, there are \(5 \times 5 \times 4 \times 3 \times 2 \times 1 = 5 \times 5!\) possibilities when \(a \ne 1\) and \(b=2\).
Thus, the total number of possible numbers Claire could have written down is \(7! - 6! - 5 \times 5! = 3720\). Since only one of these is Matej’s favourite number, the probability that the number Clare wrote was Matej’s favourite number is \(\frac{1}{3720}\).