Constraints: Digit 5
is not immediately followed by digit 9
Now, using the given constraints, let’s see how many locker codes are possible in which 5 IS immediately followed by 9. Once we calculate the total number of all such locker codes, we will subtract it from total 5-digit locker code to get our answer i.e.
#codes (
5 not immediately followed by
9) =
# total 5-digit codes -
#codes (
5 IS immediately followed by
9) –
(1)
Note that since we are talking about locker codes,
even 0 can take the ten thousand’s place. Therefore,
Total 5-digits codes possible = 10*10*10*10*10 =
10^5Scenarios (5 IS immediately followed by 9):
Case 1:
59xxxHere each of the position ‘x’ can be filled with 10 digits. Therefore,
Total 59xxx cases = 10*10*10 =
1000Note – These 1000 cases will also include these two sub-cases:
5959x and
59x59 ---- (i)
Case 2:
x59xxHere each of the position ‘x’ can be filled with 10 digits. Therefore,
Total x59xx cases = 10*10*10 =
1000Note – These 1000 cases will also include:
x5959 --- (ii)
Case 3:
xx59xHere each of the position ‘x’ can be filled with 10 digits. Therefore,
Total xx59x cases = 10*10*10 =
1000Note – These 1000 cases will also include:
5959x --- (iii)
Case 4:
xxx59Here each of the position ‘x’ can be filled with 10 digits. Therefore,
Total xxx59 cases = 10*10*10 =
1000Note – These 1000 cases will also include these two sub-cases:
x5959 and
59x59 ----- (iv)
Observe the highlighted cases in (i), (ii), (iii), (iv), of the 6-sub-cases, three are same as other others. So, in total there are 3 sub-cases.
# codes (
5 IS
immediately followed by
9) = (1000 + 1000 + 1000 + 1000) – 3 sub-cases counted twice
=
4000 - 3
Therefore, from equation (1), we get,
#codes (5 not immediately followed by 9) = 100,000 – [4000 – 3]
=
96,003Option D (correct)Posted from my mobile device