The Dictionary Journey
Decoding 'MOTHER'
Welcome, future engineer! Today, we are going to decode the secret language of dictionaries. Have you ever wondered how a dictionary knows exactly where to place a word? It is not magic; it is the beautiful, rigid logic of combinatorics.
We are going to find the rank of the word 'MOTHER'. Think of this as finding a specific coordinate in the vast, ordered space of all possible permutations of these six letters.
Phase 1
The Alphabetical Foundation
Before we can start counting, we must understand the rules of the game. The dictionary lists words in strict alphabetical order.
Our first step is to take the letters of 'MOTHER'—M,O,T,H,E,R—and arrange them in their alphabetical hierarchy: E,H,M,O,R,T. This is our map.
Every word we encounter in our search will be compared against this order. We have six empty slots to fill, and we are going to systematically count every word that comes before 'MOTHER'.
Phase 2
The Systematic Elimination
We start by looking at the first slot. If we fix E in the first position, we have 5 remaining letters to arrange in 5 slots.
Since 'MOTHER' starts with M, all 120 words starting with E come before ours. We add 120 to our tally.
Next is H. Again, fixing H in the first slot gives us 5!=120 words. These also come before 'MOTHER'.
Our tally is now 120+120=240. We are making progress!
Now, we reach M. This matches the first letter of 'MOTHER', so we lock M in the first slot. We move to the second slot. The alphabetical order of the remaining letters is E,H,O,R,T.
We need O for the second slot, but we must first count all words starting with ME and MH. For ME, we have 4 remaining slots, giving us 4!=24 words. For MH, we have another 4!=24 words.
Our tally is now 240+24+24=288.
Phase 3
The Final Stretch
We have reached MO. This matches the second letter of 'MOTHER', so we lock O in the second slot. Now we look at the third slot.
We need T, but alphabetically, we must pass E,H, and R first. For each of these three letters, we have 3 remaining slots, giving us:
Our tally is now 288+18=306.
Finally, we reach MOT. This matches the third letter of 'MOTHER', so we lock T in the third slot. Now for the fourth slot, we need H.
Alphabetically, the first available letter is E. Words starting with MOTE have 2 remaining slots, giving us 2!=2 words. Our tally is now 306+2=308.
We are almost there! The next letter for the fourth slot is H, which matches! We lock H. We have E and R left.
Alphabetically, E comes before R, so the very next word is 'MOTHER'. We add 1 for the word itself.
The final rank is 308+1=309.