Combinatorics & Math 🇺🇸 USA🇬🇧 UK Live ResultsnPr & nCr
Calculate

Permutation and Combination Calculator

Calculate nPr permutations and nCr combinations with or without repetition. Includes factorial values, Pascal's triangle row, and real-world examples like lottery odds and password combinations.

Permutation & Combination Inputs

Live
Enter n (total items) and r (items chosen). Select mode. Toggle repetition to see "with repetition" variants alongside standard formulas.
Max 170 (factorial limit)
Must be 0 ≀ r ≀ n

Results

β€”
nPr (Permutation)
β€”
Enter values above to calculate
nCr for all r from 0 to n (Pascal's Row)
nPr vs nCr Comparison

Permutation & Combination Guide

Guide

Permutations vs Combinations: The Core Difference

The fundamental difference between permutations and combinations is whether order matters. In a permutation, the order of selection matters β€” ABC is different from BAC. In a combination, only the selection matters β€” {A,B,C} and {B,A,C} are the same group.

Memory trick: Think of a combination lock β€” it should really be called a "permutation lock" because the order of digits matters! {3,5,7} is not the same as {7,5,3}.

nPr = n! / (nβˆ’r)!    (ordered selection)
nCr = n! / (r! Γ— (nβˆ’r)!)    (unordered selection)

What Is a Factorial?

The factorial of a non-negative integer n (written n!) is the product of all positive integers up to n: n! = n Γ— (nβˆ’1) Γ— (nβˆ’2) Γ— ... Γ— 2 Γ— 1. By convention, 0! = 1.

  • 0! = 1, 1! = 1, 2! = 2, 3! = 6, 4! = 24, 5! = 120
  • 10! = 3,628,800; 20! = 2,432,902,008,176,640,000
  • 170! is the largest factorial that fits in a 64-bit float

Permutation Examples (Without Repetition)

Example 1: Race finish order. In a race of 8 runners, how many ways can the top 3 finish? This is P(8,3) = 8! / (8βˆ’3)! = 8 Γ— 7 Γ— 6 = 336 ordered outcomes.

Example 2: Password. A PIN uses 4 digits from 0–9, no repeats. nP4 from 10 = 10 Γ— 9 Γ— 8 Γ— 7 = 5,040 possible PINs.

Combination Examples (Without Repetition)

Example 1: Lottery. The UK National Lottery requires choosing 6 numbers from 59. C(59,6) = 59! / (6! Γ— 53!) = 45,057,474. Your odds of winning the jackpot are approximately 1 in 45 million.

The US Powerball lottery draws 5 white balls from 69 and 1 red ball from 26: C(69,5) Γ— C(26,1) = 11,238,513 Γ— 26 = 292,201,338. Odds: about 1 in 292 million.

Example 2: Team selection. From 15 players, how many ways can a manager select a squad of 11? C(15,11) = C(15,4) = 1,365 different squads.

Poker Hands β€” Combinations in Practice

HandCombinationsProbability
Royal Flush41 in 649,740
Straight Flush361 in 72,193
Four of a Kind6241 in 4,165
Full House3,7441 in 694
Flush5,1081 in 509
Two Pair123,5521 in 21
Any 5-card handC(52,5) = 2,598,960β€”

With Repetition Variants

Permutation with repetition: n^r. If you have 26 letters and want 4-letter passwords with repeats allowed: 26⁴ = 456,976.

Combination with repetition: C(n+rβˆ’1, r) = (n+rβˆ’1)! / (r! Γ— (nβˆ’1)!). For example, choosing 3 flavours of ice cream from 5 options with repeats allowed: C(5+3βˆ’1, 3) = C(7,3) = 35.

Pascal's Triangle

Pascal's triangle is a triangular array where each element equals the sum of the two directly above it. The n-th row gives all values of C(n, r) for r = 0 to n. Row 4: 1, 4, 6, 4, 1 β€” these are C(4,0), C(4,1), C(4,2), C(4,3), C(4,4). The sum of the n-th row equals 2^n.

Pascal's triangle appears in the binomial theorem: (a + b)^n = Ξ£ C(n,k) Γ— a^(n-k) Γ— b^k. This is why combinations are called "binomial coefficients."

UK GCSE and A-Level Mathematics

Permutations and combinations appear in the UK A-level Mathematics and Further Mathematics specifications under Statistics and Discrete Mathematics modules. Students are expected to use factorial notation and apply nPr and nCr in probability problems.

The AQA, Edexcel, and OCR A-level syllabi all include combinatorics, with probability questions often involving selections without replacement (combinations) or arrangements (permutations).

US AP Statistics and Precalculus

In the United States, combinatorics is taught in Precalculus and AP Statistics. The AP Statistics exam includes probability questions requiring knowledge of counting techniques, while AP Calculus BC sometimes uses binomial coefficients in Taylor series. The Common Core Standards also reference combinations and permutations in high school statistics units.

Frequently Asked Questions

FAQ
What is the difference between a permutation and a combination?

In a permutation, order matters: ABC β‰  BAC. In a combination, order does not matter: {A,B,C} = {B,A,C}. Use permutations for arrangements (race results, passwords); use combinations for selections (team members, lottery numbers).

What does nPr mean?

nPr (also written P(n,r)) is the number of ways to arrange r items chosen from n distinct items, where order matters. Formula: nPr = n! / (nβˆ’r)!. For P(5,2) = 5!/3! = 20.

What does nCr mean?

nCr (also written C(n,r) or "n choose r") is the number of ways to choose r items from n, where order does not matter. Formula: nCr = n! / (r! Γ— (nβˆ’r)!). C(5,2) = 10.

What are the odds of winning the UK National Lottery?

The UK Lotto requires matching 6 from 59 numbers: C(59,6) = 45,057,474. The probability of winning the jackpot is approximately 1 in 45,057,474 (about 1 in 45 million).

How is "with repetition" different?

Without repetition, once an item is chosen it cannot be chosen again. With repetition, items can be reused. Permutation with repetition = n^r; Combination with repetition = C(n+r-1, r).

What is Pascal's triangle and how does it relate to combinations?

Pascal's triangle is a number triangle where each entry is the sum of the two above it. The n-th row (starting from row 0) contains the values C(n,0), C(n,1), ..., C(n,n). The total of row n equals 2^n.

Why is 0! equal to 1?

By convention and mathematical consistency. There is exactly one way to arrange zero items (do nothing), which is 1. It also makes formulas like nCn = n!/(n!Γ—0!) = 1 work correctly, representing the one way to choose all items.

What is the largest n this calculator can handle?

The calculator handles n up to 170 due to JavaScript's 64-bit floating-point limit (170! β‰ˆ 7.26 Γ— 10^306). For larger values, specialised arbitrary-precision software is needed. Results beyond about n=20 are shown in scientific notation for clarity.

Disclaimer

Results are for educational purposes. Large values (n > 100) may show floating-point rounding. This calculator uses standard combinatorial formulas and JavaScript number precision.

nPr
β€”