Permutations and Combinations
nPr counts ordered choices of r from n; nCr counts unordered choices.
ₙPᵣ = n! ÷ (n − r)! ₙCᵣ = n! ÷ (r!(n − r)!)
n! (factorial) is 1 × 2 × … × n, with 0! = 1.
Order does not matter for combinations, so nCr = nPr ÷ r!.
Calculator
Change a value and the result and picture update instantly.
Result
Permutations nPr
Combinations nCr
Animated picture
The picture follows your values. Some points and shapes can be dragged.
Use in game development
Count possible card hands or puzzle layouts to estimate probabilities and difficulty.
Code example (JavaScript)
let c = 1; for (let i = 1; i <= r; i++) c = c * (n - r + i) / i; // nCr
What the symbols mean
| Symbol | Meaning |
|---|---|
n | Total n |
r | Chosen r |
P | Permutations nPr |
C | Combinations nCr |
More formulas in this category
- Mean and Median
- Variance and Standard Deviation
- Binomial Distribution
- Probability of at Least One Success (Drop Rates)
- Expected Value
- Normal Distribution
Frequently asked questions
- What is the formula for Permutations and Combinations?
- The formula for Permutations and Combinations is ₙPᵣ = n! ÷ (n − r)! ₙCᵣ = n! ÷ (r!(n − r)!). nPr counts ordered choices of r from n; nCr counts unordered choices.
Math Formula Quiz Probability & Statistics
Sources
Checked: 2026-11-29