Combination Calculator (nCr)
A combination counts the number of ways you can select r items from a set of n when the order of selection does not matter. It is one of the two central counting operations in combinatorics, alongside permutations. The difference between them is straightforward: if choosing items A, B, C and choosing C, B, A are considered the same result, you want a combination; if the different orderings are considered distinct, you want a permutation. Selecting members for a committee, choosing questions to answer on an exam, picking lottery numbers, dealing a hand of cards, and forming a team are all combination problems because only the membership of the group matters, not the sequence in which members were chosen. The formula for nCr is n factorial divided by r factorial times the factorial of n minus r. This is the same as nPr divided by r factorial, which removes the r factorial different orderings of the same group. You enter n, the total number of items available, and r, the number you are selecting, with r no larger than n. The calculator returns the combination count, the equivalent permutation count nPr for comparison, and the ratio between them (which always equals r factorial). The calculation uses a stable step-by-step product to avoid building huge factorials, so it stays accurate for large inputs. Enter your n and r values to see the result update immediately.
How it works
The calculator uses the smaller of r and n minus r in the denominator to minimise the number of steps, then multiplies and divides alternately so the running total stays a whole number throughout. This gives n factorial divided by r factorial times the factorial of n minus r without ever building the full factorials, which would overflow for large inputs. The permutation count nPr is computed as the descending product of r terms from n. The ratio nPr over nCr always equals r factorial, confirming how many orderings exist for each combination.
Worked example
With n = 5 and r = 3, the combination count is 5! divided by (3! times 2!) = 120 divided by (6 times 2) = 10 combinations. This might represent the number of different three-person groups that can be formed from five people. The equivalent permutation count is 60, because each group of three can be arranged in 3! = 6 different orders, and 10 times 6 equals 60.
Related calculators
- Permutation Calculator: count ordered arrangements where the sequence matters.
- Quadratic Formula Calculator: solve quadratic equations.
- System of Equations Solver: solve two simultaneous linear equations.
- Percent Error Calculator: measure deviation from a true value.
- Remainder Theorem Calculator: evaluate P(r).
- Reverse Tip Calculator NZ 2026: Work Out the Tip From the Total.