A locker code consists of five digits, for example 04391, 23335, 05531... David wants to set his locker code so that digit 5 is not immediately followed by the digit 9. How many such codes are possible?
A. 96,000
B. 96,001
C. 96,002
D. 96,003
E. 96,004
Solution:Without any condition, the total cases are:
1st , 2nd, 3rd, 4th and 5th digits can each take 10 cases : so total 10,000 cases
now, lets look at the restriction
5 9_ _ _ : No of cases for this condition is 10 X 10 X 10 = 1000
but four such cases are possible : 5 9_ _ _, _ 5 9_ _ , _ _ 5 9_ , and _ _ _ 5 9
So subtract 4 * 1000 from 10,000 cases
Answer = 96,000
Option A is the correct answerPosted from my mobile device