Category

Permutation Calculator (nPr) — Permutations, Combinations & Generator

Calculate the number of permutations nPr = n!/(n−r)! where order matters. Get permutations with repetition, the related combination count, permutation probability, a step-by-step formula, and a generator that lists every arrangement.

0 calculations

Calculation Parameters

Optional. Used to label each generated arrangement.
Quick Reference:
P(n,r) = n! / (n−r)!
C(n,r) = n! / (r! × (n−r)!)

Enter Parameters

Enter n (total items) and r (chosen items), then click Calculate.

What Is a Permutation? — Permutation Definition

A permutation is the number of ways in which you can choose r elements out of a set containing n distinct objects, where the order of the elements is important. It is often denoted nPr, nPr, or P(n, r).

For example, imagine that you have a deck of nine cards with digits from 1 to 9. You draw three random cards and line them up on the table, creating a three-digit number. How many distinct numbers can you create? Because the order matters (123 is different from 321), this is a permutation problem — and the answer is P(9, 3) = 504.

Permutation Formula

Luckily, you don't have to write down all of the possible numbers. You can use a formula that lets you calculate the number of permutations in no time:

P(n, r) = n! / (n − r)!

Where:

  • P is the number of permutations;
  • n is the total number of elements in the set; and
  • r is the number of elements you choose from this set.

The exclamation mark represents a factorial: n! = n × (n−1) × … × 1.

You may also notice that, according to the permutation formula, the number of permutations for choosing one element is simply n. On the other hand, if you have to select all elements, the formula reduces to P(n, n) = n!.

Step-by-Step Example: P(9, 3)

Let's apply this equation to our problem with the numbered cards. We need to find the number of ways to choose 3 out of 9 cards:

P(9, 3) = 9! / (9 − 3)! = 9! / 6! = 504

You can check the result with our nPr calculator above.

Permutation and Combination

When you look at the results table, you can find the number of combinations as well. Combinations are also ways to choose r out of n elements — but, unlike in permutations, the order of the combinations doesn't matter.

For example, imagine a bag filled with twelve balls, each of a different color. You pick five balls at random. How many distinct sets of balls can you get? If you know the number of permutations, you can easily calculate the number of combinations too:

C(n, r) = P(n, r) / r! = n! / (r! × (n − r)!)

The key difference:

  • Permutation: Order DOES matter — (A, B) ≠ (B, A)
  • Combination: Order does NOT matter — {A, B} = {B, A}

Since order matters, P(n, r) ≥ C(n, r). In fact, P(n, r) = C(n, r) × r!. Example: P(5, 2) = 20, while C(5, 2) = 10 — the 20 permutations include both (A, B) and (B, A) as distinct, whereas combinations count them as one.

Permutations with Repetition

If each element can be chosen more than once (for example, digits in a PIN code), the number of arrangements is given by:

Prep(n, r) = nr

Example: A 4-digit PIN from digits 0–9 (with repetition allowed) = 104 = 10,000 possible codes.

Permutation Generator

Our permutation generator lists every possible ordered arrangement when n ≤ 8 and the total number of permutations P(n, r) ≤ 300. Simply enter your items (comma-separated) to see all results. For example, entering "A, B, C" with r = 2 yields: (A,B), (A,C), (B,A), (B,C), (C,A), (C,B) — exactly P(3, 2) = 6 permutations.

Permutation Probability

If you randomly draw and arrange r items from a set of n, the probability that you produce one specific ordered arrangement is:

P = 1 / P(n, r)

Example: The chance of drawing a specific 3-digit sequence from 9 cards is 1 / 504 ≈ 0.00198 (about 0.2%).

Measurement System Examples

Metric System (SI)

  • Arranging 3 lab samples (measured in milliliters) in a specific test order from a rack of 8: P(8, 3) = 336 sequences.
  • Ordering 4 masses (in kilograms) on a balance beam from a set of 6: P(6, 4) = 360 arrangements.

US / Imperial System

  • Lining up 3 pipe sizes (in inches) in an assembly sequence out of 10 available: P(10, 3) = 720 orders.
  • Arranging 2 recipe steps (ingredients measured in cups/oz) from 5: P(5, 2) = 20 sequences.

Currency Applications of Permutations

Permutations appear in finance whenever ordering matters — across all world currencies:

  • US Dollar ($): Ranking 3 stocks (1st, 2nd, 3rd by expected return) from a shortlist of 10 — P(10, 3) = 720 ordered rankings.
  • Russian Ruble (₽): Ordering 4 investment priorities from 8 rouble-denominated projects — P(8, 4) = 1,680 sequences.
  • Euro (€): Sequencing 3 payment tranches from 6 euro invoices — P(6, 3) = 120 orders.
  • British Pound (£): Arranging 2 bonds (short vs. long maturity) from 5 gilt offerings — P(5, 2) = 20 arrangements.
  • Japanese Yen (¥): Ordering the top 3 currency pairs by yen volume from 7 — P(7, 3) = 210 sequences.

Frequently Asked Questions (FAQ)

What is the difference between P(n,r) and C(n,r)?

P(n,r) counts ordered arrangements; C(n,r) counts unordered selections. P(n,r) = C(n,r) × r!

Can r be 0?

Yes. P(n, 0) = 1 for any n — there is exactly one way to arrange nothing.

Can n = r?

Yes. P(n, n) = n! — the number of ways to arrange all n elements in order.

What is the maximum n this calculator supports?

Up to n = 300. For exact results with large n, the calculator uses GMP (GNU Multiple Precision) arithmetic when available on the server; otherwise results are shown in scientific notation.

When does the permutation generator work?

The generator lists all arrangements when n ≤ 8 and P(n,r) ≤ 300. For larger values the number of permutations would be impractical to display. Enter your actual item names (comma-separated) to label each arrangement.

Calculation History

Loading...