The letters of the word are permuted and all the permutations are arranged in an alphabetical order as in an English dictionary. The number of words that appear before is
Letters appearing in the word are
Words appearing before are of the form
where X is one of the letters and the four remaining
places can be filled by the remaining four letters.
Thus, the number of words before