Calcoid
Math

Combinations and Permutations Calculator

Calculate combinations (nCr) and permutations (nPr) with or without repetition. Switch modes in one click, see the formula, and get exact BigInt results for huge n and r.

Enter your values

Result

13,983,816

Combinations without repetition (order does not matter, each item used at most once)

Formula

n!/(r!(n-r)!) = 49!/(6!(49-6)!) = 13983816

Frequently Asked Questions about the Combinations and Permutations Calculator

What is the difference between a combination and a permutation?
Order. A permutation is an ordered arrangement: A-B-C and C-B-A are two distinct permutations of {A, B, C}. A combination is an unordered selection: {A, B, C} is one combination no matter how you list it. The same n and r always give nPr greater than or equal to nCr, because every combination of size r can be re-ordered r! ways, so nPr = nCr * r!. Pick the mode in this calculator that matches your scenario: if shuffling the chosen items changes the answer (race rankings, PIN sequences, seat assignments), it is a permutation; if it does not (a hand of cards, a committee, a pizza topping selection), it is a combination.
When should I allow repetition?
Allow repetition when the same item can be picked more than once. A 4-digit PIN can be 0000 (the digit 0 used four times), so it is a permutation with repetition: 10^4 = 10,000 codes. A scoop-of-ice-cream selection where you can take two scoops of chocolate is a combination with repetition: with 3 flavors and 2 scoops, C(4, 2) = 6 multisets. Without repetition, each item is used at most once: nPr or nCr in the classical sense. The formulas differ: n^r and C(n+r-1, r) are the two with-repetition cases, n!/(n-r)! and n!/(r!(n-r)!) are the two without.
Where does the formula nPr = n!/(n-r)! come from?
Imagine placing r distinct items into r ordered slots, drawing from a pool of n items without replacement. The first slot has n choices, the second has n-1 (one item is already used), the third has n-2, and so on, down to n-r+1 for the last slot. Multiplying these gives n * (n-1) * ... * (n-r+1), which is exactly n!/(n-r)! once you write out both factorials and cancel the (n-r)! tail. So the formula is just the product rule applied r times. The calculator uses the product form directly, not the factorial ratio, which keeps the intermediate values small and exact even when n is large.
What are real-world uses of combinations and permutations?
Combinations dominate when grouping matters more than ordering. Poker uses C(52, 5) = 2,598,960 to count five-card hands. Lotteries use C(49, 6) = 13,983,816 for the odds of a six-from-49 jackpot. Sports drafts pick a team of k from a pool of n. Permutations show up when sequence matters. A password using 8 distinct lowercase letters has 26P8 = 62,990,928,000 arrangements. A 4-digit PIN with repetition allows 10^4 = 10,000 codes. Race-finishing orders, lineup orders, and lock-code sequences all use nPr or n^r.
Why does this calculator use BigInt instead of regular numbers?
JavaScript's standard number type is a 64-bit float that can store integers exactly only up to Number.MAX_SAFE_INTEGER, which is 2^53 - 1 = 9,007,199,254,740,991. Past that, every integer is rounded to the nearest representable value. Combinatorial counts blow past that limit fast: 21! already exceeds it, C(100, 50) is a 30-digit number. BigInt is JavaScript's arbitrary-precision integer type, with no upper bound short of memory. Using BigInt internally lets the calculator return the exact digits for any input up to n = 1000, then surface a scientific-notation summary when the value is too big to be useful as a number.