Analyzing the Setup
To find the rank of the word UDAYPUR, we first identify the unique letters and their frequencies. The letters are U,D,A,Y,P,U,R.
Arranging these letters in alphabetical order, we get: A,D,P,R,U,U,Y. Note that the letter U appears twice.
When calculating permutations, we must account for this repetition by dividing by 2! to avoid overcounting.
The 'Before U' Marathon
In a dictionary, words are ordered alphabetically. Any word starting with A,D,P, or R will appear before any word starting with U.
For each of these 4 starting letters, we have 6 remaining positions to fill. The number of ways to arrange the remaining letters is:
Since there are 4 such starting letters, the total number of words appearing before those starting with U is:
The 'U' Deep Dive
Now, we consider words starting with U. Since our target word UDAYPUR starts with U, we lock it in the first position.
We look for words starting with UA, as A is the only letter alphabetically preceding D. With U and A fixed, we have 5 letters remaining (D,P,R,U,Y).
The number of arrangements for these is 5!=120. Adding this to our previous total:
The Final Stretch
UDA...
Next, we fix U and D. The target word continues with A, so we look for words starting with UDA.
The remaining letters are P,R,U,Y. We must count words starting with UDAP,UDAR, and UDAU, as these precede UDAY.
For each of these 3 prefixes, we have 3!=6 arrangements. This adds:
Our running total is now 1560+18=1578.
The Last Few Steps
We have fixed UDAY. The next letter in our target is P. The remaining letters are P,R,U.
Alphabetically, P is the first choice, which matches our target. We fix UDAYP. Now we have R and U left.
The dictionary order for the remaining letters is R then U. Thus, the next word is UDAYPRU (rank 1579).
The word immediately following is UDAYPUR. Therefore, the rank of UDAYPUR is 1580.