Combinatorics: Permutations and Combinations

Counting arrangements, counting selections, and the factorial that separates them.

Combinatorics: Permutations and Combinations

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

Permutations count arrangements — order matters. n! / (n−k)!
Combinations count selections — order does not. n! / (k!(n−k)!)
The two differ by exactly k!: the number of orders each selection could have arrived in.
The bars are C(n, k) for every k. Symmetric, because choosing k to keep is choosing n−k to leave.

Overview

Choose the counting rule

For ordered selections of k distinct items from n, the count is n!/(n−k)!. If order does not matter, divide by k! to get the number of combinations, n choose k. If each of k positions can independently take any of n values, repetition is allowed and there are nᵏ sequences.

For a five-card hand from a 52-card deck, order does not matter and cards cannot repeat, so there are 52 choose 5 hands. If instead a five-character code can reuse any of ten digits, there are 10⁵ codes. The problem statement determines the model; choosing a formula before clarifying order and repetition is a common source of errors.

C(n,k) = n! / [k!(n−k)!]
In this guide
  1. Connection to probability
  2. Decide whether order matters before counting
  3. Try this above
  4. Sources and next steps

Combinatorics

Count outcomes by deciding whether order matters and whether items can repeat.

Connection to probability

When outcomes are equally likely, probability can be found as favourable outcomes divided by total outcomes. This shortcut does not apply when outcomes have unequal probabilities. The binomial distribution uses combinations to count which k trials succeed; probability basics explains the assumptions.

Decide whether order matters before counting

A permutation is an arrangement where changing order creates a new outcome; a combination is a selection where order does not matter. If choosing a president and treasurer from 8 people, there are 8×7=56 ordered role assignments because swapping the people changes the roles. If selecting any two people for a committee, the same pair is counted twice in those arrangements, so there are 8×7/2=28 committees. Repetition changes the count too: a 4-digit PIN has 10⁴ possibilities if digits can repeat, but 10×9×8×7 if they cannot.

Factorials count arrangements: n! is n×(n−1)×…×1, and 0!=1 by convention. The combination formula divides the number of ordered selections by k!, the number of ways to reorder each selected group. For probability, favourable/total is valid only when the counted outcomes are equally likely. A shuffled deck's five-card hands are equally likely, but the possible values of a sum of two dice are not: seven has more underlying pairs than two. Count at the level of equally likely outcomes before taking a ratio.

Try this above

Choose a small n and k, then compare ordered selections with combinations. Toggle repetition and verify how the outcome count changes.

The binomial coefficient also counts which k successes occur among n independent trials, regardless of the order in which a particular set of success positions is listed. For five coin flips, there are C(5,2)=10 ways to choose the two positions that are heads. If each sequence is equally likely, the probability of exactly two heads is 10/2⁵. The coefficient counts arrangements; the probability additionally depends on the trial probabilities. For a biased coin, each sequence has a different probability by its number of heads, which is why the binomial formula includes pᵏ(1−p)ⁿ⁻ᵏ.

When order does not matter and repetition is allowed, the count is “combinations with repetition,” C(n+k−1,k), not nᵏ, because sequences that differ only by order represent the same selection. For example, selecting three scoops from four flavours with repeats allowed gives C(6,3)=20 multisets. This is a different model from choosing a three-character code where position matters. Translate the story into positions, distinctness, and order before selecting a formula.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. What separates a permutation count from a combination count?

  2. Why is C(n, k) symmetric in k?

  3. Why should you not compute C(n, k) from factorials directly?

Cheat sheet

Combinatorics: Permutations and Combinations

Count arrangements with and without order, with and without replacement. One decision tree picks the right formula every time.

MATHS · vizlearn.in/maths/combinatorics.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.