In a bank the account numbers are all 8 digit numbers, and
they all start with digit 2. So an account number can be represented as 2x1x2x3x4x5x6x7.
An account number is considered to be a ‘magic’ number if x1x2x3
is exactly same as x4x5x6 or x5x6x7
or both. xi can take values from 0 to 9, but 2 followed by
seven zeroes is not a valid account number. What is the maximum possible number
of customers having a ‘magic’ account number?
Solution:
Solution follows here:
2x1x2x3x4x5x6x7
Considering the case “x1x2x3
is exactly same as x4x5x6”:
x1x2x3= x4x5x6
= 000, x7 = 1 to 9 as ‘20000000’ is not valid => 9 possibilities
x1x2x3 = x4x5x6
= 001 to 999, x7 = 0 to 9 => 999*10 = 9990 possibilities
Considering the case “x1x2x3
is exactly same as x5x6x7”:
x1x2x3= x5x6x7
= 000, x4 = 1 to 9 as ‘20000000’ is not valid => 9 possibilities
x1x2x3 = x5x6x7
= 001 to 999, x4 = 0 to 9 => 999*10 = 9990 possibilities
Subtracting common possibilities in both of the
above cases:
x4x5x6 = x5x6x7
=> x4 = x5, x5 = x6, x6
= x7 => x4 = x5 = x6 = x7
=> excepting all zero case, the possibilities are
1111,2222,...,9999 => 9 possibilities
These 9 cases are repeated in both of the above cases, hence
we need to subtract ‘9’ from the sum of no. Of possibilities of both the cases
=> Answer = 9 + 9990 + 9 + 9990 – 9 = 19989
Answer (3)
No comments:
Post a Comment