Dictionary Ranking (TOMATO Subjective 50)

Problem: All the permutation of the letters \(a,b,c,d,e\) are written down and arranged in alphabetical order as in dictionary. Thus the arrangement \(abcde\) is in first position and \(abced\) is in second position. What is the position of the word \(debac\)?

Solution: According to the arrangement in a dictionary, number of words:

i) starting with \(a\) = 4!

ii) starting with \(b\) = 4!

iii) starting with \(c\) = 4!

iv) starting with \(da\) = 3!

v) starting with \(db\) = 3!

vi) starting with \(dc\) = 3!

vii) starting with \(dea\) = 2!

viii) starting with \(deba\) = 1!

The last case gives us the word itself. So the position of the word will be = \(3*4! + 3*3! + 2! +1\) = \(93\)

\(debac\) is in the \(93^{rd}\) position.

Leave a Reply

Your email address will not be published. Required fields are marked *