Permutation Calculator

Find the number of ways to arrange r items from n items where order matters. Shows full formula expansion and lists all arrangements for small inputs.

๐ŸŽฒ Permutation Calculator

Counts ordered arrangements. Order matters: (A,B) is different from (B,A).

Lists every arrangement as an ordered tuple. Available for n ≤ 8 and r ≤ 4.

Total Items (n)10
items
030
Items to Arrange (r)3
items
0n
P(10,3)
C(10,3)
P(n,r) Expansion
C(n,r) Expansion

๐ŸŽฒ What is a Permutation?

A permutation P(n, r) is the number of ways to select and arrange r items from a set of n distinct items when the order of selection matters. If you are assigning first, second, and third place to runners in a race, the sequence of winners is significant: runner A winning gold while runner B wins silver is a completely different outcome from runner B winning gold while runner A wins silver. The formula is P(n, r) = n! / (n - r)!, where n! (n factorial) is the product of all positive integers from 1 to n.

Permutations appear everywhere sequence matters. Arranging 5 books on a shelf gives P(5, 5) = 120 distinct orderings. Creating a 4-digit PIN from digits 0 to 9 without repetition gives P(10, 4) = 5,040 possible codes. Scheduling 3 speakers from a pool of 8 candidates for three specific time slots gives P(8, 3) = 336 possible schedules. Determining how many ways a 10-horse race can produce a top-3 finish (exacta trifecta) gives P(10, 3) = 720. Any situation involving distinct positions, rankings, or ordered sequences calls for permutation counting.

The key distinction from combinations: permutations care about order, combinations do not. Selecting 3 people for a committee from 10 gives C(10, 3) = 120 since {Alice, Bob, Carol} is the same committee regardless of nomination order. Assigning those 3 people to president, vice-president, and secretary roles gives P(10, 3) = 720 because each role assignment is a different outcome. The relationship is P(n, r) = r! times C(n, r). Every combination of r items can be arranged in r! different orders, so permutations are always greater than or equal to combinations.

This calculator uses the multiplicative falling-factorial formula to avoid computing full factorials for large inputs: P(n, r) = n times (n-1) times (n-2) times ... times (n-r+1). This stays numerically stable for n up to 170. The List All mode enumerates every actual arrangement for n at most 8 and r at most 4, which is useful for students building intuition for ordered counting. The step-by-step expansion in Calculate mode shows the full arithmetic so you can verify the result manually.

๐Ÿ“ Formula

P(n, r)  =  n! ÷ (n − r)!
n = total number of items in the set
r = number of positions to fill (0 ≤ r ≤ n)
n! = n factorial = n × (n−1) × (n−2) × … × 2 × 1
Multiplicative form: P(n,r) = n × (n−1) × … × (n−r+1) (r terms in the product)
Example: P(10,3) = 10 × 9 × 8 = 720
vs Combination: C(n,r) = P(n,r) ÷ r! = 720 ÷ 6 = 120 for C(10,3)
Special cases: P(n,0) = 1  |  P(n,1) = n  |  P(n,n) = n!

๐Ÿ“– How to Use This Calculator

Steps

1
Enter n (total items) - Type or drag the slider to set n, the total number of items in your set. For example, n = 10 for a group of 10 runners, or n = 26 for the letters of the alphabet.
2
Enter r (items to arrange) - Type or drag the slider to set r, the number of positions to fill. r must be between 0 and n. If you enter r larger than n, the calculator clamps it to n automatically.
3
Click Calculate to see P(n,r) - The results show P(n,r) as the primary answer, C(n,r) for comparison, and a step-by-step multiplication expansion for small r. Switch to List All mode to see every actual ordered arrangement for n up to 8 and r up to 4.

๐Ÿ’ก Example Calculations

Example 1 - Assigning Medals to 3 Runners from 10

How many ways can gold, silver, and bronze be awarded to 10 runners?

1
n = 10 (runners), r = 3 (medals). Order matters: runner A winning gold while runner B wins silver is different from runner B winning gold. This is a permutation.
2
P(10,3) = 10 × 9 × 8 = 720 ordered arrangements.
3
Compare: C(10,3) = 120 ways to choose 3 medalists without assigning specific medals. Each of those 120 groups can be arranged in 3! = 6 medal sequences, giving 120 × 6 = 720 permutations.
P(10,3) = 720 ordered medal assignments
Try this example →

Example 2 - 4-Digit PIN from Digits 0 to 9 (No Repetition)

How many unique 4-digit PINs can be formed from digits 0 to 9 if no digit repeats?

1
n = 10 (digits 0 through 9), r = 4 (PIN length). Each digit can appear at most once. Order matters: PIN 1234 is not the same as 4321.
2
P(10,4) = 10 × 9 × 8 × 7 = 5,040 distinct PINs without repeated digits.
3
With repetition allowed (each position independent), the count is 10^4 = 10,000. The no-repetition constraint reduces the space from 10,000 to 5,040, which is 49.6% fewer combinations.
P(10,4) = 5,040 PINs without repeated digits
Try this example →

Example 3 - Scheduling 3 Speakers from 8 Candidates

In how many ways can 3 of 8 candidates be assigned to the 9 AM, 10 AM, and 11 AM slots?

1
n = 8 (candidates), r = 3 (time slots). The 9 AM slot is distinct from the 10 AM slot, so assigning Alice to 9 AM and Bob to 10 AM differs from Alice at 10 AM and Bob at 9 AM.
2
P(8,3) = 8 × 7 × 6 = 336 distinct speaker schedules.
3
If the slots were interchangeable (just "pick 3 speakers, no ordering"), C(8,3) = 56. Since each of those 56 groups can be scheduled in 3! = 6 orders: 56 × 6 = 336, confirming P = r! × C.
P(8,3) = 336 possible speaker schedules
Try this example →

Example 4 - List All Ordered Pairs from {1, 2, 3, 4}

List every ordered pair (r = 2) drawn from the set {1, 2, 3, 4}

1
P(4,2) = 4 × 3 = 12. There are 12 ordered pairs. Compare C(4,2) = 6 unordered pairs: the 6 combination sets each expand into 2 ordered permutations (e.g., {1,2} becomes (1,2) and (2,1)).
2
The 12 arrangements: (1,2), (1,3), (1,4), (2,1), (2,3), (2,4), (3,1), (3,2), (3,4), (4,1), (4,2), (4,3). Switch to List All mode to see these generated automatically.
P(4,2) = 12 ordered pairs
Try this example →

โ“ Frequently Asked Questions

What is a permutation and when should I use it?+
A permutation P(n,r) counts ordered selections of r items from n. Use permutations whenever the sequence or assignment of items to distinct positions matters: race rankings, seating arrangements, password construction, scheduling, or any problem where (A,B) and (B,A) are different outcomes. If order is irrelevant (committees, card hands, sample selection), use combinations C(n,r) instead.
What is the permutation formula?+
P(n,r) = n! / (n-r)!, where n! = n times (n-1) times ... times 2 times 1. The multiplicative shortcut is P(n,r) = n times (n-1) times ... times (n-r+1), using r terms. For P(7,3): 7 times 6 times 5 = 210. This avoids computing full factorials and is easier to evaluate by hand for moderate n and r.
How is a permutation different from a combination?+
Permutations count ordered arrangements; combinations count unordered groups. P(5,3) = 60 because (A,B,C) and (C,B,A) are counted as separate arrangements. C(5,3) = 10 because {A,B,C} = {C,B,A} as an unordered set. The relationship is P(n,r) = r! times C(n,r): each group of r items contributes r! permutations. For r = 3: P = 6 times C.
What does P(n,0) equal and why?+
P(n,0) = 1 for any n. The formula gives n! / n! = 1. There is exactly one way to arrange zero items, which is the empty arrangement. This base case is used in combinatorial proofs and ensures the formula P(n,r) = r! times C(n,r) holds correctly when r = 0 (since C(n,0) = 1 and 0! = 1).
What is P(n,n) and how is it different from P(n,r)?+
P(n,n) = n! because (n-n)! = 0! = 1, so the formula reduces to n!. This is the number of ways to arrange all n items. P(4,4) = 24, P(5,5) = 120, P(6,6) = 720. P(n,r) with r less than n is a partial permutation: you fill only r of the n positions. P(6,3) = 6 times 5 times 4 = 120, which is much smaller than P(6,6) = 720.
How many 3-letter codes can be formed from 26 letters without repetition?+
P(26,3) = 26 times 25 times 24 = 15,600. Without repetition means each letter can be used at most once per code. With repetition allowed, the count is 26^3 = 17,576. For case-sensitive codes with both upper and lower: P(52,3) = 52 times 51 times 50 = 132,600 without repetition, or 52^3 = 140,608 with repetition.
How do permutations apply to arranging all letters of a word?+
Arranging all letters of an n-letter word with distinct letters gives P(n,n) = n! arrangements. For a 5-letter word like CHAIR: P(5,5) = 5! = 120 arrangements. If letters repeat, the multinomial formula applies: n! / (n1! times n2! times ...), where n1, n2, ... are counts of each repeated letter. For RADAR (5 letters, A appears twice, R appears twice): 5! / (2! times 2!) = 120 / 4 = 30 distinct arrangements.
What is the trifecta bet count for a 12-horse race?+
A trifecta requires picking the exact first, second, and third place finishers in order. From 12 horses, this is P(12,3) = 12 times 11 times 10 = 1,320 possible trifectas. An exacta (first and second in order) is P(12,2) = 12 times 11 = 132. A superfecta (first through fourth in order) is P(12,4) = 12 times 11 times 10 times 9 = 11,880. The ordering requirement is why these are permutations, not combinations.
What is a circular permutation and how does it differ from a linear one?+
A linear permutation of n items gives P(n,n) = n! arrangements. A circular permutation fixes one item as a reference and arranges the remaining n-1, giving (n-1)! distinct arrangements. For 6 people seated around a round table: (6-1)! = 5! = 120 arrangements (not 720 as in a line) because rotations are considered identical. This calculator computes linear permutations. For circular permutations, divide the result by n.
How do I handle permutations with some items fixed?+
If k items must appear in fixed positions, count only the remaining n-k items for the remaining r-k positions: P(n-k, r-k). For example, if 8 people must be seated in 5 chairs and person A must sit in chair 1: fix A in chair 1, then arrange the remaining 4 chairs from 7 people: P(7,4) = 7 times 6 times 5 times 4 = 840. Without the constraint, P(8,5) = 8 times 7 times 6 times 5 times 4 = 6,720. The ratio 6720 / 840 = 8, confirming that 1 in 8 of the unconstrained arrangements places A in chair 1.
Can P(n,r) exceed 1 trillion for practical inputs?+
Yes, permutations grow very rapidly. P(20,10) = 670,442,572,800 (about 670 billion). P(15,10) = 10,897,286,400 (about 10.9 billion). P(20,13) exceeds 1 trillion. This calculator uses JavaScript floating-point (up to about 9 times 10^15 with full precision) and switches to scientific notation for results above 10^15. For exact integer arithmetic on very large permutations, use Python with arbitrary-precision integers.