The formulas this calculator uses
Combinatorics relies on factorials to evaluate how groups of objects can be arranged or selected. Here are the core formulas implemented by this tool:
1. Factorial Formula (n!)
n! = n × (n − 1) × (n − 2) × ... × 1 (with 0! = 1)
Example: 5! = 5 × 4 × 3 × 2 × 1 = 120
2. Permutation Formula (nPr) — Order Matters
nPr = n! ÷ (n − r)!
Example: 8P3 = 8! ÷ (8 − 3)! = 40,320 ÷ 120 = 336 arrangements
3. Combination Formula (nCr) — Order Does Not Matter
nCr = n! ÷ [r! × (n − r)!]
Example: 8C3 = 8! ÷ [3! × 5!] = 40,320 ÷ (6 × 120) = 56 combinations
Permutations vs. combinations: understanding the distinction
The main difference between permutations (nPr) and combinations (nCr) comes down to whether sequence matters. Permutations measure ordered arrangements. For instance, selecting 1st, 2nd, and 3rd place winners out of 8 competitors yields 336 distinct outcomes because assigning different spots to the same three people creates a new result. Combinations measure unordered selections. Selecting 3 people from a group of 8 to form a committee yields only 56 outcomes because the group members are identical regardless of the order they were picked.
Mathematical properties of factorials and 0!
A factorial counts the number of ways to arrange n distinct objects in a line. As n increases, factorial values grow rapidly (a property known as factorial growth). While 1! equals 1, mathematical convention defines 0! = 1 as well. Defining 0! as 1 ensures that probability formulas remain consistent without requiring special edge-case rules when selecting all items (nCn = 1) or zero items (nC0 = 1).
Real-world applications in probability and computing
Factorials, permutations, and combinations are foundational in computer science, statistics, network architecture, and decision theory. They are used to evaluate password complexity, estimate probability distributions, calculate hand odds in card games, and optimize routing algorithms in logistics networks.
How to use this calculator
- Enter the total number of items in the set (n).
- Enter the subset size of items to choose or arrange (r).
- Review the instantly calculated values for n!, nPr, and nCr.
Frequently asked questions
What is a factorial?
The factorial of a non-negative integer n (written as n!) is the product of all positive integers less than or equal to n. For example, 5! = 5 × 4 × 3 × 2 × 1 = 120.
What is the difference between nPr and nCr?
nPr (permutations) counts total arrangements where the sequence or order matters. nCr (combinations) counts subsets where order does not matter. Because order adds extra arrangements, nPr is always greater than or equal to nCr.
Why does 0! equal 1?
By mathematical definition and convention, 0! = 1. This ensures formulas like combinations (nCr) and permutations (nPr) remain mathematically consistent when choosing 0 items or all n items.
Why must r be less than or equal to n?
You cannot choose or arrange a set of items (r) larger than the total pool of unique items available (n) without replacement.