Permutation and Combination Calculator CalculatorScale.com
Discrete Mathematics & Combinatorics Arbitrary-Precision BigInt Engine

Permutation and Combination Calculator

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.

Modify the values and click the Calculate button to use

• 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).

Input Parameters

Quick Sample Presets:
Non-negative integer (n ≥ r)
Number of chosen items (r ≤ n)

Awaiting Calculation

Enter total set size (n) and subset size (r) on the left and click "Calculate" to view permutations, combinations, and algebraic formulas.

Comprehensive Guide to Permutations and Combinations

Combinatorial counting principles, order significance, repetitions, and real-world probability modeling.

1Combinatorics Overview: Permutations vs. Combinations

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?

Permutations (Order Matters)

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).

Combinations (Order Does NOT Matter)

Only the collection of elements matters, regardless of arrangement. Choosing a committee of {Alice, Bob} is identical to {Bob, Alice}.

2Why "Combination Locks" are Technically Permutation Locks

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).

3Complete Summary of Combinatorial Formulas

TypeRepetition Allowed?Formula
PermutationNoₙPᵣ = n! / (n - r)!
PermutationYesnʳ
CombinationNoₙCᵣ = n! / [r! · (n - r)!]
CombinationYes(n + r - 1)! / [r! · (n - 1)!]

4Real-World Worked Examples

Example 1: Poker Hand (5 cards from 52)

Because the order you hold the 5 cards does not alter your hand, this is a combination without repetition:

₅₂C₅ = 52! / (5! · 47!) = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 2,598,960 possible hands.

Example 2: 100m Sprint Podium (Top 3 of 8 runners)

Gold, Silver, and Bronze medals depend strictly on finish order, making this a permutation:

₈P₃ = 8! / (8 - 3)! = 8! / 5! = 8 × 7 × 6 = 336 possible podium finishes.

Frequently Asked Questions

What is the special value of 0! (zero factorial)?

By mathematical convention and combinatorial definition, 0! = 1. There is exactly 1 way to arrange an empty set of zero items.

Why is nCr always smaller than or equal to nPr?

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.

Can r be greater than n in combinations with repetition?

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.

How does BigInt prevent calculation overflows for large factorials?

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.