Employees of a certain company are each to receive a unique 7-digit identification code consisting of the digits 0, 1, 2, 3, 4, 5, and 6 such that no digit is used more than once in any given code. In valid codes, the second digit in the code is exactly twice the first digit. How many valid codes are there?  Choose the correct choice from the following answers:  A) 42  B) 120  C) 210  D) 360  E) 840
One can use slot method to solve this.   7 digit identification code has 7 slots to fill.   For the first slot there are three possible options. (1,2 and 3 because first digit has to be half of second)   For the second slot there are three possible options. (2,4 and 6 because second digit has to be twice the second)   To fill the first two slots there are only three possible ways. Because if the ,   if the first is 1 the second has to be 2 (only 1 way)   if the first is 2 the second has to be 4 (only 1 way)   if the first is 3 the second has to be 6 (only 1 way) . So total ways to fill first two slots = 3ways   You are now left with 5 digits and 5 slots to fill, which can be filled in 5! ways i.e. 120 ways.   Total no: of valid codes will be therefore : 120 * 3= 
<gadget id="calculator">120 * 3</gadget>
<output>360</output>
360 ways.   Answer : 360
<result>D</result>
Employees of a certain company are each to receive a unique 7-digit identification code consisting of the digits 0, 1, 2, 3, 4, 5, and 6 such that no digit is used more than once in any given code. In valid codes, the second digit in the code is exactly twice the first digit. How many valid codes are there?