Combinations & Permutations

Count combinations (nCr) and permutations (nPr) of a selection.

Combinations (nCr)
Permutations (nPr)
n factorial (n!)
r factorial (r!)
Order matters?
nPr yes · nCr no

Needs whole numbers with r ≤ n. Very large factorials are shown in approximate form.

Counting the ways to choose

When you pick r items from a set of n, the count depends on whether order matters. Permutations treat different orders as distinct; combinations treat the same group as one, however it is arranged.

nPr = n! ÷ (n − r)! · nCr = n! ÷ (r! (n − r)!)

Combinations are simply permutations with the duplicate orderings divided out, which is why nCr is always nPr divided by r!. Both are built on the factorial.

Worked example

Choosing 2 from 5: there are 20 permutations (nPr) if order matters, but only 10 combinations (nCr) once order is ignored, since each pair is counted once.

Where they show up

Combinations answer lottery odds, hand-of-cards counts and how many committees a group can form. Permutations handle race podiums, PIN codes and seating orders. Recognising which one a problem needs is half the battle.

Quick checks

  • Order matters → permutation. Rankings, codes, arrangements.
  • Order ignored → combination. Groups, selections, subsets.
  • nCr ≤ nPr. Always, because nCr removes the orderings.

Frequently asked questions

What is the difference between a combination and a permutation?
A permutation counts ordered selections — ABC differs from CAB. A combination counts unordered ones — ABC and CAB are the same group. So there are always at least as many permutations as combinations.
What are the formulas?
nPr = n! ÷ (n − r)! and nCr = n! ÷ (r! × (n − r)!). The combination formula divides the permutations by r! to remove the duplicate orderings.
When do I use each?
Use permutations when order matters — race finishes, passwords, rankings. Use combinations when it does not — lottery numbers, committees, pizza toppings.
What is a factorial?
n! is the product of all whole numbers from 1 to n, so 5! = 120. It counts the ways to arrange n distinct items in order, and underpins both formulas.