You have a combination padlock with four dials on it.
Each dial has the numbers 0 through 4 on them.
The lock can have as many 0s as dials, and is set to 0000 by default.
The lock does not allow you to use any number between 1 and 4
. . two or more times in the combination.
The following combinations are valid: 0123 1234 0103 0010 4031.
The following combinations are invalid: 0113 4014 0202 4444.
How many possible combinations are there?
There is 1 way:
The three 0's can be in any of positions.
The fourth number can be any of the other 4 numbers.
Hence, there are: 16 ways to have three 0's.
The two 0's can be in any of positions.
The two remaining positions can be filled in: ways.
Hence, there are: 72 ways to have two 0's.
The one 0 can be in any of positions.
The three remaining position can be filled in: ways.
Hence, there are: 96 ways to have one 0.
The four positions can be filled in: 24 ways.
Therefore, there are: . 209 possible combinations.