If all the letters of the word AGAIN are arranged in dictionary order, find the 43rd and 54th words.
Open in App
Solution
Words starting with A will have {'A', 'G', 'I', 'N'} as its last four characters. So, there can be any permutation of these characters. So, no. of words starting with A = 4! = 24.
Now, words starting with G will have {'A', 'A', 'I', 'N'} as its last four characters. So, there can be any permutation of these characters. So, no. of words starting with G = 4!/2! (since 'A' is repeated twice) = 12.
Similarly, words starting with I will also have 12 possible words.
Now that count = 24+12+12 = 48>43. So, first character is 'I'.
Now, if second character is 'A', then last three characters are from {'A', 'G', 'N'}. So, there are 3! possible words starting with 'IA'. So, count = 24 + 12 + 6 = 42.
Now, the next most word is the required word. So, after 'A', the letter 'I' can be followed by 'G'. So, starting two characters are 'IG'.
Now, sorting the remaining characters in ascending order, we get the required word = 'IGAAN'
53rd (explanation is given above) In the above problem we found that starting with I is totally 48 Now starting with N is 48+12=60 We want 54th So starting with NA Then 3! = 6 48+6=54th So NAIGA....