Skip to main content
🔬 Advanced ✨ New

Permutation Calculator – P(n,r) and Combination C(n,r)

Calculate permutations P(n,r) and combinations C(n,r) with step-by-step solutions. Try this free online math calculator for instant, accurate results.

★★★★★ 4.8/5 · 📊 0 calculations · 🔒 Private & free

Permutations vs. Combinations: When Order Matters

A permutation is an arrangement of items where order matters. A combination is a selection where order does not matter. This single distinction determines which formula to use — and which problems each formula solves.

Classic example: you have 5 people and need to choose 3. If order matters (e.g., 1st, 2nd, 3rd place in a race), use P(5,3) = 60. If order doesn't matter (e.g., choosing 3 committee members), use C(5,3) = 10. The same selection of Alice, Bob, Carol counts as 1 combination but 6 different permutations (ABC, ACB, BAC, BCA, CAB, CBA).

n (items)r (selected)P(n,r) orderedC(n,r) unordered
42126
522010
536010
103720120
10530,240252
525311,875,2002,598,960

The ratio P(n,r) / C(n,r) = r! — the number of ways to arrange r items. For r=3, each combination corresponds to 3! = 6 permutations. For r=5, each combination corresponds to 5! = 120 permutations, explaining why the 5-card poker hand count is 311,875,200 ÷ 120 = 2,598,960.

The Formulas: P(n,r) and C(n,r)

Both formulas are based on the factorial function: n! = n × (n−1) × (n−2) × ... × 2 × 1. By convention, 0! = 1.

Permutation formula: P(n,r) = n! / (n−r)!

This counts ordered arrangements. The denominator (n−r)! cancels out the items not chosen. For P(5,3): 5! / (5−3)! = 120 / 2 = 60.

Combination formula: C(n,r) = n! / (r! × (n−r)!)

The additional r! in the denominator removes the ordering of chosen items. For C(5,3): 5! / (3! × 2!) = 120 / (6 × 2) = 10.

Alternative combination notation: C(n,r) is also written as ⁿCᵣ, C(n,r), or the binomial coefficient notation (n choose r) using parentheses. All mean the same thing.

nn!
01
11
22
36
424
5120
6720
75,040
840,320
103,628,800
12479,001,600

Real-World Examples of Permutations

Permutations apply whenever the arrangement or order of selection matters:

Real-World Examples of Combinations

Combinations apply when the selection is what matters, not the order:

Pascal's Triangle and Binomial Coefficients

The combination values C(n,r) — also called binomial coefficients — form Pascal's Triangle, where each entry is the sum of the two entries above it:

nC(n,0)C(n,1)C(n,2)C(n,3)C(n,4)C(n,5)
01
111
2121
31331
414641
515101051

Pascal's Triangle has remarkable properties: each row sums to 2ⁿ (the total number of subsets of an n-element set). The triangle encodes the coefficients of the binomial expansion: (a+b)³ = 1a³ + 3a²b + 3ab² + 1b³, using the third row of the triangle. The combination C(n,r) counts the number of paths through a grid, the number of subsets of size r from an n-element set, and the coefficients in the binomial theorem.

The symmetry property C(n,r) = C(n, n−r) is visible in Pascal's Triangle — each row reads the same forward and backward. This makes sense: choosing which r items to include is equivalent to choosing which (n−r) items to exclude.

Permutations with Repetition and Multisets

The standard P(n,r) and C(n,r) formulas assume items are distinct and not replaced (no repetition). When the rules change, different formulas apply:

Counting problemFormulaExample
Permutation, no repetitionP(n,r) = n!/(n−r)!3-horse race from 8: P(8,3)=336
Permutation with repetition3-digit code from 10 digits: 10³=1,000
Combination, no repetitionC(n,r) = n!/(r!(n−r)!)5 cards from 52: C(52,5)=2,598,960
Combination with repetitionC(n+r−1, r)3 scoops from 5 flavors: C(7,3)=35
Permutation of multisetn!/(n₁!n₂!...nk!)Arrangements of MISSISSIPPI: 11!/(4!4!2!1!)=34,650

The word "MISSISSIPPI" example illustrates multiset permutations: with 11 letters total (4 S's, 4 I's, 2 P's, 1 M), the number of distinct arrangements is 11! divided by the factorials of each repeated letter count. Without accounting for repeats, you'd overcount each arrangement 4!×4!×2! = 1,152 times.

Permutations and Combinations in Probability

Permutations and combinations are the foundation of classical probability: P(event) = (favorable outcomes) ÷ (total equally likely outcomes). This requires counting both the favorable and total outcomes correctly.

Probability of a royal flush in poker: There are 4 royal flushes (one per suit) out of C(52,5) = 2,598,960 total hands. Probability = 4/2,598,960 ≈ 0.000154% — about 1 in 649,740.

Birthday problem: In a group of n people, the probability at least two share a birthday uses permutations of 365 days: P(no shared birthday) = 365 × 364 × 363 × ... × (365−n+1) / 365ⁿ. For n=23 people, this probability drops below 50%, meaning there's a better-than-even chance of a shared birthday in a room of 23 people — a result most people find surprising.

Anagram probability: In a random arrangement of the letters in "APPLE," the probability of getting "APPLE" specifically is 1/60 (since 5!/2! = 60 distinct arrangements, dividing by 2! for the two P's). The probability of getting any arrangement starting with A is 4!/2! / 5!/2! = 12/60 = 1/5, as expected by symmetry.

Frequently Asked Questions

When do I use permutation vs combination?

Use permutation when order matters: passwords, race finishes, seating arrangements, scheduling. Use combination when order doesn't matter: lottery numbers, committee selection, card hands, pizza toppings. Ask yourself: "Would rearranging the selection give a different outcome?" If yes, use permutation. If no, use combination.

What is 0! (zero factorial)?

By mathematical convention, 0! = 1. This makes formulas like C(n,0) = 1 consistent — there is exactly one way to choose nothing from a set (the empty selection). It also makes the formula P(n,n) = n!/0! = n!/1 = n! work correctly for arranging all n items.

What is P(10,3)?

P(10,3) = 10! / (10−3)! = 10! / 7! = 10 × 9 × 8 = 720. This is the number of ordered ways to choose 3 items from 10 distinct items — such as awarding gold, silver, and bronze medals in a 10-person competition.

What is C(10,3)?

C(10,3) = 10! / (3! × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120. This is the number of ways to choose any 3 items from 10 distinct items — such as selecting a 3-person subcommittee from a 10-person committee.

What does it mean when P(n,r) is much larger than C(n,r)?

P(n,r) / C(n,r) = r!, the number of ways to arrange r items. The larger r is, the bigger this ratio becomes. For r=5, permutations are 120 times more than combinations. This reflects that order dramatically multiplies the number of distinct arrangements when r is large.

How many ways can 5 people sit in a row?

5 people in a row (all seated, order matters) = P(5,5) = 5! = 120 ways. The first seat can be filled 5 ways, the second 4 ways, then 3, 2, 1 — giving 5×4×3×2×1 = 120. For a circular arrangement, it would be (5−1)! = 24 ways.

What are the odds of winning the lottery?

Lottery odds depend on the game. For a pick-6 from 49 numbers: C(49,6) = 13,983,816 — about 1 in 14 million. For Powerball (5 from 69 + 1 from 26): C(69,5) × 26 = 292,201,338 — about 1 in 292 million. These combinations explain why jackpot wins are exceedingly rare.

Can you compute permutations for large numbers?

Factorials grow extremely fast: 20! ≈ 2.4 × 10^18, 100! has 158 digits. For large n and r, direct factorial computation overflows standard integer types. This calculator uses JavaScript's 64-bit floating point, which gives exact results for P(n,r) up to about n=20 and approximate results beyond that. For exact large-number combinatorics, use big integer libraries.

What is the difference between permutation and arrangement?

They mean the same thing in combinatorics — both refer to ordered selections from a set. "Arrangement" is sometimes used informally; "permutation" is the formal mathematical term. P(n,r) counts the number of r-element ordered arrangements from an n-element set.

How is Pascal's Triangle related to combinations?

Pascal's Triangle is constructed by placing C(n,r) values in a triangular array where row n contains C(n,0), C(n,1), ..., C(n,n). Each value equals the sum of the two values above it: C(n,r) = C(n−1,r−1) + C(n−1,r). This identity (Pascal's Rule) gives the triangle its structure and connects combinations to the binomial theorem coefficients.

Step-by-Step Permutation and Combination Problems

Mastering permutations and combinations requires working through problems systematically. The key decision is always: does order matter? Once that's settled, apply the appropriate formula and simplify. Here are worked examples covering typical problem types.

Problem 1: Race medals. In a race with 12 runners, how many ways can gold, silver, and bronze medals be awarded?
Order matters (gold ≠ silver ≠ bronze), so use P(12,3).
P(12,3) = 12! / (12−3)! = 12 × 11 × 10 = 1,320 ways.

Problem 2: Committee selection. From a class of 20 students, a teacher selects 4 for a project. How many different groups are possible?
Order doesn't matter (any 4 students form the same group), so use C(20,4).
C(20,4) = 20! / (4! × 16!) = (20 × 19 × 18 × 17) / (4 × 3 × 2 × 1) = 116,280 / 24 = 4,845 groups.

Problem 3: Password security. A password requires 2 uppercase letters followed by 4 digits (no repetition allowed). How many passwords are possible?
For letters: order matters, P(26,2) = 26 × 25 = 650.
For digits: order matters, P(10,4) = 10 × 9 × 8 × 7 = 5,040.
Total (by multiplication principle): 650 × 5,040 = 3,276,000 passwords.

Problem 4: Card dealing. From a standard 52-card deck, how many different 5-card hands contain exactly 3 aces?
Choose 3 aces from 4: C(4,3) = 4.
Choose 2 non-aces from 48: C(48,2) = 48 × 47 / 2 = 1,128.
Total: 4 × 1,128 = 4,512 hands with exactly 3 aces.

Problem 5: Circular seating. How many ways can 6 people sit around a round table?
In circular arrangements, one person's position is fixed (to eliminate rotational equivalents), leaving 5 people to arrange: (6−1)! = 5! = 120 ways.
If the table also has distinguishable seats (e.g., one has an armrest), it becomes 6! = 720 (linear permutation).

The multiplication principle: All multi-step counting problems use the fundamental multiplication principle: if step A can be done in m ways and step B can be done in n ways (independently), then both A and B together can be done in m × n ways. This principle underlies all permutation and combination formulas — P(n,r) is just the product n × (n−1) × ... × (n−r+1), and C(n,r) divides by r! to remove the over-counting of order.

When solving any counting problem: (1) Identify if order matters. (2) Check if repetition is allowed. (3) Identify if the items are distinguishable. (4) Break complex problems into sequential steps using the multiplication principle. (5) Apply P(n,r) or C(n,r) as appropriate, or use specialized formulas for circular arrangements, multisets, or repeated elements.

Verification strategies: Always sanity-check combinatorial results. C(n,r) should equal C(n, n−r) by the symmetry property — choosing r items to include is the same as choosing n−r items to exclude. P(n,r) should be divisible by r! (since dividing P(n,r) by r! gives C(n,r)). For small values, you can enumerate possibilities directly to verify a formula gives the right count. Building this intuition for checking your work prevents errors in high-stakes situations like engineering design counts, security parameter calculations, or statistical analysis.

Finally, when the numbers get very large, use logarithms to estimate. log₁₀(P(52,5)) = log₁₀(52!) − log₁₀(47!) = log₁₀(52×51×50×49×48) ≈ 8.494, so P(52,5) ≈ 10^8.494 ≈ 311,875,200 — confirmed. For probability calculations, working in log-probabilities prevents numerical underflow when probabilities are astronomically small (as in shuffled deck arrangements: 52! ≈ 8.07 × 10^67 possible orderings). The ability to reason about these enormous numbers using logarithms and combinatorial intuition is a mark of mathematical maturity and statistical thinking.

Permutations and combinations are taught in precalculus and probability courses because they are the gateway to understanding probability, statistics, and discrete mathematics. Beyond the classroom, they are indispensable in computer science (algorithm analysis, data structure design), genetics (counting genotype combinations), chemistry (molecular isomers), and game design (balance and fairness analysis). Every lottery odds calculation, every password security analysis, every sports ranking system, and every experimental design for clinical trials relies on this fundamental counting theory. Investing the time to truly understand permutations and combinations — not just memorizing the formulas but developing intuition for when to apply each — pays dividends across virtually every quantitative discipline. Use this calculator to check your work, build intuition with different values of n and r, and verify your reasoning on the problems you encounter.