The Combination and Permutation Calculator computes C(n,r), P(n,r), and factorial with solution steps.
Uses BigInt for accurate calculations up to 170!. Includes an interactive Pascal's triangle, real-world examples (lottery, PIN, teams), and an explanation of when to use combinations vs. permutations.
Calculator information
๐ How to use this calculator
- Enter the total number of elements n (size of the set) and the number of elements to choose r.
- Choose the type: combination C(n,r) if order doesn't matter, or permutation P(n,r) if order matters.
- For pure factorial, use 'n!' mode and enter n (0-170 supported with BigInt).
- Click Calculate for the result plus a step-by-step solution with factorial expansion and simplification.
- Explore the interactive Pascal's triangle to see C(n,r) values laid out visually.
- Read real-world examples (ATM PIN, team lineup, lottery) to learn when to use combinations vs. permutations.
- Mnemonic tip: 'P needs order, C just selects'; C(n,r) โค P(n,r) because order is ignored.
๐งฎ Combinations, Permutations, Factorials
C(n,r) = n! / (r!(n-r)!) ; P(n,r) = n! / (n-r)!
- n! = n ร (n-1) ร (n-2) ร ... ร 2 ร 1, with 0! = 1
- Constraints: 0 โค r โค n, n and r non-negative integers
- Property: C(n,r) = C(n,n-r) (symmetry)
- P(n,r) = r! ร C(n,r)
- Circular permutations: (n-1)! ; permutations with repetition: n^r
For large n, use Stirling's approximation: n! โ โ(2ฯn) ร (n/e)^n.
๐ก Worked example: Pick 3 people from 10 for a team (combination) vs. 1st-2nd-3rd place (permutation)
Steps:- Permutation (order matters, 1st-2nd-3rd are distinct): P(10,3) = 10!/(10-3)! = 10!/7! = 10 ร 9 ร 8 = 720.
- Combination (order doesn't matter, 3-person team): C(10,3) = 10!/(3!ยท7!) = 720/6 = 120.
- Verification: C(10,3) = P(10,3)/3! = 720/6 = 120 โ.
- Interpretation: 720 distinct podium orderings, but only 120 unique team compositions.
Result: P(10,3) = 720 orderings; C(10,3) = 120 teams. Difference factor: 3! = 6 (orderings per team).
โ Frequently asked questions
When should I use combinations vs. permutations?
Use PERMUTATIONS when order changes the outcome: ATM PIN (1234 โ 4321), race rankings (gold/silver/bronze), seating arrangements, passwords. Use COMBINATIONS when order doesn't matter: choosing a team (Alice-Bob-Carol = Carol-Bob-Alice), lottery numbers (45-12-7 same as 7-12-45), pizza topping selections. Quick test: 'do AB and BA count as the same?' If yes -> combination.
What are the odds of winning Powerball?
Powerball requires picking 5 white balls from 69 and 1 red Powerball from 26: C(69,5) ร 26 = 11,238,513 ร 26 = 292,201,338 combinations. The odds of hitting the jackpot with one ticket are about 1 in 292 million. For comparison, the lifetime odds of being struck by lightning in the U.S. are about 1 in 15,300 (NWS). Understanding these probabilities is essential for statistical literacy and recognizing the math behind gambling.
How many 8-character passwords are possible?
With 95 printable ASCII characters (upper/lowercase letters + digits + symbols), there are 95^8 = 6.6 ร 10^15 combinations. A modern computer at 1 billion guesses per second needs 76 days to brute-force. With 12 characters that jumps to 5.4 ร 10^23 = 17,000 years. NIST SP 800-63B recommends passwords of at least 8 characters from a broad set, or passphrases of 4 random words (~44 bits of entropy).
What is Pascal's triangle and what is it used for?
Pascal's triangle is a triangular arrangement where each number equals the sum of the two numbers above it. Row n contains C(n,0), C(n,1), ..., C(n,n). Applications: binomial coefficients in (a+b)^n, Sierpinski fractals (color odd numbers), probabilities in the binomial distribution, and discrete combinatorics. Notable patterns: row n sums to 2^n; the second diagonal lists the triangular numbers.
How do I compute 100! without overflow?
100! โ 9.33 ร 10^157 - far beyond a 64-bit integer (max 9.22 ร 10^18) or a double-precision float (accurate to ~17 significant digits). Solution: use BigInt (arbitrary precision) in JavaScript/Python, or BigInteger in Java. For a fast estimate, Stirling: 100! โ โ(200ฯ) ร (100/e)^100 with under 1% error. 170! is the upper bound for IEEE 754 double (Number.MAX_VALUE).
๐ Sources & references
Last updated: May 11, 2026