gizmobench

Permutation Calculator

The thing people come here to settle is whether order matters, so this page never answers half of it: nPr and nCr sit side by side with the factor between them, which for five cards from a deck of 52 is 311,875,200 arrangements against 2,598,960 hands, exactly 120 orders per hand. The three senses of the word are one control apart rather than three different sites: no replacement, with replacement, and a multiset of items you already hold, each with its own formula printed under the answer. Every count is computed in big integers, so it stays exact long after a calculator built on floating point starts rounding its last digits away, and under the number sit the first few arrangements themselves, in order, so a nine-digit count still has something readable behind it.

Permutations311,875,200n = 52, r = 5 · ordered, no replacement · 52!/47!
nPr
311,875,200
Mode

Each item is used at most once, and two arrangements of the same items in a different order are counted separately.

Order matters
311,875,20052!/47!
Order ignored
2,598,96052!/(5! 47!)
Orders per collection
120exact
Digits
9exact integer

52!/47! counts every ordered choice of 5 from 52. Dividing by 5! leaves 2,598,960 choices where order does not matter.

  1. 1 2 3 4 5
  2. 1 2 3 4 6
  3. 1 2 3 4 7
  4. 1 2 3 4 8
  5. 1 2 3 4 9
  6. 1 2 3 4 10

The first 6 of 311,875,200, in lexicographic order.

Worked examples

The three cases this question usually starts from, one per mode. Every figure here is computed by the same code as the answer above, so the examples and the tool can never disagree.

  • 5P3ordered, no replacement
    60
  • 5 items, r = 3, with replacement5^3
    125
  • MISSISSIPPImultiset, 11!/(4! 4! 2!)
    34,650

n and r each read whole numbers up to 10,000. Arrangements are listed only when there are 12 positions or fewer; the count itself is exact at any size, and Copy carries every digit of it.

Accuracy. Exact integer counts throughout, computed in big integers, so a result far past what a float can hold is still correct in its last digit. The three modes are kept separate and labelled, because ordered without replacement, ordered with replacement and multiset arrangements answer genuinely different questions. It counts arrangements and lists only a small illustration of them rather than materialising the set.

Common questions

What is the difference between a permutation and a combination?
A permutation counts arrangements, so the order of what you picked is part of the answer; a combination counts selections, where it is not. Both are on screen at once here. Five cards from a deck of 52 give 311,875,200 ordered deals and 2,598,960 hands, and the readout shows the factor between them, 120, which is 5 factorial: every hand can be dealt in 120 orders.
How do I calculate nPr by hand?
nPr is n!/(n - r)!, which is the same as multiplying the r numbers counting down from n. For 5 items in 3 positions that is 5 x 4 x 3, so 5P3 is 60, and the page prints the formula it used, 5!/2!, under the answer with your own numbers in it. Cancelling the shared factorials by hand is the usual shortcut, and it is what the tool does internally rather than forming the whole of n! first.
What is the permutation formula with repetition?
With replacement every position is filled from the whole set again, so the count is n to the power r rather than a falling product. Five items in three positions give 125, not 60. That is the mode to use for a PIN, a dice roll or a password of fixed length, where a digit can turn up twice. Its order-ignored counterpart is the multiset coefficient, C(n + r - 1, r), which for those numbers is 35, and the factor between the two is not a whole number.
How many ways can you arrange the letters of MISSISSIPPI?
34,650. There are 11 letters, but the four I letters are not told apart from one another, nor are the four S letters or the two P letters, so the count is 11!/(4! 4! 2!). Choose Multiset and type the word: every character is one item, case is kept, and the page prints the formula it built from your letters. Type a list with commas instead, like 4,4,2, and it reads them as multiplicities.
What happens when r is larger than n?
Without replacement the answer is 0, and the page says why: you cannot fill more positions than you have items when nothing is reused. With replacement the same numbers are a real count, because items can repeat, so 3 items in 5 positions give 243. Arranging nothing is 1 rather than 0: 0P0 is one empty arrangement, which is the convention every textbook uses and the one this page follows.
How large can n and r be, and is the answer still exact?
Both read whole numbers up to 10,000, and every answer is an exact integer rather than a rounded one. The largest result that range allows runs to 40,001 digits, and Copy carries every one of those digits along with the formula and both counts. The stage shortens anything past 25 digits to an exponent so it stays readable, and the digit count is shown beside it so you know how much was shortened.
Can I see the arrangements themselves, not just how many?
The first six are listed under the count, in lexicographic order, whenever there are 12 positions or fewer. Past that only the count is shown: 12 positions from a set of 20 already run to 60,339,831,552,000 arrangements, and printing them is not something a page can finish. The count stays exact at any size, which is the part the illustration is there to make concrete rather than replace.
Does anything I type here leave my browser?
No. The arithmetic runs in the page, there is no account and nothing is sent anywhere. The mode, the two numbers and the item list are remembered in this browser so the page opens where you left it, and the Start over button at the top of the page forgets them. With storage blocked the tool still works, it simply does not remember.

Exact integer counts throughout, computed in big integers, so a result far past what a float can hold is still correct in its last digit. The three modes are kept separate and labelled, because ordered without replacement, ordered with replacement and multiset arrangements answer genuinely different questions. It counts arrangements and lists only a small illustration of them rather than materialising the set.