Permutations Calculator (nPr)

Permutations โ€” P(n, r)

Formula: P(n, r) = n! รท (nโˆ’r)!
Order DOES matter. {A, B, C} and {C, A, B} are different arrangements.

P(10, 3) โ€” Permutations

Answer

P(10, 3)
720
What this means: P(10, 3) = 720 โ€” the number of ordered arrangements of 3 items chosen from 10, where order DOES matter.

Show your work

Given
  • Formula
    P(n, r) = n! รท (nโˆ’r)! = n ร— (nโˆ’1) ร— โ€ฆ ร— (nโˆ’r+1)
    โ†’ order DOES matter
  1. Expand (r terms in the numerator)
    10 ร— 9 ร— 8
    = 720
P(10, 3)
720
permutations

Permutations Calculator โ€” P(n, r) with falling-factorial expansion

Enter n (pool size) and r (how many to arrange). The calculator returns the number of ordered arrangements of r items chosen from n where order matters. The show-your-work expands the falling factorial โ€” n ร— (nโˆ’1) ร— โ€ฆ ร— (nโˆ’r+1) โ€” so you see r terms multiplied, not a giant n! divided by another giant (nโˆ’r)!. For huge results we show compact scientific notation with a "show full digits" expander, and surface a Stirling-derived approximation for an independent magnitude check.

For order-doesn't-matter selection, see the Combinations calculator. For raw n!, see the Factorial calculator.

Where permutations show up in the real world

Permutations appear any time there's an ordered selection โ€” and "ordered" can mean ranks, distinct slots, or any attribute that makes one arrangement different from a re-ordering of the same items.

Ranked outcomes

Olympic podium (gold/silver/bronze), top-3 in any race or contest, first / second / third place finishes.

Distinct roles

Assigning president / VP / secretary from a candidate pool, casting roles in a play, ordered draft picks.

PINs & passwords

PINs that don't allow repeated digits, password permutations, license plate prefixes, room number assignments.

Scheduling & ordering

Conference talk slots (slot 1 = keynote, slot 2 = follow-up), interview blocks, ordered to-do lists.

Word arrangements

Anagrams of all-distinct-letter words, ordered letter sequences, ordered route waypoints.

Algorithm analysis

Brute-force permutation search (TSP, sequence alignment, scheduling) โ€” gives the upper bound on the search space.

Permutation or combination? โ€” the test

Ask: does the order matter?

  • Yes โ†’ Permutation: race medals (gold โ‰  silver), PIN codes, seating order, word arrangements, distinct roles.
  • No โ†’ Combination: poker hands, lottery numbers, picking a study group, pizza toppings.

Permutations are always โ‰ฅ combinations (when r โ‰ฅ 2): P(n, r) = C(n, r) ร— r! โ€” each group of r items can be ordered in r! distinct ways.

Quick reference โ€” common permutations at a glance

P(n, r)ValueScenario
P(5, 2)202 of 5 in order
P(8, 3)336Olympic podium from 8 finalists
P(10, 4)5,0404-digit PIN, no repeats
P(26, 4)358,8004-letter prefix, no repeats
P(52, 5)311,875,200Ordered 5-card draw
P(50, 6)11,441,304,000Ordered 6-number lottery
P(100, 10)โ‰ˆ 6.28 ร— 10ยนโนTop-10 ranking from 100

Approximating P(n, r) for huge inputs

When the count exceeds 2^53 (about 9 ร— 10^15), even 64-bit floats lose precision in the last few digits. Two strategies:

  • log10 sum: log10 P(n, r) = ฮฃ log10(n โˆ’ i) for i = 0..rโˆ’1. Each log10 is small, the sum is exact in float arithmetic, and the magnitude (number of digits, mantissa) follows immediately.
  • Stirling on each factorial: P(n, r) โ‰ˆ Stirling(n!) รท Stirling((nโˆ’r)!). Each application has relative error ~1/(12k); combined the error is still tiny โ€” under 0.1% from n = 84 onward.

The calculator uses the log-sum form for the displayed magnitude and surfaces the Stirling approximation as an educational sanity check.

Frequently asked questions

What is a permutation?

โ–พ

A permutation is an ORDERED arrangement of r items chosen from a pool of n. P(10, 3) = 720 means there are 720 distinct ways to award gold, silver, and bronze among 10 runners โ€” gold-silver-bronze is different from bronze-silver-gold. Order matters.

How is a permutation different from a combination?

โ–พ

A permutation cares about order; a combination doesn't. The same 3 students chosen from a class of 20: as a study group (combination) it's C(20, 3) = 1,140 distinct groups. As 3 distinct roles โ€” president / VP / secretary (permutation) โ€” it's P(20, 3) = 6,840 distinct assignments. Six times more, because every group of 3 can fill the roles in 3! = 6 different orders. Math relationship: P(n, r) = C(n, r) ร— r!.

What is P(n, n) and why does it equal n!?

โ–พ

P(n, n) is the full permutation โ€” arranging ALL n items in order. For 5 books on a shelf, P(5, 5) = 5 ร— 4 ร— 3 ร— 2 ร— 1 = 120 = 5!. The formula confirms this: P(n, n) = n! / (n-n)! = n! / 0! = n! / 1 = n!.

What is P(n, 0)?

โ–พ

P(n, 0) = 1 for any n. There is exactly one way to arrange zero items โ€” the empty arrangement. The formula holds: P(n, 0) = n! / n! = 1.

How does the calculator avoid huge factorials?

โ–พ

Falling-factorial form. P(n, r) = n ร— (n-1) ร— ... ร— (n-r+1) โ€” only r terms in the multiplication. P(52, 3) = 52 ร— 51 ร— 50 = 132,600. We never compute 52! directly. The downside: the result itself can still be huge, so we display it in compact scientific notation when needed.

When do I use a permutation in real problems?

โ–พ

Whenever the order of selection matters: race medals (gold โ‰  silver), assigning distinct roles, seating arrangements, PIN codes (1234 โ‰  4321), word/letter arrangements, scheduling order. If "first / second / third" or "different roles" appears in the problem, it's a permutation.

Permutations with repetition โ€” does this calculator do that?

โ–พ

Not directly. This calculator is for permutations WITHOUT repetition (each item used at most once). Permutations WITH repetition (like 4-digit PINs where digits CAN repeat) is just n^r โ€” for example, 10^4 = 10,000 PINs if repeats are allowed. Use a basic calculator for that case.

How do I compute P(n, r) by hand?

โ–พ

Multiply r consecutive integers starting at n and going down. P(8, 3) = 8 ร— 7 ร— 6 = 336. P(15, 4) = 15 ร— 14 ร— 13 ร— 12 = 32,760. Don't plug into the n! / (nโˆ’r)! formula and compute the factorials separately โ€” you'll just be cancelling most of it. The product form IS the cancellation.

When does P(n, r) become approximate in this calculator?

โ–พ

Once the count exceeds 2^53 โ‰ˆ 9 ร— 10^15, JavaScript can't represent it exactly. The calculator flags it as approximate, but the magnitude (number of digits, leading digits, scientific-notation form) is reliable. Stirling's approximation in the right-hand panel gives an independent closed-form check.

What is Stirling's approximation, and why is it useful here?

โ–พ

Stirling's formula gives a closed-form estimate: n! โ‰ˆ โˆš(2ฯ€n) ร— (n/e)^n. Applied to P(n, r) = n!/(nโˆ’r)! you get an estimate that needs no big-integer arithmetic. The relative error shrinks as ~1/(12n), so it's already under 1% by n = 9 and under 0.1% by n = 84. We surface it for huge inputs so you can sanity-check the magnitude.

How big is P(52, 5) โ€” the ordered card-draw count?

โ–พ

P(52, 5) = 52 ร— 51 ร— 50 ร— 49 ร— 48 = 311,875,200. That's the number of distinct ordered 5-card draws from a deck. Most card-game problems use the unordered count C(52, 5) = 2,598,960 (= P(52, 5) / 5!).

Where do permutations show up beyond textbooks?

โ–พ

Cryptography (key arrangements, password permutation counts), scheduling (ordered task slots), genetics (chromosome arrangements), bioinformatics (sequence alignment), routing (vehicle / TSP order), tournament brackets, lottery rankings. Any time an "order" attribute is meaningful, P(n, r) is the count.

How do I compute permutations of items WITH some repeats?

โ–พ

For a multiset with n items where one element appears nโ‚ times, another nโ‚‚ times, etc., the count is n! / (nโ‚! ร— nโ‚‚! ร— โ€ฆ). Example: anagrams of MISSISSIPPI = 11! / (4! ร— 4! ร— 2!) = 34,650. This calculator handles all-distinct permutations only โ€” divide by the repeat factorials yourself.

Where to next?

Three counting tools + probability โ€” once you have the count, probability becomes easy.