Permutation and Combination Calculator

Calculate permutations and combinations for sets of size n and subsets of size r.

Permutation

A B C AB, BA, AC, CA, BC, CB = 6
Order matters

Combination

A B C {AB}, {AC}, {BC} = 3
Order does not matter
Result
Permutations, nPr = 6! (6 - 2)! = 30
Combinations, nCr = 6! 2! × (6 - 2)! = 15

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.

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

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

4. Key Differences: Permutation vs Combination

Basis of ComparisonPermutationCombination
OrderOrder mattersOrder does not matter
DenotesArrangementSelection
Formulan! / (n−r)!n! / (r! (n−r)!)
Number of waysMultiple for same setSingle for same set
ExamplePick 1st, 2nd, 3rd place winnersPick 3 committee members
n=6, r=23015

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:

6. How to Use This Calculator

  1. Enter the total number of items in the set in the n field (must be a non-negative integer).
  2. Enter the number of items to choose in the r field (must be a non-negative integer).
  3. Click the Calculate button.
  4. The permutation and combination results will appear in the Result panel, along with the formula substitution.
  5. 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.

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.

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.

8. Real-World Applications

9. Important Notes

10. Related Concepts

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.