P(n,k) Permutations Calculator — nPr Formula
The P(n,k) Permutations Calculator — also called nPr — computes the number of ordered arrangements of k items chosen from n distinct items. Unlike combinations, order matters: picking {A, B} is different from {B, A}. The formula is P(n,k) = n! / (n−k)!, which equals n × (n−1) × … × (n−k+1). Use this for race podiums, PIN codes without repetition, password generation, scheduling, and any problem where sequence or rank matters.
Permutations P(n,k) — also written nPr — counts the ordered arrangements of k items chosen from n distinct items. Formula: P(n,k) = n! / (n−k)! = n × (n−1) × … × (n−k+1). Key values: P(5,2)=20, P(8,3)=336, P(10,4)=5,040, P(26,3)=15,600. Order matters: {A,B} ≠ {B,A}.
When to use this calculator
- 4-digit PIN codes from digits 0–9 with no repetition: P(10,4) = 5,040 possible PINs.
- Gold/silver/bronze podium from 8 runners: P(8,3) = 336 distinct outcomes.
- Ordered seating of 5 guests at 5 chairs: P(5,5) = 5! = 120 arrangements.
- 3-letter codes from 26 letters without repetition: P(26,3) = 15,600 distinct codes.
- Scheduling 4 job interviews from 10 candidates in a specific time-slot order: P(10,4) = 5,040.
Worked Example — Race Podium P(8,3)
- 8 runners compete; 3 podium positions (gold, silver, bronze)
- P(8, 3) = 8 × 7 × 6 = 336
- There are 336 distinct podium outcomes
How it works
3 min readHow to Calculate P(n,k)
The permutation formula counts ordered selections — every change in sequence produces a distinct result.
P(n, k) = n! / (n − k)!
= n × (n−1) × (n−2) × … × (n−k+1)
Where:
n = total number of distinct items in the pool (n ≥ 0)
k = number of items chosen / positions filled (0 ≤ k ≤ n)
! = factorial operator (e.g., 5! = 5×4×3×2×1 = 120)
Special cases:
P(n, 0) = 1 (exactly one way to choose nothing)
P(n, n) = n! (arrange all items — full permutation)
P(0, 0) = 1 (convention)Step-by-step — P(5, 2):
1. n = 5, k = 2 → expand 2 factors from n
2. P(5, 2) = 5 × 4 = 20
Alternatively: 5! / (5−2)! = 120 / 6 = 20 ✓
---
Reference Table — Common P(n,k) Values
| n \ k | k = 1 | k = 2 | k = 3 | k = 4 | k = 5 |
|---|---|---|---|---|---|
| 3 | 3 | 6 | 6 | — | — |
| 4 | 4 | 12 | 24 | 24 | — |
| 5 | 5 | 20 | 60 | 120 | 120 |
| 6 | 6 | 30 | 120 | 360 | 720 |
| 8 | 8 | 56 | 336 | 1,680 | 6,720 |
| 10 | 10 | 90 | 720 | 5,040 | 30,240 |
| 26 | 26 | 650 | 15,600 | 358,800 | 7,893,600 |
| 52 | 52 | 2,652 | 132,600 | 6,497,400 | 311,875,200 |
> Tip: P(n,k) grows much faster than C(n,k) because order matters. P(10,4) = 5,040 vs C(10,4) = 210 — a 24× difference.
---
Typical Cases
Case 1 — Race Podium
8 runners compete; how many ways can gold, silver, and bronze be awarded?
P(8, 3) = 8 × 7 × 6 = 336There are 336 distinct podium outcomes. Each reversal of any two positions counts as a different result.
Case 2 — 4-Digit PIN (no repeated digits)
A 4-digit PIN from {0–9}, no repetition:
P(10, 4) = 10 × 9 × 8 × 7 = 5,0405,040 unique PINs without digit repetition (compare to 10⁴ = 10,000 with repetition).
Case 3 — 3-Letter Codes from Alphabet
3-character codes from 26 uppercase letters, no repetition:
P(26, 3) = 26 × 25 × 24 = 15,60015,600 distinct ordered codes.
---
P(n,k) vs C(n,k) — When to Use Which
| Scenario | Formula | Why |
|---|---|---|
| Race podium (ranks matter) | P(n,k) | Position 1 ≠ Position 2 |
| Committee members (no roles) | C(n,k) | {Alice, Bob} = {Bob, Alice} |
| PIN code without repetition | P(n,k) | 1234 ≠ 4321 |
| Lottery ticket (pick 6 of 49) | C(n,k) | Order of drawn balls irrelevant |
| Password with distinct chars | P(n,k) | Sequence defines the password |
Key identity: C(n,k) = P(n,k) / k!
---
Common Mistakes
1. Confusing P(n,k) with C(n,k): If order doesn't matter, use C(n,k) = P(n,k)/k!. A 3-person committee (no roles) = C(10,3) = 120, not P(10,3) = 720.
2. Allowing repetition when the problem forbids it: P(n,k) assumes no repetition. If digits can repeat, the count is nᵏ (e.g., 10⁴ = 10,000 PINs with repetition).
3. Setting k > n: P(n,k) = 0 when k > n — you cannot arrange more items than exist in the pool without repetition.
4. Forgetting P(n,n) = n!: Arranging all items gives n! — e.g., 5 books on a shelf = P(5,5) = 120.
5. Circular vs. linear permutations: For a round table, use (n−1)! not n!. This calculator computes linear (sequential) permutations only.
---
Related Calculators
Frequently asked questions
What is P(n,k) in permutations?
P(n,k) — also written nPr — is the number of ordered arrangements of k items chosen from n distinct items, with no repetition. Formula: P(n,k) = n! / (n−k)! = n × (n−1) × … × (n−k+1). It differs from C(n,k) (combinations) because here {A,B} ≠ {B,A} — order matters.
What is the difference between P(n,k) and C(n,k)?
P(n,k) counts ordered arrangements — {A,B} ≠ {B,A}. C(n,k) counts unordered selections — {A,B} = {B,A}. Mathematically, C(n,k) = P(n,k) / k!. For example, P(5,3) = 60 but C(5,3) = 10. Use P when position or rank matters (podiums, passwords); use C when it doesn't (committees, lottery tickets).
What does nPr mean and how do I calculate it?
nPr is another notation for P(n,r) or P(n,k) — permutations of n items taken r at a time. Calculation: multiply k descending factors starting from n. Example: 10P4 = 10 × 9 × 8 × 7 = 5,040. On a scientific calculator, use the nPr key. In Excel, use =PERMUT(n,k).
What happens when k = 0 in P(n,k)?
P(n,0) = 1 for any n ≥ 0. There is exactly one way to arrange zero items: do nothing. This follows from 0! = 1, so P(n,0) = n!/n! = 1. It keeps probability formulas internally consistent.
Can P(n,k) be used when repetition is allowed?
No — P(n,k) = n!/(n−k)! assumes no repetition (sampling without replacement). If repetition is allowed, the count is nᵏ. For example, 3-digit codes from 10 digits with repetition = 10³ = 1,000; without = P(10,3) = 720.
How do I calculate P(n,k) for large numbers without overflow?
Use logarithms: log P(n,k) = Σ log(i) for i from (n−k+1) to n. Or compute iteratively: start at 1 and multiply n, n−1, n−2, … down to (n−k+1), performing exactly k multiplications. Excel: =PERMUT(n,k). Python: math.perm(n,k). Both handle large values natively.
What is the real-world significance of P(10,4) = 5,040 for PIN codes?
A 4-digit PIN from 0–9 without repetition has 5,040 possibilities vs. 10,000 with repetition. Removing repeated digits actually reduces security by ~50%. This is why most bank systems allow digit repetition — it maximizes the keyspace. NIST SP 800-63B recommends PINs of at least 6 digits.
How are permutations used in probability?
Permutations define the sample space for ordered outcomes. The probability of one specific arrangement = 1/P(n,k). Example: the chance of guessing the exact 1st/2nd/3rd place in a race of 8 runners = 1/P(8,3) = 1/336 ≈ 0.30%. Used in card games, cryptography, and lottery analysis.
What is the difference between linear and circular permutations?
Linear permutations use P(n,k) = n!/(n−k)!. Circular permutations of all n items use (n−1)! because one position is fixed (rotations of the same sequence are identical). Seating 5 people at a round table = (5−1)! = 24 ways, not 5! = 120. This calculator computes linear permutations only.