kirtivardhan
Hi Harsh,
If we try to solve it by trial and error then for 5 letters it would be 5 single letters and AB,BC,CD,DE in alphabetical order.that makes the total as 9.Then how is the answer 5?
Hi
kirtivardhan,
Writing the letters in alphabetical order does not mean using only consecutive alphabets. For a two alphabet combination where the first alphabet is A, every other alphabet coming after A will have the code in in alphabetical order. So, AB, AC, AD and AE are in alphabetical order. Similarly for the first alphabet as B we will have BC, BD & BE in alphabetical order. Again, for C we would have CD & CE and for D we would have DE in alphabetical order.
You missed out on the combination of these alphabets. Another way to understand this is for the alphabet A, there are 4 other letters (i.e. B, C, D, E) which can follow A, so A will have 4 possible combinations in alphabetical order. For alphabet B, there are 3 letters (i.e. C, D, E) which can follow B, so B will have 3 possible combinations in alphabetical order. Similarly for C, we will have 2 possible combinations (i.e. D, E) and 1 possible combination (i.e. E) for D.
Total possible two alphabet combinations = 4 + 3 + 2 + 1 = 10
Total possible single alphabet combination = 5
Hence, total possible combinations i.e. distinct codes possible = 10 + 5 = 15 > 12.Try out this exercise for 4 letters and you will observe that the total distinct possible codes is less than 12.
Hope it's clear
Regards
Harsh