Everything, Everywhere
Verified Specification | Standardized Formulas | Instant Precision
Secure & Private (Zero Data Retention) Free Access • No Sign-Up

Permutations and Combinations Calculator (nPr & nCr)

Calculate total arrangements ($n ext{P}r$) and selections ($n ext{C}r$) with exact arbitrary-precision BigInt integers, repetition modes, step-by-step factorial cancellations, and lottery probability odds.

Real-World Presets:
Combinations (nCr)
120
Order DOES NOT matter • No Repetition
Permutations (nPr)
720
Order MATTERS • No Repetition
Permutations WITH Repetition
1,000
Formula: nr (PINs • Passwords)
Combinations WITH Repetition
220
Stars & Bars: (n + r - 1) C r
Total Pool Factorial (n!)
3,628,800
Selection Factorial (r!)
6
Remainder Factorial ((n - r)!)
5,040

📐 Step-by-Step Factorial Cancellation Proofs

Algebraic Simplification

Directly expanding large factorials is computationally wasteful. Instead, $(n - r)!$ cancels completely from the numerator:

Permutations (nPr) Cancellation:
nPr = 10! / (10 - 3)! = (10 × 9 × 8 × 7!) / 7! = 10 × 9 × 8 = 720
Combinations (nCr) Cancellation & Division:
nCr = nPr / r! = 720 / 3! = 720 / (3 × 2 × 1) = 720 / 6 = 120

🃏 Standard 5-Card Poker Hand Combinations (52 C 5)

Total Hands = 2,598,960

Combinatorics gives exact counts and probabilities for every poker hand in a standard 52-card deck:

Poker Hand Combinatorics Formula Total Possible Hands Exact Odds
Royal Flush4 suits × 141 in 649,740
Straight Flush(10 - 1) × 4361 in 72,193
Four of a Kind13 × (48 C 1)6241 in 4,165
Full House(13 C 1)(4 C 3) × (12 C 1)(4 C 2)3,7441 in 694
Flush4 × (13 C 5) - 405,1081 in 509
Straight10 × (4^5) - 4010,2001 in 255
Three of a Kind13 × (4 C 3) × (12 C 2) × 4^254,9121 in 47
Two Pair(13 C 2)(4 C 2)^2 × (11 C 1)(4 C 1)123,5521 in 21
One Pair13 × (4 C 2) × (12 C 3) × 4^31,098,2401 in 2.37 (42.26%)
High Card[(13 C 5) - 10] × (4^5 - 4)1,302,5401 in 2 (50.12%)

⚠️ 5 Critical Combinatorics Traps & Common Fallacies

🔐 1. The "Combination Lock" Semantic Misnomer (Order Matters)

A standard rotary dial lock is mathematically a permutation lock, because order strictly matters. Dialing 30-10-20 will not open a mechanism set to 10-20-30. True combinations exist only when item order is completely irrelevant, such as selecting a 5-card poker hand or lottery balls from a hopper.

🔄 2. The Duplicate Items Overcounting Fallacy (Multinomial Permutations)

When calculating arrangements of collections with repeated elements (e.g. anagrams of the word "MISSISSIPPI"), standard $n!$ drastically overcounts identical permutations. You must divide by the factorials of each repeated element: $11! / (4! imes 4! imes 2!) = 34,650$, rather than the naive $11! = 39,916,800$.

🎲 3. Sampling With vs. Without Replacement Confusion

Drawing cards from a deck without replacement depletes the candidate pool on each draw ($52 o 51 o 50$, evaluating as $nPr$). Conversely, rolling dice, flipping coins, or brute-forcing alphanumeric passwords samples with replacement, meaning trials are independent and possibilities compound exponentially ($n^r$). Mixing up these sampling paradigms completely invalidates probability calculations.

🃏 4. Stars and Bars Partitioning in Combinations with Repetition

Selecting $r$ items from $n$ types where repetition is allowed (such as choosing 6 donuts from 4 varieties) cannot be solved with naive addition. It requires the "stars and bars" combinatorial theorem: $C(n + r - 1, r) = rac{(n+r-1)!}{r!(n-1)!}$. For 6 donuts from 4 types, this yields $C(4+6-1, 6) = C(9, 6) = 84$ distinct assortments.

🧮 5. Factorial Explosions & 64-Bit Integer Precision Overflow

Factorials grow faster than exponential functions: $10! = 3.62 imes 10^6$, but $20! = 2.43 imes 10^{18}$, exceeding the JavaScript IEEE 754 safe integer limit ($ ext{MAX_SAFE_INTEGER} = 2^{53} - 1 approx 9.007 imes 10^{15}$). Calculating permutations of $n ge 18$ using standard integers introduces truncation and rounding errors unless arbitrary-precision BigInt or logarithmic summation ($ln(n!)$) is utilized.

Sponsored Utility
While You're Here
Sponsored Recommendations
Advertisement