Combinations & Permutations
Count combinations (nCr) and permutations (nPr) of a selection.
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.
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.