Permutation Calculator

Quick Overview

  • This tool calculates the number of ordered arrangements of r items selected from a set of n, accepting two inputs: total elements (n) and elements selected (r).
  • The formula used is P(n,r) = n! / (n−r)!, supporting values from 0 to 170 for both n and r with the constraint r ≤ n.
  • For example, P(10,3) = 720 and P(7,7) = 5,040.
  • It serves students solving permutation problems, developers estimating algorithm search spaces, and researchers working with ordered selection counts.

Permutation Calculator: Find P(n,r) Instantly with Formula

Whether you're prepping for the SAT, debugging a sorting algorithm, or designing a game mechanic, calculating large permutation values by hand is both slow and error-prone. The Permutation Calculator computes the exact number of ordered arrangements of r items chosen from n in seconds. Formula: P(n,r) = n! / (n−r)!. Use it to solve counting problems, validate code output, or understand how quickly ordered selections grow.

What Is a Permutation?

A permutation counts the number of ways to select and arrange r items from a set of n where order matters. The notation P(n,r) — also written nPr — uses the formula n!/(n−r)!. This calculator accepts two inputs: n (total elements) and r (elements selected), supporting values from 0 to 170 for both, with r ≤ n required. Permutations appear throughout US high school and college math: the SAT Math section tests counting principles, AP Statistics covers probability built on permutations, and AP Computer Science uses them to analyze algorithm complexity. The key distinction from combinations is that {A,B} and {B,A} are counted as two different permutations but only one combination — order is the deciding factor.

Formula and Reference Table

There is one formula for permutations, valid for all non-negative integers where r does not exceed n. The table below lists the most commonly referenced values and their real-world contexts.

n

r

Calculation

Result P(n,r)

Common Use

5

2

5!/3!

20

Basic SAT counting problems

10

3

10!/7!

720

Medal rankings, podium finishes

26

4

26!/22!

358,800

4-letter code from alphabet (no repeats)

8

8

8!/0!

40,320

Full arrangement of 8 items

n

0

n!/n!

1

Special case: selecting nothing

Quick Examples:

NFL Draft: ways to assign picks 1st, 2nd, 3rd from 32 teams: P(32,3) = 29,760

Assigning gold, silver, bronze from 12 athletes: P(12,3) = 1,320

4-digit PIN from digits 1–9 without repetition: P(9,4) = 3,024

Practical Examples

SAT Math: Seat Assignment Counting

A common SAT question asks how many ways 5 students can be seated in 3 specific chairs. Since order matters (each chair is distinct), this is P(5,3) = 5!/2! = 60. Students who understand why order matters here — not just that the formula applies — perform significantly better on variations of this question type that appear on the actual exam.

AP Computer Science: Brute-Force Search Space

A student writing a route-finding algorithm needs to estimate how many ordered paths exist through 8 of 12 available nodes: P(12,8) = 19,958,400. That number makes it immediately obvious why brute-force search is impractical and why heuristics like A* are necessary — a practical lesson that connects directly to algorithm design course content.

Password Security: No-Repeat PIN Generation

A cybersecurity class exercise asks students to calculate how many 6-digit PINs can be formed from 10 digits without repetition: P(10,6) = 151,200. Comparing this to 10^6 = 1,000,000 (with repetition) illustrates precisely how much the no-repeat constraint shrinks the keyspace — and why password policies matter.

NFL Playoff Bracket Outcomes

A stats teacher asks: in how many ordered ways can 3 conference finalists emerge from 6 remaining teams? P(6,3) = 120. This sports-framed problem keeps students engaged while reinforcing the formula — a technique recommended in AP Statistics curriculum design materials for making abstract counting principles tangible.

Who Can Use This Calculator?

  • SAT and ACT students — Verify counting and arrangement answers instantly during timed practice sessions.

  • AP Statistics and AP Computer Science students — Confirm permutation values for probability and algorithm complexity problems.

  • College math and discrete mathematics students — Check P(n,r) results for combinatorics assignments and exams.

  • Software engineers and developers — Estimate ordered search spaces when designing algorithms or analyzing worst-case complexity.

  • Math and statistics teachers — Generate correct reference values for classroom examples without manual calculation.

  • Data scientists — Compute ordered selection counts for feature ranking and experimental design problems.

  • Game developers — Calculate possible ordered sequences for card games, puzzle levels, and procedural content generation.

  • Curious learners — Answer everyday questions like "how many ways can I arrange my top 5 playlist songs?"

Conclusion and Next Steps

Permutation problems show up in standardized tests, software design, cryptography, and everyday decision-making — and the formula P(n,r) = n!/(n−r)! handles every one of them. For values of n above 10 or 12, manual calculation becomes impractical and prone to error. This calculator delivers the exact result with the formula displayed, so you learn while you verify. When you're ready to go further, the Combination Calculator, Factorial Calculator, and Probability Calculator are the natural next tools to explore.

Key Takeaways

Order matters in permutations: {A,B} and {B,A} are two distinct results.

P(n,0) = 1 and P(n,n) = n! are the two special cases; both are handled correctly.

Supported range: n and r from 0 to 170, with r ≤ n required.

For unordered selections, use the Combination Calculator instead.

Free to use on any device; no registration required.

How to Use

1
Enter the total number of elements (n)
Type the size of the full set into the n field. For example, if you have 10 athletes to choose from, enter 10.
2
Enter the number of elements to select (r)
Type how many items you are arranging in order into the r field. This value must be less than or equal to n.
3
Read the instant result
The calculator updates in real time as you type — no button press needed. The result appears immediately with no delay.
4
Review the result and formula
The screen shows both the numeric value of P(n,r) and the formula n!/(n−r)!. Copy the result directly into your work.
5
Repeat for additional permutation values
Clear the fields, enter new n and r values, and the answer updates instantly. Compare multiple scenarios side by side by running calculations one after another.

Frequently Asked Questions

A permutation counts ordered arrangements — the sequence matters. A combination counts unordered selections — only the members of the group matter, not the order. For example, {A,B} and {B,A} are two permutations but only one combination. The permutation formula is P(n,r) = n!/(n−r)!, while combinations use C(n,r) = n!/(r!×(n−r)!). Use permutations whenever position, rank, or sequence is significant.
Both n and r accept integers from 0 to 170. The constraint r ≤ n must be satisfied — you cannot select more items than exist in the set. In practice, values up to n = 20 cover almost all academic and professional use cases. For larger inputs, P(n,r) can produce numbers with dozens of digits, which the calculator handles accurately.
Set r equal to n. The calculator returns n!, since P(n,n) = n!/0! = n!. For example, P(7,7) = 5,040. This is the same as a complete factorial and represents arranging every element in the set. The special case P(0,0) = 1 is also correctly handled.
The logic is sequential: the first position has n choices, the second has n−1, the third has n−2, continuing down to n−r+1 for the r-th position. Multiplying these gives n × (n−1) × … × (n−r+1). Writing this as n! and dividing by (n−r)! cancels the terms below n−r+1, which is exactly what makes the formula work efficiently for all valid inputs.
Yes, completely free. No account, subscription, or payment is required. It works in any modern browser on desktop, tablet, or mobile. It is available whenever you need a quick calculation — during class, a study session, or a coding sprint.
This calculator handles permutations without repetition (standard P(n,r) = n!/(n−r)!). Permutations with repetition — where the same element can be chosen more than once — follow the formula n^r instead. For example, a 4-digit PIN using digits 0–9 with repetition has 10^4 = 10,000 possibilities, while P(10,4) = 5,040 without repetition. Calculate n^r separately for the repeated case.
Yes. The output displays both the numeric result and the P(n,r) = n!/(n−r)! formula. This is especially useful for students who need to show their work on exams or assignments. Teachers can also use the formula output directly in worksheet examples without manually typesetting the expression.