Statistics
Permutation calculator (nPr)
Count ordered arrangements. Enter n and r for nPr or nʳ, or type a word to find how many distinct ways its letters can be rearranged.
Upper and lower case count as the same letter; spaces are ignored.
Bar heights are on a log scale, so equal steps up the axis are equal multiples (powers of ten), not equal amounts.
Show the working, step by step
The first position has 8 choices, the next 7, and so on for 3 positions.
P(n, r) = n! / (n − r)! = 8! / 5!
Multiply the top r factors; the rest cancel.
= 8 × 7 × 6 = 336
Dividing by the 3! orders of each group gives the combination count, where order does not matter.
C(n, r) = P(n, r) / r! = 336 / 6 = 56
The formulas
P(n, r) = n! ÷ (n − r)! With repetition: nʳ Letters of a word: n! ÷ (k₁! × k₂! × … × kₘ!)
In a permutation the order matters, so ABC and CBA count separately. The first formula is for picking r different items from n. The second allows the same item in more than one position. The third is for arranging all n items when some of them are identical, where kᵢ is how many times the i-th distinct item appears.
A worked example: nPr
Eight runners are in a final. In how many ways can gold, silver and bronze be awarded? Order matters (gold is not silver) and one runner cannot take two medals, so this is P(8, 3):
P(8, 3) = 8! ÷ 5! = 8 × 7 × 6 = 336
There are 8 choices for gold, then 7 left for silver, then 6 for bronze. If you only cared which three runners reached the podium, divide by the 3! = 6 orders of each trio to get C(8, 3) = 56.
With repetition
Switch the mode to “with repetition” and keep n = 8, r = 3. Now each of the 3 positions can be any of 8 symbols, even one already used, as in a 3-character code from an 8-letter keypad:
8³ = 8 × 8 × 8 = 512
The 176 extra arrangements over 336 are the ones that reuse a symbol, such as AAB or CCC.
A worked example: letters of a word
BANANA has 6 letters. If they were all different there would be 6! = 720 orders. But swapping the three A's with each other, or the two N's, gives the same word, so each distinct arrangement has been counted 3! × 2! = 12 times:
6! ÷ (3! × 2!) = 720 ÷ 12 = 60
The calculator lists all 60 in alphabetical order, from AAABNN to NNBAAA. For words with more than 120 arrangements it gives the count and the letter table only.
How to read the result
The headline counts equally likely orderings. If you shuffle BANANA's letters at random, the chance of spelling BANANA again is 1 in 60. If you guess a 3-medal podium at random, the chance of getting all three places right is 1 in 336. Large answers are exact: the calculator works with whole numbers of any size and gives the full digits under “Exact value” when the count passes 21 digits.
Common mistakes
- Using nPr when order does not matter. A committee of 3 from 8 is C(8, 3) = 56, not 336.
- Using n! ÷ (n − r)! when repeats are allowed. A 4-digit PIN is 10⁴ = 10,000, not P(10, 4) = 5,040.
- Forgetting repeated letters. BOOK has 4! ÷ 2! = 12 arrangements, not 24.
- Counting case separately by accident. The word mode treats upper and lower case as the same letter.
Common questions
What does nPr mean?
nPr, or P(n, r), is the number of ordered arrangements of r items chosen from n different items, with no item used twice. It equals n! ÷ (n − r)!, which is the product of the r numbers counting down from n. For example, 8P3 = 8 × 7 × 6 = 336.
When should I use permutations with repetition?
When each position can be any of the n items regardless of what is already used: PIN codes, licence plates, passwords, or the outcomes of rolling a die several times. The count is nʳ. A 4-digit PIN has 10⁴ = 10,000 possibilities.
How many ways can the letters of a word be arranged?
Divide n! by k! for every letter that appears k times. BANANA has 6 letters with A three times and N twice, so 6! ÷ (3! × 2!) = 720 ÷ 12 = 60. MISSISSIPPI gives 11! ÷ (4! × 4! × 2!) = 34,650.
How is nPr related to nCr?
nPr = nCr × r!. Every unordered group of r items can be put in r! different orders. With n = 8 and r = 3: 56 groups × 6 orders = 336 permutations.
Related calculators
-
Combination calculator
When order does not matter: nCr, with a full list.
-
Password combinations
Permutations with repetition applied to passwords.
-
Permutation and combination
All six counting formulas, including circular arrangements.