Permutation (nPr) Calculator
This calculator works out nPr, the number of ways you can arrange r items chosen from a set of n items when the order of selection matters. Permutations turn up whenever sequence changes the outcome: ranking runners in a race, assigning committee roles such as chairperson and treasurer, or working out possible PIN codes without repeated digits. You enter two whole numbers: n, the total items in the set, and r, how many of them you are selecting or arranging. The calculator instantly returns the nPr result (the count of ordered arrangements), the equivalent nCr figure (the same items grouped without regard to order), and r! (the order factor that links the two, since nPr = nCr multiplied by r!). Below the results sits a full step-by-step working panel that substitutes your numbers into the formula nPr = n! / (n - r)!, cancels the common factorial terms, and shows the final answer, alongside a values table listing n, r, n - r, n! and (n - r)!. To use it, simply type your n and r values and the results update as you type; r cannot be greater than n, since you cannot arrange more items than exist. All calculations use exact big-integer arithmetic for n up to 170, so nothing is rounded, though very long results are shown in scientific notation once they exceed 20 digits for readability.
1. Enter Values
2. Notation Guide
A permutation is written as nPr, P(n,r) or nPr. The subscript n is the pool size; r is the selection size.
Order matters in a permutation. Selecting {A, B, C} in a different sequence gives a different permutation.
Compare with combinations (nCr) where order does not matter. nPr = nCr x r!.
Step-by-Step Working
Values
Worked Example (defaults: n=10, r=3)
What Is a Permutation?
A permutation is a way of arranging a selection of items where the order matters. If you choose three letters from the set {A, B, C, D, E}, the sequence ABC is counted separately from BAC, even though both contain the same three letters. This distinguishes permutations from combinations, where only the group of chosen items matters.
Permutations appear in real-world problems such as: how many ways can five runners finish in the top three places? How many different four-digit PIN codes can be formed from ten digits with no repetition? How many ways can a chairperson, secretary, and treasurer be chosen from a club of 20 members?
The nPr Formula
The number of permutations of r items chosen from n distinct items is given by:
nPr = n! / (n - r)!
where n! (n factorial) is the product of all positive integers up to n: n! = n x (n-1) x (n-2) x ... x 2 x 1. The cancellation between n! and (n-r)! means in practice you only need to multiply the top r terms: nPr = n x (n-1) x ... x (n-r+1).
Key Properties
| Property | Value | Reason |
|---|---|---|
| nP0 | 1 | One way to arrange zero items: do nothing |
| nP1 | n | Choose any one item from n options |
| nPn | n! | All items arranged, n factorial ways |
| nPr when r > n | Undefined (0) | Cannot choose more than exist |
| nPr vs nCr | nPr = nCr x r! | Each combination generates r! orderings |
Permutations vs Combinations
The key question is: does order matter? If yes, use permutations (nPr). If no, use combinations (nCr = nPr / r!). For example:
- Permutation: How many ways can 3 athletes finish 1st, 2nd, and 3rd from a field of 10? Answer: 10P3 = 720. Each different finish order is a distinct outcome.
- Combination: How many ways can 3 athletes be selected for a team from 10? Answer: 10C3 = 120. The team ABC is the same team regardless of which member was named first.
Because each combination generates r! different orderings, nPr is always a multiple of nCr: nPr = nCr x r!. In this example, 720 = 120 x 6 (since 3! = 6).
Large Values and Precision
Factorials grow extremely quickly. 20! is already 2.4 quintillion. This calculator handles values up to n = 170, computing every result exactly using big-integer arithmetic, so nothing is ever rounded. Results are only abbreviated to scientific notation for readability when they run to more than 20 digits. Most practical problems (sports draws, PINs, committee selections, card hands) involve n well within this range.
Related Calculators
- Maths and Stats Calculators: full hub for all maths tools.
- Factorial Calculator: calculate n! for any non-negative integer.
- Probability Calculator: calculate single-event and combined probabilities.
- Bayes Theorem Calculator: conditional probability and Bayesian inference.
Sources and method: Standard combinatorics formula nPr = n! / (n - r)! as defined in NCEA Level 2 and 3 mathematics, and internationally across all standard statistics and probability curricula. See also: National Council of Teachers of Mathematics (NCTM) and New Zealand Mathematics Curriculum.
This calculator computes exact permutations for non-negative integers where r does not exceed n. Computation uses big-integer arithmetic throughout, so results are always exact; very long results (more than 20 digits) are only abbreviated to scientific notation for readability. Always verify results independently for high-stakes decisions.