How to Arrange Letters of a Word (Permutation)
Solve word-arrangement permutation problems with repeated letters, together and not-adjacent constraints, plus a worked example.
Expected Interview Answer
The number of distinct arrangements of a word with n letters, where some letters repeat, is n! divided by the factorial of each repeated letter’s count — n!/(p!×q!×...) — because swapping two identical letters produces an arrangement that looks the same and must not be counted twice.
If all n letters were distinct, there would be n! arrangements, since every position could hold any remaining letter. But when a letter repeats p times, those p copies can be permuted among themselves in p! ways without producing a visually different word, so the raw n! overcounts by a factor of p! for each repeated letter, and the true count divides those out. Extra constraints — vowels must stay together, consonants must not be adjacent, or a specific letter pattern is fixed — are handled by first gluing the constrained letters into one block (treating the block as a single unit for arrangement, then multiplying by the internal arrangements within the block, watching for repeats inside the block too). "No two vowels adjacent" is typically solved by first arranging the consonants, then placing vowels into the gaps between them.
- One division step (n! over repeat factorials) fixes any repeated-letter word count
- Gluing letters into a block cleanly handles “must stay together” constraints
- The gap-placement trick solves “no two X adjacent” problems systematically
AI Mentor Explanation
Arranging the shirt numbers "1,1,2,3" for four substitute players warming up in a line has 4! total orderings if the numbers were distinct, but since the two "1" jerseys look identical when worn, swapping their positions creates no visually new lineup, so the true count divides by 2!: 4!/2! = 12. This mirrors word arrangement exactly — repeated letters, like repeated jersey numbers, must have their internal swaps divided out of the raw factorial count to avoid recounting indistinguishable arrangements.
Worked example
Total letters
- n = 6 (B,A,N,A,N,A)
Repeat factorials
- A×3: 3!
- N×2: 2!
Distinct arrangements
- 6!/(3!×2!) = 720/12
- = 60
Step-by-Step Explanation
Step 1
Count total letters n
Include every letter, counting repeats.
Step 2
Identify repeated letters
Note the count of each letter that appears more than once.
Step 3
Apply n!/(repeat factorials)
Divide n! by the factorial of each repeated letter’s count.
Step 4
Apply constraints if any
For “must stay together,” glue into a block; for “no two adjacent,” arrange the rest first and place into gaps.
What Interviewer Expects
- Correct identification of every repeated letter and its count
- Correct application of n!/(p!×q!×...) for repeated letters
- Correct handling of “letters must stay together” via block-gluing
- Correct handling of “no two X adjacent” via the gap-placement method
Common Mistakes
- Forgetting to divide by the factorial of a repeated letter’s count
- Dividing by the wrong factorial (e.g., using the letter’s position instead of its repeat count)
- Not accounting for repeats within a glued block for “must stay together” problems
- Miscounting the number of gaps available when placing letters to avoid adjacency
Best Answer (HR Friendly)
“Start with n factorial as if every letter were unique, then divide by the factorial of each letter’s repeat count, because swapping identical letters does not create a new-looking word. For "BANANA," that is 6 factorial divided by 3 factorial for the three A’s and 2 factorial for the two N’s, giving 60. If letters must stay together, glue them into one block and arrange around it; if some letters must never be adjacent, arrange everything else first and slot those letters into the gaps.”
Follow-up Questions
- How many arrangements of "BANANA" have all three A’s together?
- How would you count arrangements of "MISSISSIPPI"?
- How do you count arrangements where no two vowels are adjacent?
- How does this differ from choosing a subset of letters rather than arranging all of them?
MCQ Practice
1. How many distinct arrangements does the word "LEVEL" have?
5 letters, L repeats twice, E repeats twice: 5!/(2!×2!) = 120/4 = 30.
2. How many distinct arrangements does the word "STATISTICS" have (10 letters: S×3, T×3, I×2, A×1, C×1)?
Divide by the factorial of each repeated letter’s count: S×3, T×3, I×2, giving 10!/(3!×3!×2!).
3. In how many ways can the letters of "APPLE" be arranged so the two P’s are always together?
Glue the two P’s into one block: 4 units (P-block, A, L, E) arrange in 4! = 24 ways; the P’s are identical so no extra multiplication is needed.
Flash Cards
Formula for arranging a word with repeated letters? — n!/(p!×q!×...) — n total letters, divided by each repeat count’s factorial.
Arrangements of "BANANA"? — 6!/(3!×2!) = 60, for 3 A’s and 2 N’s.
How to handle “letters must stay together”? — Glue them into one block, arrange the block as a single unit, adjust for repeats inside the block.
How to handle “no two vowels adjacent”? — Arrange the consonants first, then place vowels into the gaps between them.