A passenger left his belongings inside a locker at an airport. When he wanted to get his belongings, it turned out that he forgot the number. He only remembers that it has numbers $23$ and $37$ in it. In order to open the locker, he needs to enter a $5$-digit number. What is the minimal number of numbers that he will need to try to be able to open the locker?
So, we have $2$ cases:
- $a = 23, b = 37, c \in \{0,...,9\}$, this gives us $1\times 1\times 10\times 3!=60$ ways.
- $a = 237, b \in \{0,...,9\}, c \in \{0,...,9\}$, this gives us $1\times 10\times 10\times 3!=600$ ways. And the final answer is $660$. But the author says it's $360$, are they wrong, or am I wrong? (The book has mistakes in the answer section...)
Since your way of thinking the problem as two cases is correct, I will give a hint:
HINT: Notice that in your first case, you have counted the case $c = 7$ and the pass-code can be $abc$, that is $23737$, which is also counted in your second case.
Also, in your second case, for $b = 3$, $c = 7$, there are some cases like $abc = 23737$, $bca = 37237$, which are already counted in the first part.
There might be some similar overcounted cases so can you revise your calculations now?