Discrete Mathematics nPr & nCr Combinatorics

Permutation and Combination Calculator

Calculate the exact number of permutations ($nPr$) and combinations ($nCr$) with and without repetition. Features exact arbitrary-precision BigInt arithmetic, step-by-step factorial algebraic derivations, and real-world presets.

Reviewed for Mathematical Accuracy Last updated: 2026
🎲
BigInt Precision: Employs native JavaScript BigInt arithmetic to compute massive factorials without floating-point rounding errors.

Set Parameters

Presets:
items
Size of the full pool/population
chosen
Number of items selected

Combinatorial Counts

Combinations Without Repetition: $C(n, r)$
35
Order does not matter | No replacement
210
Permutations $P(n, r)$ (Order Matters)
343
Permutations with Repetition ($n^r$)
84
Combinations with Repetition
5,040
Total Permutations of Set ($n!$)
Step-by-Step Factorial Derivation:

Permutations vs. Combinations: Decision Matrix

Scenario Order Matters? Repetition Allowed? Formula Real-World Example
Permutation Yes No P(n, r) = n! / (n - r)! 1st, 2nd, and 3rd place race finishes
Combination No No C(n, r) = n! / [r!(n - r)!] Choosing a 5-person committee or poker hand
Permutation with Repetition Yes Yes n^r 4-digit ATM PIN code (e.g. 7721)
Combination with Repetition No Yes (n + r - 1)! / [r!(n - 1)!] Picking 5 scoops of ice cream from 8 flavors

Factorial Mathematics & Combinatorics

Combinatorics is the branch of mathematics dealing with counting arrangements, combinations, and permutations of discrete objects. It forms the bedrock of probability theory, cryptography, statistical mechanics, and computer algorithm design.

Why is C(n, r) Always Less Than P(n, r)?

In a permutation, changing the sequence of the exact same elements creates a completely distinct outcome (e.g., $(A, B, C) \neq (C, B, A)$). For any group of $r$ distinct items, there are exactly $r!$ ways to arrange them. Therefore, the combination count is simply the permutation count divided by $r!$: $C(n, r) = \frac{P(n, r)}{r!}$.

Educational Notice: All results are computed using arbitrary-precision integers up to thousands of digits. See our full Disclaimer.

Permutations vs. Combinations: Principles of Combinatorics

Combinatorics is the branch of mathematics focused on counting, arrangement, and grouping. The fundamental distinction between permutations and combinations centers on order: permutations calculate arrangements where sequence or ranking matters, whereas combinations calculate groupings where internal order has no relevance.

Factorial Formulations for nPr and nCr

Given a total set of 'n' unique elements from which 'r' items are selected:

Frequently Asked Questions

What is the difference between a permutation and a combination?

In a permutation, the arrangement order matters (e.g. race finishes 1st, 2nd, 3rd or a locker combination). In a combination, order does not matter (e.g. a hand of playing cards or a committee of team members).

What are the formulas for nPr and nCr?

The permutation formula is P(n, r) = n! / (n - r)!. The combination formula is C(n, r) = n! / [r! (n - r)!], where n is the total number of items, r is the number chosen, and '!' denotes the factorial function.

How many 5-card poker hands can be dealt from a 52-card deck?

Because the order cards are dealt does not affect the final hand, use the combination formula C(52, 5) = 52! / (5! × 47!) = 2,598,960 possible hands.