Number Combination Counter (nCr)
Calculate combinations C(n,r) and permutations P(n,r) with formula breakdown, Pascal's Triangle row display, and step-by-step factorial evaluation.
Input
Result

Get Free Money Making Tips
Join 2,000+ smart readers getting side-hustle ideas, passive income strategies, and proven finance tips delivered straight to your inbox.
Number Combination Counter (nCr): Calculate Binomial Coefficients with Pascal's Triangle
The Number Combination Counter computes the binomial coefficient C(n, r) — the number of ways to choose r items from n items without regard to order — and simultaneously calculates P(n, r) permutations. In "Probability Theory," "Statistical Sampling," and "Algorithm Design," the combination formula is a fundamental counting principle. According to Blaise Pascal's Traite du Triangle Arithmetique (1665), the binomial coefficient governs everything from lottery odds to drug trial sample sizes. This tool computes exact integer results for values up to n=170 and displays the relevant row of Pascal's Triangle.
What is the combination formula and how is C(n, r) calculated?
C(n, r) = n! / (r! x (n-r)!) counts the number of ways to select r items from n distinct items where order does not matter. The key insight is that each combination of r items can be arranged in r! ways, so dividing the permutation count P(n, r) by r! eliminates order. For C(10, 3): 10! / (3! x 7!) = 3628800 / (6 x 5040) = 120. There are 120 ways to choose 3 items from 10. The efficient computation avoids factorial overflow by using the multiplicative formula: C(n,r) = product((n-i)/(i+1)) for i=0 to min(r, n-r)-1.
Combinations vs. Permutations
| n | r | C(n,r) Combinations | P(n,r) Permutations | Ratio P/C |
|---|---|---|---|---|
| 5 | 2 | 10 | 20 | 2 (=2!) |
| 10 | 3 | 120 | 720 | 6 (=3!) |
| 20 | 5 | 15,504 | 1,860,480 | 120 (=5!) |
| 52 | 5 | 2,598,960 | 311,875,200 | 120 (=5!) |
| 49 | 6 | 13,983,816 | 10,068,347,520 | 720 (=6!) |
6 Real-World Applications
- Lottery Odds: A 6/49 lottery has C(49,6) = 13,983,816 possible combinations. The probability of winning the jackpot is 1 in 13,983,816.
- Poker Hands: A 5-card poker hand from a 52-card deck has C(52,5) = 2,598,960 possible hands. The probability of a Royal Flush is 4/2,598,960.
- Statistical Sampling: Choosing a committee of 5 from 20 candidates: C(20,5) = 15,504 possible committees.
- Algorithm Complexity: Many brute-force algorithms iterate over all C(n,r) combinations. Knowing the count determines computational feasibility.
- Binary Strings: The number of n-bit strings with exactly r ones is C(n,r). C(8,3) = 56 eight-bit strings have exactly 3 ones.
- Drug Trial Design: Selecting r patients from n candidates for a treatment group: C(n,r) determines the number of possible trial configurations.
How to Use the Combination Counter
- Enter n: The total number of items to choose from.
- Enter r: The number of items to select (must be 0 <= r <= n).
- Execute: Click "Calculate." The tool computes C(n,r), P(n,r), shows the formula with step-by-step evaluation, and displays Pascal's Triangle row n.
- Interpret: The combination count answers "how many ways" questions; the permutation count answers "how many arrangements" questions.
Pascal's Triangle and the Binomial Theorem
Each entry in Pascal's Triangle is a binomial coefficient: the entry at row n, position r is C(n,r). The triangle satisfies the recurrence C(n,r) = C(n-1,r-1) + C(n-1,r), discovered by Yang Hui (1261 CE) and independently by Blaise Pascal (1653). The Binomial Theorem states (a+b)^n = sum of C(n,k) * a^(n-k) * b^k for k=0 to n. Our calculator displays up to 16 entries of the relevant Pascal's Triangle row for visual reference.
Frequently Asked Questions
What happens when r = 0 or r = n?
C(n,0) = C(n,n) = 1. There is exactly one way to choose nothing (the empty set) and one way to choose everything (the full set).
What is the maximum n this calculator handles?
The calculator produces exact results for n up to approximately 170. Beyond this, JavaScript's number precision (IEEE 754 double) causes rounding. For n <= 20, the full factorial expansion is also displayed.
What is the symmetry property?
C(n,r) = C(n, n-r). Choosing r items to include is equivalent to choosing n-r items to exclude. C(10,3) = C(10,7) = 120.
How are permutations different?
Permutations P(n,r) = n!/(n-r)! count ordered selections. Choosing 3 people for President, VP, and Secretary from 10 is P(10,3) = 720, not C(10,3) = 120, because the roles create order.