Codes with even digits
The question
Tomas's bike lock has three wheels, each with the digits 0 to 9. He has forgotten his code. He remembers that all three digits are even, and that they either get bigger from left to right or get smaller from left to right. What is the smallest number of codes he must try to be sure that he can open the lock?
Try it first, then show the answerHide the answer
Answer
(B) 20
Show me why · Step 1 of 6
-
What it means
All 3 digits of Tomas's code are even, so each one is 0, 2, 4, 6 or 8. From left to right they get bigger each time, like 2 4 8, or smaller each time, like 8 4 2.
-
The key idea
Do not hunt for the codes one by one. First choose which 3 digits are in the code. Once they are chosen, only 1 order gets bigger each time, smallest first, and only 1 order gets smaller, biggest first.
-
Choose the digits
A digit cannot come twice, as 2 2 4 does not get bigger each time. So a code uses 3 different even digits. There are 10 choices, in the table, and each choice gives 2 codes, 1 going up and 1 going down. So there are 10 × 2 = 20 codes.
-
Why 10 choices?
List each choice smallest first, so that none is missed. With 0 first there are 6, from 0 2 4 to 0 6 8. With 2 first there are 3, and with 4 first only 4 6 8. That makes 6 + 3 + 1 = 10.
-
The answer, and not the others
Tomas must try 20 codes to be sure, answer (B). Counting only the codes that get bigger gives 10, half of them. (A) 18 is not enough, as the 2 codes left out might be his. (C) 22, (D) 24 and (E) 26 are more than he needs, as there are only 20 codes.
-
Remember this
To count codes that must go up or down, choose the digits first. Each choice makes just 1 code going up and 1 going down.