Coeficiente Binomial C(n,k)
Calcula C(n,k) = n! / (k!·(n-k)!) sem overflow para n ≤ 1000.
C(n,k)
—
Binomial coefficient C(n,k)
The binomial coefficient C(n,k) = n! / (k! · (n−k)!) tells you how many ways there are to pick k elements out of a set of n when the order doesn't matter. Lay the coefficients out and you get Pascal's triangle, where every entry is the sum of the two sitting above it. Example: C(5,2) = 5! / (2! · 3!) = 120 / (2 · 6) = 10. A few identities come in handy: C(n,k) = C(n,n−k) (symmetry), C(n,0) = C(n,n) = 1, Σₖ C(n,k) = 2ⁿ (one full row of Pascal's triangle), and Σₖ C(n,k)² = C(2n,n) (Vandermonde). Newton's binomial theorem writes (a+b)ⁿ = Σₖ C(n,k) · a^(n−k) · bᵏ. When n gets large, you're better off computing the value step by step, multiplying and dividing as you go, instead of building out the full factorials.
Applications
C(n,k) shows up everywhere. It's the foundation of combinatorics (counting subsets), drives probability through the binomial distribution (k successes in n trials), and fixes the odds in lotteries (Mega-Sena has C(60,6) = 50.063.860 possible draws). You'll also meet it in subset enumeration algorithms and in polynomial expansion through Newton's binomial.
FAQ
What if k > n or k < 0? By convention C(n,k) = 0. You simply can't choose more elements than the set holds.
Order matters: should I use combination or permutation? Permutations P(n,k) = n!/(n−k)! count ordered arrangements, while C(n,k) = P(n,k)/k! strips the order back out. Lottery numbers use C, rankings use P.
How to compute C(n,k) without huge factorials? Reach for C(n,k) = (n · (n−1) · ... · (n−k+1)) / k!. That's only k terms, and you never have to materialise the whole n!.
Related Tools
Rent Adjustment Calculator
Compute annual rent adjustment by IGP-M or IPCA accumulated in the last 12 months (manually configurable).
Pregnancy Calculator
Compute estimated due date (EDD), gestational age and trimester from the last menstrual period (LMP).
Fertile Period Calculator
Compute fertile window and ovulation day from the first day of the last cycle and the average cycle length.