Binomial Coefficient Calculator
Calculate nCr and nPr values with Pascal's triangle row visualization.
About this calculator
Given n (a total number of items) and r (how many to choose from that total), this calculator returns two related counts: C(n, r), the number of unordered r-item combinations, and P(n, r), the number of ordered r-item arrangements — permutations, which count every different ordering of the same chosen items separately and so is always at least as large as the combination count. Raising n while r stays fixed increases both counts, since a larger pool of items to choose or arrange from always creates at least as many, and typically far more, possible selections. Underneath, C(n, r) is computed with a multiplicative formula that exploits the symmetry C(n, r) equals C(n, n − r), always working with whichever of r or n − r is smaller to keep the running product as small as possible, while P(n, r) is computed through a more direct pair of factorials.
The n field is capped at 170, matching the classic point where a raw JavaScript factorial calculation overflows to an unusable infinite value one step further at 171 — though for a value of r sitting near half of n, both C(n, r) and P(n, r) can grow astronomically long before n approaches that cap, at which point the displayed digits are a floating-point approximation rather than an exactly-tracked integer. One thing this calculator skips: the Pascal's-triangle-row chart never shows more than 20 entries even when n is large, quietly truncating the row rather than compressing or scrolling through the full width of it.
Inputs
Results
C(n, r)
120
P(n, r)
720
How to Use This Calculator
- Enter n (the total number of items) in the top field.
- Enter r (the number of items to choose) — must satisfy 0 <= r <= n.
- Review C(n, r) — the number of r-combinations — and P(n, r) — the number of r-permutations.
- Check the Pascal Row Length to see where C(n, r) falls in Pascal's triangle.
- Use these values in probability, combinatorics proofs, or algorithm analysis.
How the result changes with n (total)
| n (total) | C(n, r) | P(n, r) |
|---|---|---|
| 5 | 10 | 60 |
| 7.5 | 56 | 336 |
| 15 | 455 | 2,730 |
| 25 | 2,300 | 13,800 |
What each input means
- n (total)
- Total number of items (row of Pascal's triangle)
- r (choose)
- Number of items to choose (column in Pascal's triangle)
How this is calculated
Worked example, using the default values
- Identify Input Parametersn (total) = 10, r (choose) = 3 = 2 input(s) provided
- Calculate CC120 = 120
- Calculate PP720 = 720
- Calculate Pascal Row Length11 = 11
Engine last updated . Checked against 5 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why is P(n, r) always at least as large as C(n, r)?
C(n, r) counts groups of r items where order doesn't matter, while P(n, r) counts the same selections but treats every different ordering as a separate outcome. Since each group of r items can be arranged in more than one order whenever r is greater than one, P(n, r) counts every one of those orderings separately, making it equal to or larger than C(n, r) in every case.
Why is n capped at 170?
That is the boundary where a plain factorial calculation in JavaScript's floating-point number type stops producing a finite result — one step further, at 171, the raw factorial already overflows to an unusable infinite value. Capping the input at 170 keeps every internal calculation finite, even though the largest combination and permutation values near that cap are floating-point approximations rather than exact whole numbers.
Why does the calculator compute C(n, r) using n minus r when r is close to n?
C(n, r) and C(n, n − r) are always mathematically identical — choosing which r items to include is the same information as choosing which n − r items to leave out. The calculator always works with whichever of the two numbers is smaller, which keeps the multiplication loop shorter and the running product smaller, without changing the final answer at all.
Does the Pascal's triangle chart show the entire row for a large n?
No. It always caps out at 20 entries regardless of how large n is, so for any n of 20 or higher you are seeing only the first 20 columns of that row rather than the complete, much wider triangle row. The numeric C(n, r) and P(n, r) results above the chart are not affected by this and reflect your actual r value.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Permutations & Combinations Calculator
Calculate permutations and combinations with or without repetition for any n and r values.
Discrete MathematicsCatalan Number Calculator
Calculate Catalan numbers and their combinatorial interpretations including binary trees and lattice paths.
Discrete MathematicsChromatic Number Estimator
Estimate the chromatic number of a graph using Brook's theorem and greedy coloring bounds.
More in Math & Statistics.