SOLUTION: The access code for a car's security system consists of four digits. The first digit cannot be zero and the last digit must be even. How many different codes are available?

Algebra ->  Probability-and-statistics -> SOLUTION: The access code for a car's security system consists of four digits. The first digit cannot be zero and the last digit must be even. How many different codes are available?       Log On


   



Question 1041877: The access code for a car's security system consists of four digits. The first digit cannot be zero and the last digit must be even. How many different codes are available?
Answer by Edwin McCravy(20055) About Me  (Show Source):
You can put this solution on YOUR website!
You didn't specify whether the four digits must all be different
or not.  I'll do it both ways.

If some of the digits can be the same: 

choose the first digit 9 ways,   <-- {1,2,3,4,5,6,7,8,9}
choose the second digit 10 ways, <-- {0,1,2,3,4,5,6,7,8,9}
choose the third digit 10 ways,  <-- {0,1,2,3,4,5,6,7,8,9}
choose the fourth digit 5 ways,  <-- {0,2,4,6,8}

That's 9∙10∙10∙5 = 4500 ways, if some digits can be the same.  

------------------------------

If the digits must all be different, there are two cases.

Case 1.  0 comes last

choose the fourth digit 1 ways,   <-- {0}
choose the first digit 9 ways, <-- {1,2,3,4,5,6,7,8,9}
choose the second digit 8 ways, <-- not the same as 4th or 1st  
choose the third digit 7 ways,  <-- not the same as other three

That's 1∙9∙8∙7 = 504 ways for Case 1.

Case 2.  0 does not come last

choose the fourth digit 4 ways, <-- {2,4,6,8}
choose the first digit 8 ways, <-- not 0 and not the same as 4th
choose the second digit 8 ways, <-- not the same as 4th or 2nd
choose the third digit 7 ways, <-- not the same as 4th

That's 4∙8∙8∙7 = 1792

Total: 504+1792 = 2296 ways, if all digits must be different.

-------------------------------------

[THING TO OBSERVE:  ALWAYS CHOOSE THE MOST RESTRICTIVE THINGS
FIRST!!!]

Edwin