The Art of Lexicographical Counting
A Journey Through 'GTWENTY'
Welcome, fellow traveler of the JEE journey! Today, we are not just solving a problem; we are stepping into the shoes of a librarian organizing a very specific, very mathematical library.
Our task is to find the dictionary rank of the word 'GTWENTY'. This is a classic combinatorics problem that tests your ability to be systematic, patient, and precise. Let us break this down into a beautiful, logical sequence.
Phase 1
The Alphabetical Foundation
Before we can count, we must organize. Imagine all the letters of 'GTWENTY' scattered on your desk: G, T, W, E, N, T, Y.
To build a dictionary, we need order. Let us sort them alphabetically: E, G, N, T, T, W, Y.
Notice something crucial? The letter 'T' appears twice. This is the 'ghost in the machine'—the repetition that we must account for in every single calculation. If we ignore it, our count will be wrong.
Phase 2
The Systematic Pruning
We want to find the rank of 'GTWENTY'. This means we need to count every single word that comes before it by fixing letters one by one, starting from the first position.
First, consider words starting with 'E'. If we fix 'E' in the first position, we have 6 slots remaining for the letters G, N, T, T, W, Y.
The number of such words is:
These 360 words all come before any word starting with 'G'.
Phase 3
The 'G' Branch
Now, we move to the first letter of our target word: 'G'. We fix 'G' in the first position and look at the second position. The dictionary will list words starting with 'GE', then 'GN', then 'GT'.
We need to count all words starting with 'GE' and 'GN'. For 'GE', we fix 'G' and 'E'. We have 5 letters left: N, T, T, W, Y.
The number of words is:
Similarly, for 'GN', we fix 'G' and 'N'. We have 5 letters left: E, T, T, W, Y. Again, the number of words is:
So, we have 60+60=120 words starting with 'GE' or 'GN'.
Phase 4
The 'GT' Branch
Now we reach the 'GT' block. Our target word is 'GTWENTY', so we fix 'G' and 'T'. We look at the third position, where the dictionary will list 'GTE', 'GTN', 'GTT', and finally 'GTW'.
We must count all words starting with 'GTE', 'GTN', and 'GTT'. For 'GTE', we fix 'G', 'T', 'E'. We have 4 letters left: N, T, W, Y. These are all distinct!
The number of words is 4!=24. For 'GTN', we fix 'G', 'T', 'N', leaving 4 letters: E, T, W, Y. Again, 4!=24.
For 'GTT', we fix 'G', 'T', 'T', leaving 4 letters: E, N, W, Y. Again, 4!=24. Summing these up, we have 24+24+24=72 words.
Phase 5
The Final Step
We are almost there! We have accounted for all words starting with 'E', 'GE', 'GN', 'GTE', 'GTN', and 'GTT'.
The very next word in the dictionary is 'GTWENTY' itself. This contributes exactly 1 to our rank.
Now, let us add it all up:
And there you have it! The rank of 'GTWENTY' is 553. This process is the essence of combinatorics: breaking a complex problem into smaller, manageable, and logical steps.