Find the total number of permutations (ordered arrangements) and combinations (unordered selections) of r objects chosen from a set of n elements, with and without repetition.
• n (Total Set): Total number of distinct items available to pick from.
• r (Sub-Set): Number of items being selected in each sample.
• Permutation (ₙPᵣ): Order matters (e.g., race rankings 1st, 2nd, 3rd).
• Combination (ₙCᵣ): Order does NOT matter (e.g., poker hand of 5 cards).
Enter total set size (n) and subset size (r) on the left and click "Calculate" to view permutations, combinations, and algebraic formulas.
Combinatorial counting principles, order significance, repetitions, and real-world probability modeling.
In mathematics, combinatorics is the branch of discrete mathematics studying the enumeration, arrangement, and combination of sets of elements. The foundational question in any selection problem is: does the sequence order of chosen elements matter?
Every unique sequence or ranking is considered distinct. For example, in a race with runners A, B, and C, finishing (A, B, C) is different from (C, B, A).
Only the collection of elements matters, regardless of arrangement. Choosing a committee of {Alice, Bob} is identical to {Bob, Alice}.
In everyday language, we refer to mechanical padlock codes as "combinations". However, mathematically, if your lock code is 12-34-56, dialing 34-12-56 or 56-34-12 will NOT open the lock. Because the precise order of digits is mandatory, padlocks and digital PINs are strictly Permutation Locks with Repetition (10⁴ = 10,000 distinct possibilities for a 4-digit code).
| Type | Repetition Allowed? | Formula |
|---|---|---|
| Permutation | No | ₙPᵣ = n! / (n - r)! |
| Permutation | Yes | nʳ |
| Combination | No | ₙCᵣ = n! / [r! · (n - r)!] |
| Combination | Yes | (n + r - 1)! / [r! · (n - 1)!] |
Because the order you hold the 5 cards does not alter your hand, this is a combination without repetition:
Gold, Silver, and Bronze medals depend strictly on finish order, making this a permutation:
By mathematical convention and combinatorial definition, 0! = 1. There is exactly 1 way to arrange an empty set of zero items.
Every combination of r items can be arranged in r! different permutations (nPr = nCr × r!). Since r! ≥ 1 for all non-negative integers, dividing by r! always results in a number less than or equal to nPr.
Yes. In combinations with repetition (like choosing 10 scoops of ice cream from 4 available flavours), r can exceed n because items can be picked multiple times.
Standard JavaScript numbers use 64-bit floating point which loses integer precision beyond 9,007,199,254,740,991 (around 16!). BigInt supports arbitrarily large integers with exact bit-level precision, allowing exact combinatorial calculation for massive sets.