Permutation Calculator (nPr)
Enter the total number of items (n) and the number you want to arrange (r). The calculator gives the exact count of ordered arrangements with a full worked solution. Switch modes to handle repetition-allowed or circular permutations in one click.
Formula
Worked example
How many ways can 12 runners finish in 1st, 2nd, and 3rd place? P(12, 3) = 12! / (12-3)! = 12! / 9! = 12 x 11 x 10 = 1,320.
What is a permutation?
A permutation is an ordered arrangement of items chosen from a larger set. The critical point is that order matters: the sequence A-B-C is a different permutation from C-B-A, even though they contain the same items. Awarding gold, silver, and bronze medals to three athletes from a field of ten is a permutation problem, because placing first is not the same as placing second. The standard formula P(n, r) = n! / (n - r)! counts every ordered selection of r items from a set of n distinct items, assuming no item is repeated.
Permutations vs. combinations: when to use each
Combinations count selections where order is irrelevant. The formula is C(n, r) = n! / (r! x (n - r)!). Every combination of r items has exactly r! matching permutations, because the same r items can be arranged among themselves in r! different sequences. For example, C(5, 3) = 10 and P(5, 3) = 60, a ratio of 3! = 6. Use permutations when the position of each item matters: race results, PIN codes, seating arrangements with assigned chairs, and ordered passwords. Use combinations when only membership matters: lottery draws, committee selection, card hands, and subsets without roles.
Permutations with repetition (n^r)
When the same item can appear more than once, the count grows much faster. Each of the r positions is filled independently from the full set of n items, giving n^r total arrangements. A 4-digit PIN using digits 0-9 has 10^4 = 10,000 possible codes. The equivalent permutation without repetition is only P(10, 4) = 5,040. This mode applies to passwords, combination locks, stock-market ticker sequences, or any scenario where an item or symbol may be reused across positions.
Circular permutations: arranging items in a ring
When items are placed in a circle, all pure rotations of the same arrangement are identical. Seating 6 people at a round table yields (6 - 1)! = 5! = 120 distinct arrangements rather than 6! = 720 for a straight line. The logic: fix one person in one seat to break the rotational symmetry, then arrange the remaining n - 1 people in the empty seats in the usual way. This model applies to round-table seating, necklace design where flipping is not considered, and cyclic scheduling. If flipping a necklace also counts as identical (reflections), divide by an additional factor of 2.
Permutation and combination values for common n and r
| n | r | P(n, r) | C(n, r) | Ratio P / C = r! |
|---|---|---|---|---|
| 4 | 2 | 12 | 6 | 2! = 2 |
| 4 | 3 | 24 | 4 | 3! = 6 |
| 5 | 2 | 20 | 10 | 2! = 2 |
| 5 | 3 | 60 | 10 | 3! = 6 |
| 6 | 2 | 30 | 15 | 2! = 2 |
| 6 | 3 | 120 | 20 | 3! = 6 |
| 10 | 2 | 90 | 45 | 2! = 2 |
| 10 | 3 | 720 | 120 | 3! = 6 |
| 10 | 4 | 5040 | 210 | 4! = 24 |
| 52 | 5 | 311,875,200 | 2,598,960 | 5! = 120 |
Computed with P(n, r) = n! / (n - r)! and C(n, r) = n! / (r! x (n - r)!). No repetition.
Frequently asked questions
What is the difference between nPr and nCr?
nPr counts ordered arrangements: the sequence Alice-Bob-Carol is different from Carol-Bob-Alice. nCr counts unordered groups: the set {Alice, Bob, Carol} is the same regardless of order. The relationship is nPr = nCr x r!, so permutations always equal or exceed combinations for the same n and r.
When should I use the "with repetition" mode?
Use n^r when items can be reused across positions. Classic examples are PIN codes (the digit 7 can appear multiple times), combination lock dials, and character-string passwords where any letter can repeat. If each item can only appear once, use the standard nPr formula instead.
Why is a circular permutation (n - 1)! and not n!?
In a circle, rotating the entire group by one seat produces an arrangement that looks exactly the same. There are exactly n such rotations of any arrangement, so n! over-counts by a factor of n. Dividing gives n! / n = (n - 1)!. A simpler way to see it: fix one person in place and arrange the rest, giving (n - 1)! choices for the remaining seats.
What does "order matters" mean in practice?
It means two arrangements are counted as distinct if any item occupies a different position. Awarding first place to Alice and second to Bob is different from awarding first to Bob and second to Alice, even though the same two people receive medals. If you are counting passwords or phone numbers, order clearly matters. If you are forming a committee where all members have equal roles, order does not matter and you want combinations.
How do I calculate permutations of items that are not all distinct (a multiset)?
Use the multinomial formula: n! / (k1! x k2! x ... x km!), where k1, k2, ..., km are the counts of each repeated item. For example, arranging the letters in BANANA (3 A, 2 N, 1 B) gives 6! / (3! x 2! x 1!) = 60 distinct strings. This calculator handles fully distinct items; for multisets, apply the multinomial formula manually.
What is the largest n this calculator handles?
Exact integer results are available up to n = 170 (the maximum for IEEE 754 double-precision factorial). For n above 170, 170! already overflows to Infinity in standard floating point. The result is still meaningful as an approximation displayed in scientific notation. In practice, any permutation count above about 10^15 is useful only as an order-of-magnitude figure.