Home/Daily Essentials, Financial & Math Calculators/Permutation & Combination Calculator

Permutation & Combination Calculator

Calculate permutations (nPr) and combinations (nCr) with exact BigInt precision and full step-by-step derivations.

Combinatorics Parameters

Total pool size
Items selected

Can individual elements be chosen more than once?

Presets & Use Cases

Solution & Mathematical Breakdown

nCr
Total Possible OutcomesWithout Repetition
120
Formula: C(n, r) = n! / (r! × (n - r)!)n=10, r=3

Step-by-Step Derivation

[1]Formula: C(n, r) = n! / (r! × (n - r)!)
[2]Factorial n!: 10! = 3,628,800
[3]Factorial r!: 3! = 6
[4]Factorial (n - r)!: (10 - 3)! = 7! = 5,040
[5]Divide: 3,628,800 / (6 × 5,040)
[6]Result = 120
BigInt Exact Precision EngineTwisterTools Math Engine

Core Principles of Permutations and Combinations

In discrete mathematics, probability theory, and computer science, permutations and combinations are foundational techniques used to calculate the size of sample spaces and evaluate total possibilities. The primary rule that governs which calculation to choose is whether the order of selection matters.

Permutations (nPr) — Order is Critical

A permutation is an ordered arrangement of items. Changing the sequence creates a completely distinct outcome. For example, a security lock code set to 4-1-8 is entirely different from 8-1-4, even though both share the exact same digits.

Combinations (nCr) — Order Does Not Matter

A combination is an unordered selection or subset. Reordering the elements does not create a new outcome. For instance, choosing 3 fruit toppings for an ice cream sundae yields the exact same snack regardless of which fruit is added first.

Factorials (n!) and Mathematical Limits

Both formulas rely heavily on factorials. A factorial, denoted by n!, multiplies an integer by every positive integer below it down to 1 (e.g., 5! = 5 x 4 x 3 x 2 x 1 = 120). By standard mathematical definition, 0! = 1. Standard JavaScript numeric types cap precision at 15 digits, but TwisterTools utilizes native JavaScript BigInt architecture to deliver 100% exact, unrounded calculations up to 100 factorial without scientific notation distortion.

Combinatorics Formulas Reference Matrix

Refer to the table below to select the appropriate mathematical formula based on sequence importance and whether items can be repeated or replaced during selection:

TypeRepetitionFormulaPrimary Use CasesSample Result (n=5, r=3)
Permutation (nPr)NoP(n, r) = n! / (n - r)!Race podium positions, election seating order60
Permutation (nPr)YesP_rep(n, r) = n^rDigital lock PINs, password string permutations125
Combination (nCr)NoC(n, r) = n! / (r! × (n - r)!)Lottery tickets, poker hand hands, committees10
Combination (nCr)YesC_rep(n, r) = (n + r - 1)! / (r! × (n - 1)!)Sampling with replacement, coin distribution35

Real-World Step-by-Step Worked Examples

Examine how permutations and combinations are applied across practical domains including cybersecurity, sports, and gaming:

Example 1: Security PIN Cracking ComplexityPermutation with Repetition

Calculate the total number of unique password possibilities for a 4-digit security PIN using digits 0 through 9 where numbers can be repeated.

Total Digits (n) = 10
PIN Length (r) = 4
Formula = n^r = 10^4
Total Possibilities = 10,000 PINs
Example 2: Major Lottery Jackpot OddsCombination without Repetition

Calculate the total combination count when choosing 6 winning numbers from a total pool of 49 numbers in a national lottery draw.

Total Pool (n) = 49
Drawn Numbers (r) = 6
Formula = 49! / (6! × 43!)
Total Combinations = 13,983,816 tickets

How to Use the Combinatorics Calculator

1

Select Calculation Mode

Choose Combination (nCr) if order is irrelevant, or Permutation (nPr) if arrangement sequence matters.

2

Enter n and r Values

Input the total pool size (n) and sample count (r). Inputs automatically sanitize invalid characters.

3

Toggle Item Repetition

Check the repetition toggle if chosen elements can be selected multiple times in a single set.

4

Export & Review Math

Review the full factorial derivation steps, copy the summary, or download a CSV report for spreadsheet analysis.

Frequently Asked Questions (FAQ)

What is the fundamental difference between permutations and combinations?

The fundamental difference lies in sequence order. Permutations (nPr) require a specific order where arrangements matter (such as password PINs or race rankings). Combinations (nCr) count unique subsets where order is irrelevant (such as lottery draws or team selections).

What is the formula for Permutation nPr?

The formula for permutations without repetition is P(n, r) = n! / (n - r)!. When repetition is allowed, the formula simplifies to P_rep(n, r) = n^r.

What is the formula for Combination nCr?

The formula for combinations without repetition is C(n, r) = n! / (r! * (n - r)!). When repetition is allowed, the formula becomes C_rep(n, r) = (n + r - 1)! / (r! * (n - 1)!).

Why do combinations yield smaller numbers than permutations?

Combinations produce smaller totals because they eliminate duplicate arrangements of identical items. In permutations, selecting items A and B is distinct from B and A. In combinations, {A, B} counts as a single grouping.

How is factorial (n!) calculated in combinatorics?

A factorial (n!) is the product of all positive integers less than or equal to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. By mathematical convention, 0! is always equal to 1.

Related & Complementary Utilities

Explore more privacy-first client-side web tools.