Binomial Coefficient Calculator

Enter n and k to get the exact binomial coefficient C(n, k) — the number of ways to choose k items from n when order does not matter — plus the ordered permutation count and the factorial that links them.

#math#combinatorics#binomial#n-choose-k#probability

A non-negative whole number, up to 1,000.

A whole number no larger than n. Order does not matter.

C(10, 3) — ways to choose

120

Permutations 10P3 (order matters)
720
Orderings of each selection (3!)
6

C(10, 3) = 10! / (3! · 7!) = 120. There are 720 ordered arrangements (10P3); dividing by the 6 orderings of any single selection (3!) gives the 120 unordered combinations.

How to use this calculator

Enter two whole numbers: n, the total number of distinct items you are choosing from, and k, how many you are choosing. The result C(n, k) — read aloud as "n choose k" — is the number of different unordered selections of k items from the n. Order does not matter, so picking {A, B, C} is the same selection as {C, B, A} and is counted once. k must be between 0 and n; if you enter a k larger than n the calculator flags it, because you cannot choose more items than you have. The breakdown also shows the permutation count nPk (the same choice when order does matter) and k!, the number of ways to arrange any single selection.

How the calculation works

The binomial coefficient is C(n, k) = n! / (k! · (n − k)!). The calculator does not literally compute three huge factorials and divide — that would overflow quickly. Instead it uses the multiplicative form C(n, k) = ∏(i=1..k) (n − k + i) / i, which stays an exact whole number at every step, and it exploits the symmetry C(n, k) = C(n, n − k) to iterate over the smaller of k and n − k. Every value is held as an arbitrary-precision integer, so C(100, 50) — a 30-digit number — comes back exact rather than rounded. The permutation count is nPk = n! / (n − k)!, and the two are linked by nPk = C(n, k) · k!: there are k! ways to order each unordered selection.

Worked example

The UK National Lottery draws 6 balls from 49. The number of possible tickets is C(49, 6) = 49! / (6! · 43!). Cancelling the 43! leaves (49 × 48 × 47 × 46 × 45 × 44) / (6 × 5 × 4 × 3 × 2 × 1) = 10,068,347,520 / 720 = 13,983,816. So there are just under 14 million equally likely combinations, and one ticket has a 1-in-13,983,816 chance of matching all six. Compare a 5-card poker hand: C(52, 5) = 2,598,960 distinct hands from a standard deck.

Frequently asked questions

What is a binomial coefficient?

A binomial coefficient C(n, k), written "n choose k" and sometimes shown as ⁿCₖ or a stacked (n over k), is the number of ways to choose k items from a set of n distinct items when the order of the chosen items does not matter. It is called a binomial coefficient because these are exactly the numbers that appear when you expand (a + b)ⁿ: the coefficient of the aᵏbⁿ⁻ᵏ term is C(n, k). They are also the entries of Pascal's triangle, where each number is the sum of the two above it.

What is the difference between a combination and a permutation?

A combination counts selections where order does not matter; a permutation counts arrangements where it does. Choosing 3 people from 10 to form a committee is a combination — C(10, 3) = 120 — because the committee {Ann, Bob, Cara} is the same regardless of the order you named them. Choosing 3 people from 10 to be president, secretary and treasurer is a permutation — P(10, 3) = 720 — because the roles make order matter. The two are linked by P(n, k) = C(n, k) × k!: every unordered selection of k items can be arranged in k! different orders.

What does C(n, k) equal when k is 0 or when k equals n?

Both equal 1. There is exactly one way to choose nothing (the empty selection), so C(n, 0) = 1, and exactly one way to choose everything, so C(n, n) = 1. This is consistent with the formula: C(n, 0) = n! / (0! · n!) = 1, using the convention that 0! = 1. These two facts are why the first and last entry of every row of Pascal's triangle is 1.

What happens if k is larger than n?

By the standard integer convention, C(n, k) = 0 whenever k is greater than n (or less than 0) — there is simply no way to choose 8 items from a set of 5. This calculator asks you to enter a k no larger than n so that the companion values in the breakdown (the permutation count and factorials) stay well-defined, but mathematically the answer for k > n is always zero.

Why is C(n, k) the same as C(n, n − k)?

Because choosing which k items to include is the same decision as choosing which n − k items to leave out. Every selection of a 6-person team from 15 people automatically determines the 9 people not on the team, so C(15, 6) = C(15, 9) = 5,005. This symmetry is also why the calculator only needs to multiply over the smaller of k and n − k, which keeps it fast even for large n.

How does this relate to the binomial distribution?

The binomial coefficient is the counting factor inside the binomial distribution. The probability of getting exactly k successes in n independent trials, each with success probability p, is C(n, k) · pᵏ · (1 − p)ⁿ⁻ᵏ. The C(n, k) term counts how many different orderings of successes and failures give k successes in total; the pᵏ(1 − p)ⁿ⁻ᵏ term is the probability of any one such ordering. If you want the full distribution and its mean, variance and cumulative probabilities, use the binomial distribution calculator instead.