Here's a problem I've been trying to solve, but I can't reach the correct answer (39 minutes).

Before I can open my gym locker, I must remember the combination. Two of the numbers of this three-term sequence are 17 and 24, but I have forgotten the third, and do not know which is which. There are 40 possibilities for the third number. At ten seconds per try, at most how long will it take me to test every possibility?

My reasoning was: For each number out of 40 possibilities, the third number can be in one of the three positions, and the other numbers 17 and 24 can switch orders. So, the total cases are $40*3*2$. Each try is 10 secs, so the total time is $40*3*2*10$ seconds = 40 minutes. Why is my answer wrong? The correct answer is 39 minutes from the answer key.

  • 6
    $\begingroup$ Well, what if the $40$ possibilities include a repeat of $17$ or $24$? $\endgroup$
    – Macavity
    Jun 15, 2023 at 2:35

1 Answer 1


The error is double counting.

So, there are six possible cases for the numbers we do know ($17,24$) and their positions: the orders of

  • Case $1$: Combinations of the type $17 - 24 - X$
  • Case $2$: Combinations of the type $24 - 17 - X$
  • Case $3$: Combinations of the type $17 - X - 24$
  • Case $4$: Combinations of the type $24 - X - 17$
  • Case $5$: Combinations of the type $X - 17 - 24$
  • Case $6$: Combinations of the type $X - 24 - 17$

Assuming a typical lock that might have the possibilities of $X \in \{1,2,3,\cdots,40\}$, then a naive first guess would be your answer: $$ 6 \cdot 40 = 240 \text{ possible combos} $$ $6$ for the possible cases, and $40$ for the choices of the unknown $X$.

However, now consider: if $X=17$, then some cases are identical. $X=17$ would allow a Case $1$ combination ($17-24-17$) to also fall into Case $6$. Other overlaps exist between other pairs of cases, and for $X=24$ as well.

Remove these accordingly, and you should arrive at the correct answer.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .