Part of ALG-07 — Permutations & Combinations

Rank of a Word in Dictionary Order

by Notetube Official86 words4 views

To find the rank of a word among all permutations in alphabetical order: count all words that come before it. For each position, count how many letters smaller than the current letter could go there, multiply by the permutations of remaining positions. Example: rank of "CODE" — letters sorted: C,D,E,O. Words starting with letter < C: none. In position 2 with C fixed: letters < O from {D,E,O} = 2, each giving 2! words = 4. Continue for each position. Account for repeated letters using division.

Like these notes? Save your own copy and start studying with NoteTube's AI tools.

Sign up free to clone these notes