Binomial Coefficient Calculator

Form

Results

Complex Conjugate

0

1

What is Binomial Coefficient?

The binomial coefficient counts selections of a fixed size when order does not matter. It is written C(n,k), n choose k, or with n above k in parentheses. This calculator uses n for the available distinct items and k for the number selected.

The classic example is choosing a committee. Selecting Ana, Ben and Chen gives the same committee as selecting Chen, Ana and Ben. Counting every ordering would overcount that group. A binomial coefficient removes those orderings rather than treating them as different outcomes.

2

How to Use This Calculator

Enter n as the total number of distinct available items. Enter k as the number to choose, then calculate. Use whole numbers with 0≤k≤n. Zero is a valid boundary value, but negative values and fractional selection sizes do not fit this ordinary combinations calculation.

Check that selection is without replacement. Once a person or item is in a group, they are not chosen again. Also check whether order or assigned roles matter. Choosing a chair and deputy from five people is a different task from choosing an unordered two-person committee.

The controller does not enforce the full integer-domain restrictions, even though the form may accept such entries. A numeric output for invalid n or k is not a meaningful extension of the formula. Confirm the problem’s assumptions before relying on the answer.

3

Formula Used

C(n,k) = n! ÷ [k!(n−k)!], with nonnegative integers n and k and 0≤k≤n. Symmetry: C(n,k)=C(n,n−k). The implementation uses a multiplicative loop instead of explicitly building all factorials.
4

Variables Explained

InputUnit or choiceMeaning
nNonnegative integerNumber of available distinct items.
kInteger 0 throughnNumber selected without replacement; order disregarded.

n counts the distinct objects available before selection. k counts how many of those objects appear in each final group. The difference n−k counts the objects left out. Every selected group corresponds to one group of excluded items, explaining the symmetry.

A factorial n! multiplies the positive integers from one through n;0! is defined as one. The k! denominator removes the different internal orderings of the same selected group, and (n−k)! removes the orderings among those not selected.

The output is a count, not a probability. A count of ten possible groups does not by itself say how likely any particular group is. A probability calculation additionally needs assumptions about how groups are selected and which outcomes qualify.

5

Worked Example

Choose three people from five. C(5,3)=5!/(3!2!)=120/(6×2)=10 groups. The same answer is C(5,2), because choosing the three included people is equivalent to specifying the two excluded people.

For a four-person committee from ten people, C(10,4)=10×9×8×7/(1×2×3×4)=5,040/24=210. The multiplicative form avoids calculating 10! when its larger factors would cancel anyway.

Compare choosing two distinct roles from five people. There are 5 choices for the first role and 4 for the second, giving 20 ordered assignments. An unordered pair gives C(5,2)=10. Each pair has two ways to assign those roles, which explains the factor-of-two difference.

At the boundaries, C(5,0)=1 and C(5,5)=1. There is one empty selection and one selection containing everything. These results count possible groups, rather than the number of people inside a group.

6

Why Use This Calculator?

Use combinations for groups, subsets and unordered selections without repetition. It can also provide coefficients in a binomial expansion: the coefficients in the fifth power of a sum are 1,5,10,10,5,1, corresponding to k from zero through five.

For probability problems, the same coefficient can count favorable or total outcomes when its selection assumptions fit. For example, choosing two marked items from a defined pool requires counting both the selection possibilities and the total possible samples. The calculator supplies one count at a time and does not construct the complete probability model.

Large coefficients grow rapidly. Although the mathematical result is an integer, this implementation uses ordinary PHP arithmetic and division in its loop. Very large inputs may overflow or lose exact integer digits. A long numeric output or scientific notation is not a guarantee of exactness.

7

Common Mistakes

    Do not confuse combinations with permutations. Do not use k>n and interpret the implementation’s fallback output as a valid answer. Do not enter a decimal such as 2.5 people. If selection with repetition is allowed, the usual stars-and-bars relationship uses a different expression and assumptions.

    Avoid rounding intermediate factors by hand. For manageable inputs, cancel factors or use the multiplicative form to preserve exact arithmetic. If the exact integer has many digits, verify it with an arbitrary-precision combinatorial tool rather than relying on ordinary floating-point arithmetic.

8

Frequently Asked Questions

Why is choosing zero items one possibility?

There is exactly one subset containing no items: the empty set. The answer counts how many selections exist, not how many items are selected. That is why C(n,0)=1.

Can I exchange k and n−k?

Yes. Each selected group uniquely determines its excluded group. The implementation uses this symmetry to loop over the smaller selection size, reducing the amount of arithmetic.

Does the calculator allow repeated selection of one item?

The standard binomial coefficient here counts selections without replacement. Problems permitting repetition need a different counting model. Do not reuse this result without checking that assumption.

Is the result a probability?

No. It is the number of possible groups. To get a probability, divide an appropriate favorable count by a total count under a specified selection model.

Why might an enormous result lose its last digits?

The backend uses ordinary arithmetic rather than an arbitrary-precision integer output method. Large coefficients can exceed that representation’s exactness. Verify substantial results when exact digits matter.

9

Sources & References