← Back to course

Math — Mechina

Combinatorics and the binomial theorem

Summary

In every counting question ask two things: does order matter? Is repetition allowed? The answers determine the formula.

P(n,k)=n!(n−k)!,(nk)=n!k!(n−k)!,nk (with repetition)P(n,k)=\frac{n!}{(n-k)!},\qquad \binom nk=\frac{n!}{k!(n-k)!},\qquad n^k\ \text{(with repetition)}
(a+b)n=∑k=0n(nk)an−kbk,Tk+1=(nk)an−kbk(a+b)^n=\sum_{k=0}^n\binom nk a^{n-k}b^k,\qquad T_{k+1}=\binom nk a^{n-k}b^k
  • “At least one” — complement: everything minus “none”.
  • “Together” — glue into one block and multiply by the arrangements inside the block.
  • “Not together” — everything minus “together”.
  • The sum of a polynomial's coefficients = substitute x=1x=1.

The multiplication principle — the basis of everything

If one choice can be made in mm ways and then a second in nn ways, there are m⋅nm\cdot n options in all. Example: 33 shirts and 44 pairs of trousers make 1212 outfits. Every formula in the topic is a special case of this principle. If the choices are "either-or" (one or the other, no overlap), you add instead of multiplying.

The four cases

  • Order matters, no repetition — arrangements: from 1010 runners, how many ways to award gold, silver and bronze? 10⋅9⋅8=720=P(10,3)10\cdot9\cdot8=720=P(10,3).
  • Order matters, with repetition: a 44-digit code — 104=1000010^4=10000.
  • Order does not matter, no repetition — combinations: a committee of 33 out of 1010 people — (103)=120\binom{10}3=120. That is 720720 divided by 3!=63!=6, because each committee was counted 66 times in different orders.
  • Arranging everyone: nn people in a row — n!n!; around a round table — (n−1)!(n-1)!, because rotating everyone does not change the arrangement.

Repeated letters in a word

How many different words can be made from the letters of BANANA? If all letters were different — 6!=7206!=720. But the three A's are identical (swapping them makes no new word) and so are the two N's, so we divide: 6!3! 2!=60\frac{6!}{3!\,2!}=60.

The complement method

When it says "at least one", "at least two" or "not all", it is almost always easier to count the opposite and subtract from the total. Example: how many 44-digit codes contain the digit 77 at least once? Total: 10410^4; with no 77 at all: 94=65619^4=6561; answer: 10000−6561=343910000-6561=3439.

Newton's binomial

The coefficient (nk)\binom nk appears when expanding (a+b)n(a+b)^n because it counts the ways to take bb from kk of the nn brackets. The coefficients form Pascal's triangle: each number is the sum of the two above it. Example: the constant term of (x2−1x)6\left(x^2-\frac1x\right)^6. The general term is (6k)(x2)6−k(−1x)k\binom6k(x^2)^{6-k}\left(-\frac1x\right)^k; the power of xx is 12−2k−k=12−3k12-2k-k=12-3k, which is zero when k=4k=4. The term: (64)⋅(−1)4=15\binom64\cdot(-1)^4=15.

How to approach a problem

  1. Ask: does order matter? Is repetition allowed? Are there identical items?
  2. If there is a special condition ("together", "at the ends"), deal with it first.
  3. If it says "at least", consider the complement.
  4. Compute, and check on a small example: say 33 items instead of 1010, which you can count by hand.

Common mistakes

  • Using combinations when order matters (different roles, different places).
  • Counting the same option twice in overlapping cases.
  • Forgetting to divide for identical letters.
  • In the binomial, forgetting the sign and the coefficient inside the bracket, e.g. (2x)k(2x)^k.
  • Using n!n! instead of (n−1)!(n-1)! for a circle.

Question types

1

Choosing a committee with conditions

Choosing a group (order does not matter) with restrictions.

Worked example

From 6 men and 4 women a committee of 4 with at least one woman is chosen. How many ways?

Solution

IdeaComplement.
  1. All: (104)=210\binom{10}4=210.
  2. No women: (64)=15\binom64=15.
  3. 210−15=195210-15=195.
CheckSum by the number of women: (41)(63)+(42)(62)+(43)(61)+(44)=80+90+24+1=195\binom41\binom63+\binom42\binom62+\binom43\binom61+\binom44=80+90+24+1=195 ✓.
Common mistake(41)(93)\binom41\binom93 — counts committees twice.

Variants of this type · 1

1.1Chair and deputy

Worked example

From 10 people a chair and a deputy are chosen.

Solution

IdeaOrder matters.
  1. 10⋅9=9010\cdot9=90.
Check✓.
Common mistake(102)=45\binom{10}2=45.
2

Arranging in a row with “together” and “not together”

Arranging people or letters with an adjacency condition.

Worked example

In how many ways can 5 people stand in a row so that A and B are together?

Solution

IdeaOne block.
  1. 4 units: 4!=244!=24.
  2. Inside the block: 22.
  3. 4848.
Check“Not together”: 120−48=72120-48=72 ✓.
Common mistakeForgetting the 2!2!.
3

The general term of a binomial

The coefficient of xmx^m or the constant term.

Worked example

Find the constant term of (x2−1x)6\left(x^2-\frac1x\right)^6.

Solution

IdeaTk+1=(6k)(x2)6−k(−x−1)kT_{k+1}=\binom6k(x^2)^{6-k}(-x^{-1})^k.
  1. Power of xx: 12−3k=0⇒k=412-3k=0\Rightarrow k=4.
  2. (64)(−1)4=15\binom64(-1)^4=15.
Checkkk is an integer between 00 and 66 ✓.
Common mistakeForgetting the sign (−1)k(-1)^k.

Exam-style problems

One problem with several parts on the same data, as on the exam. Each part adds something to the drawing.

Practice · 20

Test yourself with problems and full solutions.

Go to practice