Sizely
Permutation Calculator

Permutation Calculator

Permutation calculator: find nPr, the number of ordered arrangements of r items chosen from n, as an exact whole number. Learn combinations by hand.

Annie Button

Written by

Annie Button

Updated

There was an error with your calculation.

Permutation

6720

Permutation calculator at a glance#

What is a permutation?#

A permutation is an arrangement of objects in a specific order. Awarding gold, silver, and bronze medals to 3 of 8 runners represents a permutation problem. This is because the same trio of runners, ordered differently, will produce a distinct outcome.

How do you calculate permutations?#

To calculate permutations, use P(n, r) = n! ÷ (n − r)!, also written nPr, where n denotes the total number of objects and r is the quantity you select and arrange. The exclamation mark signifies a factorial. For 8 runners and 3 medals, P(8, 3) = 8! ÷ 5! = 8 × 7 × 6 = 336. Input n and r above, and the calculator will provide the precise count.

What is 5P2?#

5P2, also written P(5, 2) and read as 5 permute 2, is 20. There are 5 options for first place and 4 remaining for second place, resulting in 5 × 4 = 20 ordered pairs.

What a permutation counts#

Order is essential for a permutation. If Ana, Ben, and Cara take first, second, and third places respectively, it's a distinct result from Cara, Ben, and Ana, even with the same three runners on the podium. A permutation counts each of these orders as separate.

The calculation is based on filling one position at a time. Any of the 8 runners can secure gold. With gold awarded, 7 runners remain for silver, then 6 for bronze. By multiplying these choices, 8 × 7 × 6 = 336, you obtain every potential podium. OpenStax Precalculus refers to this as the multiplication principle, which forms the foundation of the permutation formula.

The formula relies on factorials. A factorial, denoted as n!, involves multiplying every whole number from n down to 1, so 5! = 5 × 4 × 3 × 2 × 1 = 120. By definition, 0! = 1, which ensures the formula's validity when arranging all objects.

How to calculate a permutation by hand#

You can reach the same result using two different methods.

  • With the formula: 8! = 40,320 and 5! = 120, so P(8, 3) = 40,320 ÷ 120 = 336.
  • With the shortcut: start with n and multiply r numbers, counting down. For P(8, 3), this involves three numbers, 8 × 7 × 6 = 336.

The shortcut bypasses large factorials that cancel out. In a spelling bee with 22 contestants, the number of ways to finish the top 5 positions is 22 × 21 × 20 × 19 × 18 = 3,160,080. The diagram below illustrates the medals example, showing one slot per position, with choices decreasing by one each time.

Three medal slots for 8 runners: gold has 8 choices, silver 7 and bronze 6, so P(8, 3) = 8 × 7 × 6 = 336, the same as 8! ÷ 5! = 40,320 ÷ 120
Each slot has one fewer choice than the last, so 8 × 7 × 6 = 336 podiums.

Some special scenarios often occur:

  • Arranging all n objects: when r equals n, the answer is n!. For instance, six books on a shelf can be arranged in P(6, 6) = 720 ways.
  • Choosing none: when r is 0, the answer is 1, since there's only one way to arrange nothing.
  • Choosing one: when r is 1, the answer is n itself.
  • Choosing more than available: when r exceeds n, no arrangement is possible, and the calculator shows an error.

What the calculator accepts#

Input n as a whole number of 0 or more, and r as a whole number not exceeding n. The calculator handles exact whole numbers, not rounded decimals, so P(52, 52), the number of ways to organize a complete deck of cards, is displayed with all 68 digits. Results up to 500 digits are shown in full. Beyond that, the answer is given in e notation, so P(254, 254) ends in e+502, which means times 10 to the power 502. The scientific notation calculator explains how to interpret this format.

Permutations vs combinations#

A combination is a selection where order doesn't matter. Choosing which 3 of the 8 runners advance to a final is a combination, because the group is the same regardless of which runner is named first. There are fewer combinations than permutations, since every group of 3 can be arranged in 3! = 6 ways.

Every combination of three runners appears 6 times among the 336 podiums. Dividing removes the repeats and gives: C(8, 3) = 336 ÷ 6 = 56. In general, this is represented by C(n, r) = P(n, r) ÷ r!, which OpenStax writes as C(n, r) = n! ÷ (r! × (n − r)!).

One group of runners A, B and C shown in its 6 orders ABC, ACB, BAC, BCA, CAB and CBA, so C(8, 3) = 336 ÷ 6 = 56
Every group of 3 runners appears in 6 orders, so 336 permutations hold 56 combinations.

The calculator above returns permutations only. For a combination, take its answer and divide by the factorial of r.

A quick test helps decide which one you need. Swap two of the chosen items. If the swap gives a different outcome, as it does for a podium, a password, or a seating plan, you should count permutations. If it doesn't, as is the case for a committee, a hand of cards, or a pizza topping choice, count combinations. Five cards dealt from a 52-card deck make P(52, 5) = 311,875,200 ordered deals but only C(52, 5) = 2,598,960 different hands.

Permutations with repetition#

The calculator handles arrangements where no item repeats, using each object at most once. When repetition is allowed, every position has all n choices, so the count becomes n raised to the power of r. For a code with 4 digits, each ranging from 0 to 9, there are 104 = 10,000 possible codes. If digits cannot repeat, the count falls to P(10, 4) = 10 × 9 × 8 × 7 = 5,040, which is what the calculator will provide.

When dealing with repeated identical objects, a different approach is needed. For example, the letters in the word BANANA have 6! = 720 possible arrangements if each letter is considered unique. However, swapping two identical A's doesn't create a new arrangement. To find the distinct arrangements, divide by the factorial of each repeated count: 720 ÷ (3! × 2! × 1!) = 720 ÷ 12 = 60 unique orders. OpenStax gives the same rule for permutations of objects that aren't all unique.

Permutations on a handheld calculator#

Many scientific and graphing calculators come with an nPr function, usually found under a probability menu or as the second function of a button. To use it, type n, press nPr, then type r and hit equals. For values 8 and 3, the calculator will show 336, which aligns with the result from the example above.

Where permutations are used#

  • Rankings and race results include podium places, tournament standings, and the order of finishers.
  • Electing officers is another example, with OpenStax noting 120 ways to appoint a president, vice president, and treasurer from 6 members: P(6, 3).
  • Permutations are also involved in seating arrangements and scheduling, like the order of people in a line or tasks in a day.
  • For codes and passwords, when repetition is possible, the formula is n to the power r, and without repetition, it's P(n, r).
  • In probability, dividing favorable arrangements by all arrangements gives a chance, which the probability calculator can combine with other events. The odds calculator can simplify favorable to unfavorable counts into odds.

Common permutation values#

The table provides common values people often reference, alongside the corresponding combination for context. Each permutation is calculated as the combination times r factorial.

Common permutation values
NprAlso WrittenPermutationsCombinations
3P2P(3, 2)63
5P2P(5, 2)2010
6P2P(6, 2)3015
6P3P(6, 3)12020
7P3P(7, 3)21035
8P3P(8, 3)33656
8P5P(8, 5)6,72056
9P4P(9, 4)3,024126
10P3P(10, 3)720120
10P4P(10, 4)5,040210
20P3P(20, 3)6,8401,140
20P5P(20, 5)1,860,48015,504
22P5P(22, 5)3,160,08026,334
52P5P(52, 5)311,875,2002,598,960
6P0P(6, 0)11
6P6P(6, 6)7201

Sources#

Frequently asked questions#

What does nPr mean?#

It's shorthand for the number of permutations of n objects taken r at a time, the same value as P(n, r). The letter n represents the size of the set, r is how many you arrange, and P stands for permutation.

Can r be larger than n?#

No, you can't arrange more objects than you have. There are no permutations when r exceeds n, and the calculator requires an r no larger than n.

Why is 0! equal to 1?#

There's exactly one way to arrange nothing, which is to leave it empty. Setting 0! = 1 keeps the formula correct when r equals n, since P(n, n) = n! ÷ 0! = n!.

How many ways can 5 people sit in a row?#

There are 5! = 5 × 4 × 3 × 2 × 1 = 120 ways. Enter 5 for n and 5 for r. If only 3 of the 5 people get chairs, the count is P(5, 3) = 5 × 4 × 3 = 60.

Is a combination lock a permutation?#

Yes, despite the name. The order of the numbers matters, and the same number can be used twice, so it's a permutation with repetition. A lock with 3 dials of 10 digits has 103 = 1,000 codes.

How do you count the arrangements of the letters in a word?#

If every letter is different, use n! for n letters. For example, the word MATH has 4! = 24 arrangements. If letters repeat, divide by the factorial of each repeat count, as in the BANANA example above.