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.
🎲 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
📖 How to Use This Calculator
Steps
💡 Example Calculations
Example 1 - Assigning Medals to 3 Runners from 10
How many ways can gold, silver, and bronze be awarded to 10 runners?
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?
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?
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}
❓ Frequently Asked Questions
🔗 Related Calculators
What is a permutation in math and how is it different from a combination?
A permutation P(n,r) counts the number of ways to select and arrange r items from a set of n items when order matters. A combination C(n,r) counts selections when order does not matter. P(5,2) = 20 because the pair (A,B) and the pair (B,A) are counted separately. C(5,2) = 10 because {A,B} and {B,A} are the same group. Use permutations for passwords, race results, and seating arrangements. Use combinations for committees, card hands, and samples.
What is the permutation formula P(n,r)?
P(n,r) = n! / (n-r)!, where n! = n times (n-1) times ... times 2 times 1. The multiplicative form is easier to compute: P(n,r) = n times (n-1) times ... times (n-r+1). For P(10,3): 10 times 9 times 8 = 720. This is the falling factorial of n taken r at a time.
How do I calculate P(5,3)?
P(5,3) = 5! / (5-3)! = 5! / 2! = (5 times 4 times 3 times 2 times 1) / (2 times 1) = 120 / 2 = 60. Using the multiplicative shortcut: P(5,3) = 5 times 4 times 3 = 60. This means there are 60 ways to arrange 3 items chosen from a set of 5 when order matters.
What is P(n,0) and why does it equal 1?
P(n,0) = 1 for any n. The formula gives n! / n! = 1. The combinatorial interpretation: there is exactly one way to arrange zero items, which is the empty arrangement. This is the base case for permutation counting and mirrors C(n,0) = 1 for combinations.
What is P(n,n) and how do I compute it?
P(n,n) = n! because (n-n)! = 0! = 1, so P(n,n) = n! / 1 = n!. This counts all possible orderings of all n items, which is the full factorial. P(4,4) = 4! = 24 ways to arrange 4 books on a shelf. P(5,5) = 120 ways to arrange 5 people in 5 seats.
How are permutations used to count passwords and PINs?
A 4-character password from 26 lowercase letters without repetition gives P(26,4) = 26 times 25 times 24 times 23 = 358,800. A 4-digit PIN from 0 to 9 without repetition gives P(10,4) = 10 times 9 times 8 times 7 = 5,040. With repetition allowed, use 26^4 = 456,976 or 10^4 = 10,000 instead. Permutations without repetition apply when the same character cannot appear twice.
What is the difference between P(n,r) and r factorial?
r! is the number of ways to arrange all r items among themselves (a full permutation of r items). P(n,r) = n! / (n-r)! = n times (n-1) times ... times (n-r+1) counts ordered selections from a larger pool of n. The relationship is P(n,r) = r! times C(n,r): you first choose the r items (C(n,r) ways) then arrange them (r! ways).
When r equals n minus 1, what does P(n, n-1) equal?
P(n, n-1) = n! / (n-(n-1))! = n! / 1! = n!. This is equal to P(n,n) = n!. Intuitively, leaving one item out of an arrangement still gives the same count as arranging all n items, because the one excluded item is always determined once you choose the arrangement of the other n-1.
How do permutations apply to race finishing positions?
If 10 runners compete and you want to count the number of ways to assign first, second, and third place, the answer is P(10,3) = 10 times 9 times 8 = 720. The order matters because runner A finishing first and runner B finishing second is a different outcome from runner B first and runner A second. Combinations would only apply if the three top finishers were being selected for a group award with no ranking.
What is the permutation formula when all items are not distinct?
When a set contains repeated items, the multinomial formula applies: n! / (n1! times n2! times ... times nk!), where n1, n2, ..., nk are the counts of each distinct item. For the word BANANA (6 letters: B once, A three times, N twice): 6! / (1! times 3! times 2!) = 720 / 12 = 60 distinct arrangements. This calculator computes standard permutations of distinct items.
Can I use the List All mode for large n or r?
The List All mode is limited to n at most 8 and r at most 4. P(8,4) = 1,680 arrangements, which is already a long list. For larger inputs, use the Calculate mode, which computes P(n,r) instantly for any n up to 170 using the multiplicative formula.
What is the relationship between P(n,r) and the binomial coefficient?
The binomial coefficient C(n,r) is P(n,r) divided by r!: C(n,r) = P(n,r) / r!. Equivalently, P(n,r) = C(n,r) times r!. This relationship shows that every combination of r items from n can be arranged in r! different orders to produce r! distinct permutations. The binomial coefficient counts unordered groups; the permutation formula counts ordered sequences.