Permutation & Combination Calculator
Calculate permutations (nPr) and combinations (nCr) with exact BigInt precision and full step-by-step derivations.
Combinatorics Parameters
Can individual elements be chosen more than once?
Solution & Mathematical Breakdown
nCrStep-by-Step Derivation
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:
| Type | Repetition | Formula | Primary Use Cases | Sample Result (n=5, r=3) |
|---|---|---|---|---|
| Permutation (nPr) | No | P(n, r) = n! / (n - r)! | Race podium positions, election seating order | 60 |
| Permutation (nPr) | Yes | P_rep(n, r) = n^r | Digital lock PINs, password string permutations | 125 |
| Combination (nCr) | No | C(n, r) = n! / (r! × (n - r)!) | Lottery tickets, poker hand hands, committees | 10 |
| Combination (nCr) | Yes | C_rep(n, r) = (n + r - 1)! / (r! × (n - 1)!) | Sampling with replacement, coin distribution | 35 |
Real-World Step-by-Step Worked Examples
Examine how permutations and combinations are applied across practical domains including cybersecurity, sports, and gaming:
Calculate the total number of unique password possibilities for a 4-digit security PIN using digits 0 through 9 where numbers can be repeated.
Calculate the total combination count when choosing 6 winning numbers from a total pool of 49 numbers in a national lottery draw.
How to Use the Combinatorics Calculator
Select Calculation Mode
Choose Combination (nCr) if order is irrelevant, or Permutation (nPr) if arrangement sequence matters.
Enter n and r Values
Input the total pool size (n) and sample count (r). Inputs automatically sanitize invalid characters.
Toggle Item Repetition
Check the repetition toggle if chosen elements can be selected multiple times in a single set.
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.
Exact Age Calculator & Chronological Milestone Suite
Calculate exact chronological age in years, months, weeks, days, and hours. Includes upcoming birthday countdowns and historical day-count milestones.
Multi-Mode Percentage Calculator & Growth Suite
Calculate percentage changes, value distributions, markups, discounts, and reverse percentages instantly with dynamic step-by-step math breakdowns.
Master Unit Converter
Convert between various standard units of measurement including length, weight, temperature, area, volume, speed, and more.