How this calculator works
The coefficient counts selections when order does not matter and each object is used at most once. Symmetry makes choosing k equivalent to leaving out n - k. Integer multiplication and exact division avoid rounding, even when a result exceeds the ordinary JavaScript safe integer range.
Formula
C(n,k) = n! / (k!(n-k)!), with C(n,0) = C(n,n) = 1.
Worked example
Choosing 2 of 5 objects gives 5 x 4 / (2 x 1) = 10. Choosing all 5 gives one possible selection. Choosing 50 of 100 gives 100891344545564193334812497256.
Advertisement
Frequently asked questions
Does order matter?
No. Selecting A then B is the same group as selecting B then A.
Why is choosing zero equal to one?
There is exactly one empty selection.
Can k be larger than n?
This tool treats that as an invalid selection request. It accepts only 0 <= k <= n.