Procedure
Counting the words before a given word in dictionary order
Algebra • Permutations and Combinations
Statement
When all arrangements of some letters are listed as in a dictionary, the words before the first word starting with a letter are exactly the words starting with a letter that comes before in the alphabet. Their number is the sum, over each such letter, of the arrangements of the letters left after it is put first.
How to use it
- 1Write the distinct letters in alphabetical order.
- 2For each letter before the given one, put it first and count the arrangements of the remaining letters, dividing by the factorials of any repeats that remain.
- 3Add these counts.
Worked example
The letters of BACCA are arranged as in a dictionary. How many words come before the first word starting with ?
Step-by-step
- 1Letters in order: A, B, C
Why: Words starting with A, then B, come before any word starting with C.
- 2Starting with A: arrange B, C, C, A:
Why: The C is repeated twice among the four letters left.
- 3Starting with B: arrange A, A, C, C:
- 4
Answer
Watch out
After a letter is put first, recount the repeats among the letters left: one copy of a doubled letter may have been used up.
Builds on
Also known as
rank of a word, dictionary order, lexicographic order, words before a word