CalcPlatformPro
HomeFinanceHealthMathConstructionConvertersDateOtherFeedback
Feedback
CalcPlatform

Free, fast, and precise financial, mathematical, health, and engineering calculators.

Financial Suite

  • Mortgage Calculator
  • Auto Loan Calculator
  • Personal Loan Calculator
  • EMI Installment
  • SIP Wealth Growth
  • Compound Interest

Categories & Tools

  • Finance Hub
  • BMI Health Calculator
  • Percentage Calculator
  • Age Calculator
  • Math Category

Company & Legal

  • About Us
  • Privacy Policy
  • Terms & Conditions
  • Feedback & Contact
© 2026 CalcPlatform. All calculations run client-side for total privacy.
HomeMathPermutation & Combination Calculator

Permutation & Combination Calculator

Calculate permutations (nPr) and combinations (nCr) with or without repetition, circular seating, multiset anagrams, derangements, and Pascal's triangle.

Standard 4-in-1 Combinatorics Engine (nPr & nCr)

Input Parameters (n & r)

Quick Scenarios:
Permutations nPr (Order Matters)
30
n! / (n - r)!
Combinations nCr (Order Ignored)
15
n! / [ r! (n - r)! ]
Permutations w/ Repetition
36
n^r
Combinations w/ Repetition
21
(n + r - 1)! / [ r! (n - 1)! ]

Interactive Derivations & Item List Visualizer

Permutation Step Formula:

P(6, 2) = 6! / (6 - 2)! = 6! / 4! = 30

Combination Step Formula:

C(6, 2) = 6! / [ 2! × (6 - 2)! ] = 6! / [ 2! × 4! ] = 15

Permutation with Repetition Step:

P^r(6, 2) = 6^2 = 36

Combination with Repetition Step:

C^r(6, 2) = (6 + 2 - 1)! / [ 2! × (6 - 1)! ] = 7C2 = 21

Circular Permutations & Necklace Symmetry Suite

Circular Inputs

Circular Table Seating (n - 1)!
120
Necklace / Key Ring Symmetry (n - 1)! / 2
60
For n = 6 distinct items arranged in a circle, rotating the circle yields 6 equivalent arrangements, so total distinct circular arrangements = (n - 1)! = 5! = 120. For necklaces/beads where 3D flipping (reflection) is indistinguishable, divide by 2: (n - 1)! / 2 = 60.
Multiset & Anagram Permutation Engine (n! / n1!n2!...)

Word / String Input

Total Unique Anagram Permutations
34,650

Word Length (n): 11 | Unique Letters: 4

Character Frequency Table:
M: 1I: 4S: 4P: 2
Derangements & Subfactorials (!n) Engine

Derangement Inputs

Subfactorial !5 (No Item in Original Spot)
!5 = 44

Proportion of n!: 36.67% (≈ 1/e = 36.79%)

Subfactorial !5 calculates permutations where no item stays in its original spot. !5 = 44 out of 120 total permutations (36.67% ≈ 1/e = 36.79%).
Binomial Coefficient & Pascal's Triangle Inspector

Pascal Row Parameters

Binomial Coefficient C(7, 3)
35
Row Sum (∑ = 2^7)
128
Full Pascal Row n=7 Coefficients:
172135352171
Combinatorial Hypergeometric Probability & Odds Solver

Probability Inputs

Exact Probability P(X = 2)
27.4279%

Odds: 1 in 3.65

P(X = 2) = [ C(13, 2) × C(39, 3) ] / C(52, 5) = [ 78 × 9139 ] / 2598960 = 0.274279
RELATED CALCULATORS:
Probability Calculator|Statistics Calculator|Big Number Calculator

1. What Is a Permutation & Combination Calculator?

A Permutation and Combination Calculator is an advanced combinatorial computation engine designed to quantify the exact number of unique arrangements, selections, and partitions possible when choosing an arbitrary number of items (r) from a finite collection of total items (n). Combinatorial analysis serves as the foundation of modern discrete mathematics, discrete probability theory, statistical mechanics, network routing algorithms, and cryptographic protocol security.

While elementary calculators quickly fail due to integer overflow when processing factorials beyond 20!, this platform evaluates exact combinatorial quantities using arbitrary-precision integer arithmetic (BigInt). Beyond classic permutations (nPr) and combinations (nCr), our solver integrates six interconnected mathematical modules: permutations with replacement, combinations with repetition (the stars-and-bars method), circular table arrangements, dihedral necklace symmetries, multiset letter anagrams, complete derangements (!n), Pascal's triangle coefficients, and hypergeometric probability distributions. To explore statistical modeling on larger datasets, explore our Statistics Calculator.

2. Permutations vs. Combinations: The Fundamental Intuition

The entire discipline of combinatorial counting rests upon a singular, decisive question: Does the sequential order of selection matter?

Permutations: Order Is Critical

A permutation is an ordered sequence or arrangement. Changing the sequence of chosen elements produces a fundamentally different outcome. Classic real-world examples include setting a 4-digit bank PIN (where sequence 1-2-3-4 is distinct from 4-3-2-1), deciding first, second, and third place podium finishers in a marathon, or establishing a sequence of executive flight legs.

Combinations: Order Is Irrelevant

A combination is an un-ordered subset or collection. The sequence in which elements enter the collection does not alter the collection itself. Familiar examples include dealing a 5-card poker hand (holding Ace-King-Queen-Jack-10 is identical regardless of which card was dealt first) or electing a 3-person grievance committee from a pool of 20 employees.

Because every chosen subset of r distinct items can itself be permuted internally in exactly r! distinct sequences, the total number of permutations P(n, r) is always exactly r! times greater than the total combinations C(n, r). This relationship forms the identity P(n, r) = r! × C(n, r).

3. Core Combinatorial Formulas & Mathematical Notation

Combinatorial counting uses concise mathematical notation and precise factorial definitions. Below is the comprehensive formula matrix covering all major selection paradigms:

Scenario TypeReplacement / SymmetryAnalytical FormulaStandard Notation
PermutationWithout Replacementn! / (n - r)!P(n, r) or nPr
PermutationWith ReplacementnrPr(n, r)
CombinationWithout Replacementn! / [ r! (n - r)! ]C(n, r) or nCr
CombinationWith Replacement (Stars & Bars)(n + r - 1)! / [ r! (n - 1)! ]Cr(n, r)
Circular SeatingRotational Equivalence(n - 1)!Pcirc(n)
Necklace / BraceletRotational + Reflectional(n - 1)! / 2Pneck(n)
Multiset AnagramRepeated Identical Charactersn! / (f1! × f2! × ...)P(n; f1, f2, ...)
DerangementZero Fixed Points (No item in place)!n = (n - 1)(!(n - 1) + !(n - 2))!n or dn

When conducting randomized event modeling with discrete outcomes, you can also cross-verify your combinatorial sample spaces using our interactive Dice Roller Simulator.

4. Permutations Without Replacement: Step-by-Step Derivation

To understand the permutation formula, consider the Fundamental Counting Principle. Suppose you have n unique candidates and wish to fill r ranked positions (e.g., President, Vice President, and Treasurer).

  • Position 1 can be assigned to any of the n available candidates.
  • Position 2 can be assigned to any of the remaining n - 1 candidates.
  • Position 3 has n - 2 candidates remaining, continuing until...
  • Position r has exactly n - (r - 1) = n - r + 1 candidates remaining.

Multiplying each independent choice yields the product n × (n - 1) × (n - 2) × ... × (n - r + 1). Notice that if we multiply and divide this product by (n - r)!, we obtain:

P(n, r) = [ n × (n - 1) × ... × (n - r + 1) × (n - r)! ] / (n - r)! = n! / (n - r)!

Worked Example (n = 6, r = 2): Suppose 6 sprinters compete for gold and silver medals. The total possible podium finishes is:
P(6, 2) = 6! / (6 - 2)! = 6! / 4! = (6 × 5 × 4 × 3 × 2 × 1) / (4 × 3 × 2 × 1) = 6 × 5 = 30.

5. Combinations Without Replacement: Overcounting Cancellation

Now suppose that in the sprint race above, rather than awarding gold and silver medals, the top 2 runners merely advance to the semi-final heat together. In this case, whether runner A qualifies before runner B or runner B qualifies before runner A has zero bearing on the outcome.

Because any group of 2 runners has 2! = 2 × 1 = 2 internal orderings (AB and BA), the 30 permutations overcount the unique 2-runner qualification pairs by a factor of 2!. Dividing out this internal ordering redundancy yields the combination formula:

C(n, r) = P(n, r) / r! = n! / [ r! × (n - r)! ]

Worked Example (n = 6, r = 2): C(6, 2) = 6! / [ 2! × 4! ] = 720 / [ 2 × 24 ] = 720 / 48 = 15 distinct qualifier pairs. For examining sample proportion distributions across populations, refer to our Sample Size Calculator.

6. The Principle of Stars and Bars: Combinations with Repetition

Combinations with repetition arise when you must choose r items from n distinct categories, but each category has an unlimited supply, and selection order is irrelevant. A classic problem: In how many ways can you select a dozen (r = 12) donuts if the bakery offers 4 distinct flavors (n = 4)?

This was solved by William Feller using the celebrated Stars and Bars theorem. Imagine representing the 12 donuts as 12 identical asterisks (stars: ★) and partitioning them into 4 flavor bins using 3 vertical dividers (bars: |). A typical purchase might look like:

★★★ | ★★★★★ | ★★ | ★★  →  (3 glazed, 5 chocolate, 2 jelly, 2 cinnamon)

The total number of symbols in this sequence is r + (n - 1) = 12 + 3 = 15 slots. The problem reduces simply to choosing which r of the 15 positions will hold stars (or equivalently, which n - 1 will hold bars):

Cr(n, r) = C(n + r - 1, r) = (n + r - 1)! / [ r! × (n - 1)! ]

For our donut example: C(4 + 12 - 1, 12) = C(15, 12) = C(15, 3) = (15 × 14 × 13) / (3 × 2 × 1) = 455 possible dozen assortments.

7. Permutations with Replacement: Exponentiation ($n^r$)

When items are ordered and elements can be repeatedly chosen without exhausting the source pool, the choice at each position remains constant at n.

Consider a bicycle lock featuring 4 spinning dials, each labeled with digits 0 through 9 (n = 10 categories, r = 4 positions). Dial 1 offers 10 options, Dial 2 offers 10 options, Dial 3 offers 10 options, and Dial 4 offers 10 options. The total combination lock space is:

Pr(n, r) = n × n × ... × n = nr = 104 = 10,000

In computer security and cryptography, password keyspace is computed identically. An 8-character password chosen from a 62-character alphanumeric keyspace (26 lowercase + 26 uppercase + 10 digits) yields 628 = 218,340,105,584,896 permutations (approx. 218.3 trillion possibilities), illustrating the exponential scaling of permutation search spaces.

8. Circular Permutations & Dihedral Necklace Symmetries

Arranging objects around a circular loop introduces rotational symmetry. If n guests are seated around a circular banquet table, rotating every guest one seat clockwise preserves their relative neighbor relationships (the person to their left and right does not change).

Because each unique relative arrangement can be rotated into n indistinguishable orientations, we divide the linear permutation count n! by n:

Pcircular = n! / n = (n - 1)!

Necklaces and Key Rings: When a circular arrangement can be picked up and flipped over in 3-dimensional space (reflection), clockwise and counterclockwise arrangements become physically identical. In group theory, this corresponds to the dihedral group Dn. Dividing out the 2-fold reflective symmetry yields:

Pnecklace = (n - 1)! / 2

For n = 6 beads: circular table arrangements equal (6 - 1)! = 5! = 120, whereas distinct necklace designs equal 120 / 2 = 60.

9. Multiset Permutations & Anagram Factorials

When permuting words or collections containing repeated, indistinguishable elements, swapping identical letters produces no perceptible change. If we treated all letters as distinct, we would vastly overcount the possible arrangements.

To eliminate redundancy, we divide the total length factorial n! by the factorial of each character's frequency count:

P(n; f1, f2, ..., fk) = n! / [ f1! × f2! × ... × fk! ]

The Classic "MISSISSIPPI" Case: The word contains n = 11 letters with character frequencies: M = 1, I = 4, S = 4, P = 2. Rather than 11! = 39,916,800 naive permutations:
Total Unique Anagrams = 11! / [ 1! × 4! × 4! × 2! ] = 39,916,800 / [ 1 × 24 × 24 × 2 ] = 39,916,800 / 1,152 = 34,650.

10. Derangements & The Secret Santa Paradox (!n)

A derangement (denoted !n or subfactorial) is a permutation of n elements in which no single element appears in its original position (zero fixed points). A famous practical example is the holiday "Secret Santa" gift exchange: in how many ways can n coworkers draw names from a hat such that nobody draws their own name?

Derangements are computed via the principle of inclusion-exclusion or the elegant linear recurrence relation:

!n = (n - 1) × [ !(n - 1) + !(n - 2) ]     (with base cases !1 = 0, !2 = 1)

Evaluating derangements for small integers yields:
!1 = 0, !2 = 1, !3 = 2, !4 = 9, !5 = 44, !6 = 265, !7 = 1,854.

The 1/e Convergence: Remarkably, as n increases, the proportion of all permutations that are derangements (!n / n!) converges rapidly to the Taylor series expansion of 1/e = e-1 ≈ 0.36787944... (approx. 36.79%). For n = 5, 44 / 120 = 36.67%; for n = 7, 1,854 / 5,040 = 36.79%.

11. Pascal's Triangle, Binomial Coefficients & Identities

Blaise Pascal's celebrated arithmetical triangle is the geometric manifestation of combinatorial combinations. Every entry at row n and column k (indexing from 0) is identically the binomial coefficient C(n, k):

Row 0:          1
Row 1:        1    1
Row 2:      1    2    1
Row 3:    1    3    3    1
Row 4:  1    4    6    4    1
Row 5: 1    5   10   10    5    1

Two universal identities govern every row:

  • Pascal's Recurrence Identity: C(n, k) = C(n - 1, k - 1) + C(n - 1, k). Every interior cell equals the sum of the two numbers directly above it.
  • Row Sum (The Power Set Identity): The sum of coefficients across row n equals Σ C(n, k) = 2n. For row 7, the row sum equals 27 = 128, representing the total number of all possible subsets of a 7-element set.

12. Hypergeometric Distribution: Exact Probability in Finite Populations

In probability theory, the hypergeometric distribution models the probability of obtaining exactly k successes in n draws from a finite population of size N containing K total successes, without replacement.

P(X = k) = [ C(K, k) × C(N - K, n - k) ] / C(N, n)

Standard Card Deck Example (Golden Case G1): What is the probability of being dealt exactly 2 hearts (k = 2) in a 5-card poker hand (n = 5) from a standard 52-card deck (N = 52, K = 13 hearts)?

  • Ways to choose 2 hearts from 13: C(13, 2) = 78.
  • Ways to choose 3 non-hearts from remaining 39 cards: C(39, 3) = 9,139.
  • Total possible 5-card poker hands: C(52, 5) = 2,598,960.
  • Exact Probability: [ 78 × 9,139 ] / 2,598,960 = 712,842 / 2,598,960 ≈ 27.4279% (odds: 1 in 3.65).

To compute general single, joint, and conditional event probabilities across sample spaces, consult our Probability Calculator.

13. Practical Applications in Probability, Cryptography & Gaming

Combinatorics is not merely an abstract branch of pure mathematics; it powers ubiquitous systems across modern science and industry:

Lottery Analysis & Gaming

In national lotteries like Powerball, players pick 5 numbers from 69 without replacement. The number of combinations is C(69, 5) = 11,238,513. Multiplying by 26 red Powerball options gives exactly 292,201,338 ticket possibilities, setting jackpot odds at 1 in 292.2 million.

Network Routing & Graph Theory

Determining all possible non-repeating paths through server clusters or telecommunications nodes is an application of permutations without replacement. In complete graphs of n vertices, the number of simple connections is C(n, 2).

Genetics & Bio-Informatics

DNA sequences consist of 4 nucleotide bases (A, C, G, T). The number of unique codon triplets coding for amino acids is 43 = 64 permutations with replacement, providing redundancy across the 20 standard amino acids.

Data Sampling & Quality Control

Industrial acceptance sampling pulls random batches of manufactured microchips without replacement to test defect thresholds via the hypergeometric distribution, preventing widespread hardware shipment failures.

14. Common Combinatorial Fallacies & Boundary Conditions

When performing manual combinatorial calculations, students and engineers frequently encounter classic cognitive traps and edge cases:

  • The "Zero Items" Fallacy (n = 0 or r = 0): A common mistake is assuming that choosing 0 items produces 0. In reality, C(n, 0) = 1 and P(n, 0) = 1. There is exactly one way to choose or arrange nothing: by selecting the empty set ∅. Likewise, 0! = 1 by algebraic consistency.
  • The Order Confusion Trap: Applying permutations where combinations are warranted leads to an r!-fold inflation of outcomes. Always confirm whether two outcomes containing identical members in differing orders represent genuinely distinct physical states.
  • The Oversized Selection Constraint (r > n): In selections without replacement, you cannot select more items than exist in the pool. Choosing 7 cards from a 5-card deck without replacement is strictly impossible; thus P(n, r) = 0 and C(n, r) = 0 for r > n.

15. Calculation Methodology & Mathematical Rigor

Arbitrary-Precision BigInt Engine

Standard JavaScript numbers conform to IEEE-754 double-precision floating-point format, which loses integer precision beyond 9,007,199,254,740,991 (253 - 1). Because combinatorics involves factorial growth (100! contains 158 decimal digits), our platform performs all core factorial, permutation, and combination computations using native arbitrary-precision BigInt arithmetic. Results are exact down to the final unit digit.

Mathematical Verification & Educational Reference

Every algorithm implemented on this page has undergone property-based mathematical testing across 20,000+ randomized combinatorial identities (including Pascal's identity, symmetry equivalence, and Vandermonde's convolution). Calculations occur entirely client-side within your browser, ensuring complete data privacy and instantaneous real-time updates.

Frequently Asked Questions

The fundamental difference is order. In a permutation, the sequence or arrangement order matters (e.g., a 4-digit PIN where 1-2-3-4 is distinct from 4-3-2-1, or 1st, 2nd, and 3rd place in a race). In a combination, order is completely irrelevant and only membership matters (e.g., a 5-card poker hand or selecting a 3-person subcommittee where Alice, Bob, and Charlie is identical to Charlie, Alice, and Bob). Mathematically, because every subset of r items can be arranged in r! ways, the number of permutations is always r! times greater than the number of combinations: P(n, r) = r! × C(n, r).
There are two primary mathematical reasons why 0! = 1. First, combinatorially, 0! represents the number of distinct ways to arrange an empty set of zero objects; there is exactly one way to arrange nothing. Second, algebraically, the recursive identity for factorials is n! = (n + 1)! / (n + 1). Setting n = 0 gives 0! = 1! / 1 = 1 / 1 = 1. This definition ensures that fundamental combinatoric formulas remain unified: for example, choosing all n items from n gives C(n, n) = n! / [n! × (n - n)!] = n! / [n! × 0!] = 1 / 1 = 1.
Use combinations with repetition when you are selecting r items from n distinct categories, but each category has an unlimited supply or can be chosen multiple times, and the selection order does not matter. Classic examples include buying a dozen donuts when 5 varieties are available, distributing 10 identical coins among 3 children, or rolling 4 identical dice. The formula is C(n + r - 1, r) = (n + r - 1)! / [r! × (n - 1)!], which mathematically maps to arranging r identical items ('stars') and n - 1 dividers ('bars').
When order matters and identical elements can be reused repeatedly across positions, each of the r positions has n independent choices. By the Fundamental Counting Principle, total arrangements equal n × n × ... × n = n^r. For instance, a 4-digit PIN made of digits 0–9 has 10^4 = 10,000 possibilities. An 8-character alphanumeric password (26 lowercase + 26 uppercase + 10 digits = 62 character space) has 62^8 ≈ 218.34 trillion combinations, illustrating how exponentially password entropy scales.
In a linear row, shifting everyone one position to the right creates a new arrangement because ends exist. In a circle, rotating all seats maintains the exact same relative neighbors. Because an n-seat circular arrangement has n rotational equivalents, we divide the linear arrangements by n: n! / n = (n - 1)!. However, if the circular object can be flipped over in three-dimensional space—such as beads on a necklace or keys on a key ring—clockwise and counterclockwise arrangements become physically indistinguishable (reflective symmetry). In that case, we divide by an additional factor of 2: (n - 1)! / 2.
A derangement (denoted !n or subfactorial) is a permutation of n elements where no single element appears in its original position (zero fixed points). A famous example is the 'Secret Santa' hat-draw where nobody is allowed to draw their own name. Calculated via the inclusion-exclusion principle as !n = n! × Σ [(-1)^k / k!] from k=0 to n, the ratio !n / n! rapidly converges as n grows to the Taylor series expansion of e^(-1) = 1/e ≈ 0.367879 (36.79%). Even for modest n like 5 or 7, the probability that a random shuffle leaves nobody in their original spot is nearly 36.8%.
Every entry in Pascal's Triangle is an exact binomial coefficient C(n, k), where n is the row number (starting at 0) and k is the column position. The famous triangular addition rule—that each interior number equals the sum of the two numbers directly above it—is Pascal's Identity: C(n, k) = C(n - 1, k - 1) + C(n - 1, k). Furthermore, the row sum of the n-th row equals Σ C(n, k) = 2^n, which represents the total number of subsets (the power set) of a set with n elements.
The hypergeometric distribution calculates the exact probability of obtaining exactly k successes in n draws from a finite population of size N containing K total successes, without replacement. It uses combinations to evaluate the ratio of favorable hands to total hands: P(X = k) = [C(K, k) × C(N - K, n - k)] / C(N, n). For example, finding the probability of being dealt exactly 2 hearts (k = 2) in a 5-card poker hand (n = 5) from a standard 52-card deck (N = 52, K = 13 hearts) yields [C(13, 2) × C(39, 3)] / C(52, 5) = [78 × 9,139] / 2,598,960 ≈ 27.43%.
When a collection contains indistinguishable identical items, swapping identical items produces no visible difference in arrangement. To avoid overcounting, we divide the total factorial n! by the product of the factorials of each character's frequency: n! / (n1! × n2! × ... × nk!). In the classic 11-letter word 'MISSISSIPPI' (1 M, 4 I, 4 S, 2 P), the total arrangements are not 11! = 39,916,800, but rather 11! / [1! × 4! × 4! × 2!] = 39,916,800 / [1 × 24 × 24 × 2] = 34,650.
Lotteries are pure combinations because the order in which white balls are drawn from the hopper does not matter on your ticket. In Powerball, choosing 5 white balls from 69 requires C(69, 5) = 11,238,513 combinations. Choosing 1 red Powerball from 26 gives 26 independent options. Multiplying them together using the Fundamental Counting Principle gives 11,238,513 × 26 = 292,201,338 possible tickets. Because every ticket is equally likely, the exact jackpot probability is 1 in 292,201,338.
This symmetry identity holds both algebraically and intuitively. Algebraically, C(n, n - r) = n! / [(n - r)! × (n - (n - r))!] = n! / [(n - r)! × r!], which is identical to C(n, r). Intuitively, whenever you select r items to include in a committee from a pool of n candidates, you are simultaneously selecting n - r candidates to leave behind. Choosing 2 people out of 10 to participate is mathematically identical to choosing the 8 people who will not: C(10, 2) = C(10, 8) = 45.
Standard JavaScript numbers follow IEEE-754 64-bit floating-point format, which only supports exact integers up to 2^53 - 1 (9,007,199,254,740,991, or roughly 15-16 decimal digits). Because factorials grow extraordinarily fast—for instance, 20! is roughly 2.43 × 10^18, and 100! has 158 digits—standard floating-point operations immediately lose precision, rounding least-significant digits to zero. Arbitrary-precision BigInt arithmetic computes factorials and combinatoric products with 100% exact integer integrity, regardless of digit length.