Complete Guide & Reference
1. Overview
Permutations and combinations are fundamental concepts in combinatorics, the branch of mathematics
that deals with counting, arranging, and selecting elements from sets. Both describe the number of
ways to select a subset of r items from a larger set of n items, but they differ in whether the
order of selection matters.
- Permutation: Order matters. Different arrangements of the same items count as distinct results.
- Combination: Order does not matter. Different arrangements of the same items count as one result.
2. Permutations
A permutation is an arrangement of items from a set where the order of selection is important.
For example, choosing a president, vice president, and secretary from a group of people is a
permutation because each position is distinct.
Formula
nPr = n! / (n − r)!
where n is the total number of items, r is the number of items to choose, and ! denotes factorial
(the product of all positive integers up to that number).
Example: n = 6, r = 2
6P2 = 6! / (6 − 2)! = 720 / 24 = 30
There are 30 different ordered ways to choose 2 items from a set of 6.
Special Cases
- If r = 0: nP0 = 1 (there is exactly one way to choose nothing)
- If r = n: nPn = n! (full permutation of the entire set)
- If r > n: nPr = 0 (impossible to choose more items than available)
3. Combinations
A combination is a selection of items from a set where the order of selection does not matter.
For example, choosing a committee of 3 people from a group is a combination because the roles
are identical — it does not matter who is picked first.
Formula
nCr = n! / (r! × (n − r)!)
This is also known as the binomial coefficient, read as "n choose r". It divides the permutation
count by r! to account for all the orderings of the same r items.
Example: n = 6, r = 2
6C2 = 6! / (2! × 4!) = 720 / (2 × 24) = 720 / 48 = 15
There are 15 different unordered ways to choose 2 items from a set of 6.
Properties
- nCr = nCn−r (symmetry: choosing r items is the same as leaving out n−r items)
- nC0 = nCn = 1
- nC1 = n
- nCr ≤ nPr for all valid n, r
4. Key Differences: Permutation vs Combination
| Basis of Comparison | Permutation | Combination |
| Order | Order matters | Order does not matter |
| Denotes | Arrangement | Selection |
| Formula | n! / (n−r)! | n! / (r! (n−r)!) |
| Number of ways | Multiple for same set | Single for same set |
| Example | Pick 1st, 2nd, 3rd place winners | Pick 3 committee members |
| n=6, r=2 | 30 | 15 |
5. Factorial Function
The factorial of a non-negative integer n, denoted by n!, is the product of all positive integers
less than or equal to n. By definition, 0! = 1.
n! = n × (n − 1) × (n − 2) × ... × 3 × 2 × 1
Examples:
- 0! = 1
- 1! = 1
- 2! = 2 × 1 = 2
- 3! = 3 × 2 × 1 = 6
- 4! = 4 × 3 × 2 × 1 = 24
- 5! = 5 × 4 × 3 × 2 × 1 = 120
- 6! = 6 × 5 × 4 × 3 × 2 × 1 = 720
6. How to Use This Calculator
- Enter the total number of items in the set in the n field (must be a non-negative integer).
- Enter the number of items to choose in the r field (must be a non-negative integer).
- Click the Calculate button.
- The permutation and combination results will appear in the Result panel, along with the formula substitution.
- Click Clear to reset both input fields and results.
7. Worked Examples
Example 1 — Lottery Numbers
A lottery game draws 5 numbers from 1 to 49. Does order matter? No — the numbers on your ticket
can be in any order. This is a combination problem.
- n = 49, r = 5
- 49C5 = 49! / (5! × 44!) = 1,906,884
- There are 1,906,884 possible 5-number combinations.
Example 2 — Race Rankings
8 runners compete in a race. How many different ways can gold, silver, and bronze medals be awarded?
Order matters because each medal is distinct. This is a permutation problem.
- n = 8, r = 3
- 8P3 = 8! / 5! = 8 × 7 × 6 = 336
- There are 336 possible podium arrangements.
Example 3 — Team Selection
How many ways can a coach choose 11 players from a squad of 20? Order does not matter — all
selected players are on the team. This is a combination problem.
- n = 20, r = 11
- 20C11 = 167,960
8. Real-World Applications
- Probability & Statistics: Calculating odds, sampling distributions, hypothesis testing
- Lottery & Gaming: Odds calculation, poker hands, slot machine combinations
- Computer Science: Password complexity, brute-force attack estimates, algorithm analysis
- Genetics: Gene combinations, DNA sequence permutations
- Business: Portfolio selection, committee formation, scheduling
- Cryptography: Key space size, permutation ciphers
- Operations Research: Scheduling, routing problems, assignment problems
- Chemistry: Molecule arrangements, isomer counting
9. Important Notes
- Both n and r must be non-negative integers (0, 1, 2, ...).
- If r > n, both permutation and combination equal 0 — it is impossible to choose more items than exist.
- 0! is defined as 1 by mathematical convention, which makes the formulas work for edge cases.
- Factorials grow extremely fast. For very large n (n > 170), results may exceed JavaScript number limits.
- This calculator assumes selection without replacement — items are not put back after being chosen.
- For permutations with repetition allowed, the formula is nr instead of n! / (n−r)!.
- For combinations with repetition allowed, the formula is (n + r − 1)! / (r! × (n − 1)!).
10. Related Concepts
- Factorial (!): Product of all positive integers up to n
- Binomial Theorem: Expansion of (a + b)n using binomial coefficients
- Pascal's Triangle: Triangular array of binomial coefficients
- Permutations with repetition: Arranging items where duplicates exist
- Combinations with repetition: Selecting items where replacement is allowed
- Circular permutations: Arrangements around a circle (rotations considered identical)
- Multinomial coefficients: Dividing n items into multiple groups of specified sizes
- Probability: Number of favorable outcomes divided by total possible outcomes
11. References
1. Rosen, Kenneth H. Discrete Mathematics and Its Applications. McGraw-Hill Education. 2019.
2. Johnsonbaugh, Richard. Discrete Mathematics. Pearson Education. 2018.
3. Grimaldi, Ralph P. Discrete and Combinatorial Mathematics. Pearson Education. 2003.
4. Graham, Ronald L., Knuth, Donald E., and Patashnik, Oren. Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley. 1994.
5. Feller, William. An Introduction to Probability Theory and Its Applications, Vol. 1. John Wiley & Sons. 1968.
6. Tucker, Alan. Applied Combinatorics. John Wiley & Sons. 2012.