3tej home

Permutations Calculator P(n,k)

Count ordered arrangements of k items chosen from n distinct items.

P(n,k) is the number of ways to arrange k items in order from a pool of n distinct items.

P(n,k)-
Scientific notation-
Digit count-
How is this calculated?

Formula: P(n, k) = n! / (n - k)!. Computed as the product n x (n-1) x (n-2) x ... x (n-k+1) using JavaScript BigInt for exact integer arithmetic. Source: standard combinatorics (Rosen, Discrete Mathematics and Its Applications).

What is the Permutations Calculator?

The Permutations Calculator computes P(n, k), the number of ordered arrangements of k items drawn from n distinct items. The formula is P(n, k) = n! divided by (n minus k)!.

Permutations differ from combinations: order matters. The arrangements {A, B} and {B, A} are counted separately. The tool above accepts n up to 1000, returns the exact integer using JavaScript BigInt, and prints both decimal and scientific notation so very large arrangement counts remain readable.

How the formula works

P(n, k) = n! / (n - k)! = n * (n - 1) * (n - 2) * ... * (n - k + 1) [k factors] Relation: C(n, k) = P(n, k) / k! Full: P(n, n) = n!

The product form is what the tool evaluates: start at n and multiply k descending consecutive integers. P(10, 3) is 10 times 9 times 8, ignoring the cancelled (n - k)! tail of the factorial. Source: Rosen, Discrete Mathematics and Its Applications (8th ed.), Section 6.3.

Worked example: race finish

Ten runners compete; how many distinct first, second, third place orderings are possible?

  1. n = 10 runners, k = 3 medal positions.
  2. P(10, 3) = 10 times 9 times 8 = 720.
  3. Cross check: C(10, 3) = 120 unordered groups of three. Multiply by 3! = 6 to recover the ordered count: 120 times 6 = 720.
  4. If repetition were allowed (which is impossible in a race) the count would be 10^3 = 1,000.
Result: 720 ordered podiums. If you bet at random on a specific gold-silver-bronze line up, your odds are 1 in 720.

Reference table of common permutations

ScenarionkP(n, k)
3 digit PIN, distinct digits103720
3 digit PIN, repeats allowed1031,000 (10^3)
License plate: 3 letters then 3 digits, all distinct26315,600 letters * 720 digits
Race podium (10 runners)103720
Seat 5 people in 5 chairs55120 (5!)
Anagrams of "MISSISSIPPI"111134,650 (multinomial)
Travelling Salesman tours, 12 cities111139,916,800 (fix start)

Common pitfalls

  • Mixing P and C. Permutations count ordered arrangements, combinations unordered subsets. Always ask: does swapping two items create a new outcome? Yes means use P.
  • Repetition forgotten. Without repetition use P(n, k). With repetition use n^k (each of k slots is independent).
  • Identical items. If some items in the pool are indistinguishable, divide n! by the factorial of each repeat count. MISSISSIPPI has 11! / (4! 4! 2! 1!) = 34,650 anagrams.
  • Circular arrangements. Seating n people around a round table is (n - 1)!, not n!, because rotations are equivalent.
  • Overflow. 20! already exceeds the safe integer range in JavaScript. Always use BigInt for n above about 20.

When to use permutations

  • Cryptography: brute force keyspace = (alphabet size)^(key length) when repeats are allowed.
  • Scheduling and routing: Travelling Salesman, job sequencing, tournament brackets.
  • Probability: arranging cards, drawing without replacement, race finishing positions.
  • Linguistics and bioinformatics: counting anagrams, gene orderings, DNA codon arrangements.

Related calculators and references

Frequently asked questions

What is the difference between permutations and combinations?
Permutations count ordered arrangements. Combinations count unordered subsets. P(n, k) = n! / (n - k)! is always k! times larger than C(n, k) = n! / (k! (n - k)!), because each combination produces k! permutations by reordering its members.
How is P(n, k) calculated?
P(n, k) = n! / (n - k)! = n times (n - 1) times (n - 2) times ... times (n - k + 1), a product of exactly k consecutive descending integers starting at n. P(10, 3) = 10 times 9 times 8 = 720. The tool uses BigInt so the answer stays exact for large n.
What is a permutation with repetition?
If repetition is allowed (each position can take any of the n options independently) the count becomes n^k instead of P(n, k). A 4 digit PIN using digits 0 to 9 has 10^4 = 10,000 ordered arrangements with repetition, but only P(10, 4) = 5,040 without.
What about distinguishable arrangements of n items?
The total number of orderings of n distinct items is n! = P(n, n). Five people in a row of 5 chairs: 5! = 120 seating arrangements. If items repeat (k1 of type 1, k2 of type 2 and so on), divide by k1! k2! ... This is the multinomial coefficient.
Where do permutations show up in real problems?
Race finishing orders, password generators, scheduling problems, Travelling Salesman tours, library shelf orderings, and any counting question where the answer changes when you swap two items. They also drive cryptographic key spaces: a 12 character password from a 95 symbol alphabet has 95^12 candidate strings.
Why does P(n, 0) equal 1?
There is exactly one way to arrange zero items, the empty arrangement, and 0! is defined as 1. The product formula P(n, 0) is the empty product, which equals 1 by convention. This keeps the formula consistent across the boundary cases.

Sources

  • Rosen, Kenneth H. (2018). Discrete Mathematics and Its Applications, 8th edition, McGraw Hill, Section 6.3.
  • Graham, Knuth and Patashnik (1994). Concrete Mathematics, 2nd edition, Addison Wesley, Chapter 5.
  • NIST Digital Library of Mathematical Functions, 26.2 Permutations.
  • Cormen, Leiserson, Rivest, Stein (2022). Introduction to Algorithms, 4th edition, Chapter on counting.

Last updated 2026-05-28.