Permutation & Combination Calculator

Calculate P(n,r) and C(n,r), with and without repetition, compare all four variants, visualize Pascal's triangle, and explore the computation table.

P(n,r)
5,040
10! / (10-4)! — ordered, no repetition
C(n,r)
210
10! / (4! × (10-4)!) — unordered, no repetition
P(n,r) with rep
10,000
n^r = 10^4 — ordered, with repetition
C(n+r-1,r)
715
(10+4-1)! / (4!×(10-1)!) — unordered, with repetition
P(n,r) / C(n,r)
24
r! = 4! — number of orderings per combination
C(n,r)/C(n,r) Symmetry
C(10,4) = C(10,6)
Both = 210

Pascal's Triangle (rows 0–10)

1
11
121
1331
14641
15101051
1615201561
172135352171
18285670562881
193684126126843691
1104512021025221012045101
Highlighted: C(10,4) = 210

Comparison Table (n = 10)

rP(n,r)C(n,r)P repC rep
01111
110101010
2904510055
37201201,000220
45,04021010,000715
530,240252100,0002,002
6151,2002101,000,0005,005
7604,80012010,000,00011,440
81,814,40045100,000,00024,310
93,628,800101,000,000,00048,620
103,628,800110,000,000,00092,378
Planning notes, formulas, and examples

About the Permutation & Combination Calculator

Permutations and combinations are the two pillars of combinatorics — the mathematics of counting, arranging, and selecting. A permutation counts the number of ways to arrange r items from n where order matters; a combination counts selections where order doesn't matter.

This calculator computes all four variants: permutations and combinations, each with and without repetition. P(n,r) = n!/(n−r)! counts ordered arrangements. C(n,r) = n!/(r!(n−r)!) counts unordered selections (binomial coefficients). With repetition, P = nʳ and C = C(n+r−1, r). The interactive Pascal's triangle highlights your chosen C(n,r), and a comparison table shows all values for every r from 0 to n.

These formulas are essential in probability (sample spaces), statistics (hypothesis testing), cryptography (key space analysis), genetics (allele combinations), algorithm analysis (complexity bounds), and everyday problems like lottery odds, committee selection, and tournament brackets. The binomial coefficient C(n,r) is also the coefficient of xʳ in (1+x)ⁿ, connecting combinatorics to algebra.

When This Page Helps

Factorials grow extremely fast — 20! already exceeds 2.4 × 10¹⁸ — making manual calculation impractical for even moderate values of n. Comparing all four variants (P and C, with and without repetition) requires multiple factorial computations and careful formula selection. This calculator computes P(n,r), C(n,r), and their repetition variants, highlights your value on Pascal's triangle, and provides a comparison table across all r values so you can see patterns at a glance. Whether you're calculating lottery odds, committee selections, or sample spaces for probability, the page cuts down arithmetic overhead and checking time.

How to Use the Inputs

  1. Enter n (total number of objects) and r (number of selections).
  2. Choose whether to display permutations, combinations, or both.
  3. Select repetition mode: without, with, or compare both.
  4. Use presets for common scenarios like poker hands (52 choose 5).
  5. Review all four computed values in the output cards.
  6. Check Pascal's triangle to find your C(n,r) visually.
  7. Use the comparison table to see how values change with different r.
Formula used
P(n,r) = n! / (n−r)! C(n,r) = n! / (r! · (n−r)!) P rep = nʳ C rep = C(n+r−1, r)

Example Calculation

Result: P(10,4) = 5,040; C(10,4) = 210

10 × 9 × 8 × 7 = 5,040 ordered arrangements. Dividing by 4! = 24 gives 210 unordered combinations.

Tips & Best Practices

  • C(n,r) = C(n, n−r) — choosing r items is equivalent to choosing which n−r to leave out.
  • P(n,r) = C(n,r) × r! — each combination has r! orderings.
  • C(n,0) = C(n,n) = 1 — there's exactly one way to choose nothing or everything.
  • The sum of row n in Pascal's triangle equals 2ⁿ.
  • For large n, use the logarithm of factorials to avoid overflow.

Permutations vs. Combinations: When Order Matters

The central question in any counting problem is: does order matter? Arranging 3 books on a shelf is a permutation problem (ABC ≠ BAC), while choosing 3 books to read is a combination problem (the set {A,B,C} is the same regardless of order). P(n,r) = C(n,r) × r!, meaning each unordered selection of r items can be arranged in r! ways. For 52-card poker: C(52,5) = 2,598,960 possible hands, but P(52,5) = 311,875,200 possible ordered deals.

Pascal's Triangle and the Binomial Theorem

Pascal's triangle is an infinite triangular array where each entry equals C(n,r). Row n contains the binomial coefficients for expanding (a+b)ⁿ. Key properties: the sum of row n equals 2ⁿ (total subsets of an n-element set), and C(n,r) = C(n−1,r−1) + C(n−1,r) gives the recursive construction. Pascal's triangle also encodes Fibonacci numbers (diagonal sums), hockey stick identities, and Catalan number relationships. It appears throughout probability, algebra, and number theory.

Real-World Applications of Combinatorics

Lottery odds use C(n,r) directly: a 6/49 lottery has C(49,6) = 13,983,816 outcomes. In genetics, C(n,r) counts genotype combinations. In networking, C(n,2) gives the number of handshakes or connections between n nodes. Committee selection from a group, pizza topping combinations, and tournament bracket arrangements are all combination problems. Cryptographic key spaces, error-correcting codes (Hamming codes use binomial coefficients), and statistical sampling distributions all rely on permutation and combination formulas.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Permutations count ordered arrangements (ABC ≠ BCA). Combinations count unordered selections (ABC = BCA). P(n,r) = C(n,r) × r!.