Learn first: Natural numbers and operations
Combinatorics answers the question "in how many ways?": how many numbers can be formed, how many groups chosen, how many orders obtained. Probability theory rests on this counting too. The main difficulty is not the formula itself but knowing which formula to use: does order matter, are repetitions allowed?
All the formulas below are built on these two rules.
How many three-digit numbers have all digits different?
If digits may repeat: there are 5⁴ = 625 four-digit numbers made of the digits 1, 2, 3, 4, 5.
The number of ways to arrange n different objects in a row:
Pₙ = n! = 1·2·3·…·n, 0! = 1
Why? There are n choices for the first place, n − 1 for the second, …, 1 for the last — the product rule.
Permutations with repetition: if some objects are identical, swapping them gives no new order:
P = n!/(n₁!·n₂!·…·nₖ!)
For example, the letters of MAMA give 4!/(2!·2!) = 6 different "words".
Around a circle n people can be seated in (n − 1)! ways (rotations count as the same).
5 different books are put on a shelf, and two particular books must stand together. How many ways?
We choose k objects out of n.
Arrangements (order matters): Aₙᵏ = n!/(n − k)! = n(n − 1)…(n − k + 1)
Combinations (order does not matter): Cₙᵏ = n!/(k!(n − k)!) = Aₙᵏ/k!
Why divide by k!? Each group can be listed in k! orders, and in combinations they all count as one.
How to tell them apart: if the chosen objects get different "roles" or "places" (chair, deputy; digit positions) — A; if we just pick a "set" (a team, a group, handshakes) — C.
Cₙᵏ = Cₙⁿ⁻ᵏ, Cₙ⁰ = Cₙⁿ = 1, Cₙᵏ + Cₙᵏ⁺¹ = Cₙ₊₁ᵏ⁺¹, Cₙ⁰ + Cₙ¹ + … + Cₙⁿ = 2ⁿ
From 10 students, in how many ways can we choose: a) a group of 3; b) a chair, a deputy and a secretary?
How many diagonals does a decagon have?
General formula: n(n − 3)/2.
If we choose independently from several groups, multiply. For "at least one" it is easier to subtract the opposite case.
In how many ways can a committee of 3 boys and 2 girls be formed from 6 boys and 5 girls?
From the same 11 people we choose 3, and at least one must be a girl.
(a + b)ⁿ = Σ Cₙᵏ aⁿ⁻ᵏ bᵏ, general term Tₖ₊₁ = Cₙᵏ aⁿ⁻ᵏ bᵏ
Find the coefficient of x³ in the expansion of (2x − 1)⁵.
Find the constant term (the term without x) in the expansion of (x + 1/x)⁶.
The earlier formulas assumed that the elements are not repeated. But in problems about PIN codes, phone numbers or number plates, the same digit may be used again and again. Then the number of choices for each position stays the same, and the multiplication rule gives the formula at once.
Arrangements with repetition: the number of ordered strings of length k from n kinds of element is nᵏ
For example, there are 10⁴ = 10 000 four-digit PIN codes made from the digits 0 to 9, because each position can hold any of the 10 digits.
There are also selections where order does not matter but a kind may be taken more than once: buying 3 ice creams from 4 flavours (the same flavour may be chosen twice). These are called combinations with repetition:
choosing k items from n kinds (repetition allowed, order irrelevant): C(n + k − 1, k)
The idea behind the formula: write a row of k ‘stars’ (the chosen items) and n − 1 ‘bars’ separating the kinds; it is enough to choose k places for the stars out of n + k − 1. For example, 3 ice creams from 4 flavours: C(6, 3) = 20 ways.
To choose a formula, answer two questions: 1) does order matter? 2) is repetition allowed? These two answers pick one of four cases — Aₙᵏ, Cₙᵏ, nᵏ or C(n + k − 1, k).
A four-digit PIN code is made from the digits 0–9. In how many codes does at least one digit repeat?