Gradient

Courses

∇\nabla∇The maths behind AI0/72
π\piπMaths0/84
⋆\star⋆AI for everyone0/10
Γ\GammaΓGame theory0/49
py\texttt{py}pyPython for AI0/15
y^\hat{y}y^​Build your own AI0/15
All courses

Tuition

My tuitionOlympiad trackCompetitions

Practice

ProjectsAsk a questionTrain on a GPUExplorationsMaths StoriesUnsolved problemsPlaygroundScience labsMock testsOlympiad

Reference

GlossaryBlogDiscoveries
Competitions › IOQM › unit 4 of 14

Combinatorics

IOQM · All sections · about 7 minutes

Combinatorics is counting cleverly: arrangements, selections, paths, handshakes and the pigeonhole principle.

Before counting, decide whether order matters. Then count the easy way: by complement, by symmetry, or by turning the objects into something easier to count (like rights and ups on a grid).

In this lesson

  1. Order or no order
  2. Stars and bars
  3. Complement, bijection and pigeonholes
  4. Worked examples
  5. Where marks are lost
  6. Check yourself

1Order or no order

If order matters, count arrangements (permutations); if not, count selections (combinations). The multiplication principle: independent choices multiply.

With identical items, divide by the factorials of the repeats: arrangements of MISSISSIPPI = 11!/(4! 4! 2!).

2Stars and bars

The number of ways to share n identical sweets among k children is C(n + k − 1, k − 1), or C(n − 1, k − 1) if every child must get at least one.

Equations like x + y + z = 10 with whole numbers are the same problem: C(12, 2) = 66 solutions.

3Complement, bijection and pigeonholes

Count the opposite and subtract: ‘at least one’ = total − ‘none’. Inclusion–exclusion handles overlapping conditions.

Turn a hard count into an easy one (a bijection): grid paths ↔ words in R and U. The pigeonhole principle: n + 1 objects in n boxes force a box with two.

Worked examples

  1. Example 1How many whole-number solutions does x + y + z = 10 have?

    1. Stars and bars with n = 10, k = 3.
    2. C(12, 2) = 66.

    Answer: 66

  2. Example 2How many 4-digit numbers have at least one digit 7?

    1. All 4-digit numbers: 9000.
    2. With no 7: 8 × 9 × 9 × 9 = 5832.
    3. 9000 − 5832.

    Answer: 3168

  3. Example 3How many diagonals does a 12-sided polygon have?

    1. Pairs of vertices: C(12, 2) = 66.
    2. Subtract the 12 sides.

    Answer: 54

See it move

Where marks are lost

  • Counting arrangements when the question wants selections.
  • Allowing a leading zero in digit questions.
  • Forgetting to subtract overlaps in inclusion–exclusion.

Exam tips

  • Arrangements of n things with repeats: n! ÷ (p! q! …).
  • Grid paths with a rights and b ups: C(a + b, a).
  • Handshakes among n people: n(n − 1)/2.

Practice questions

  1. In how many ways can the letters of LEVEL be arranged?

  2. How many handshakes happen if 10 people each shake hands once with everyone else?

  3. How many shortest grid paths go 4 steps right and 3 steps up?

More worked examples

Try each one first, then open the working.

  1. Moving only right or up, how many shortest routes from A to B pass through P?

    ABP
    Show the working

    Start: Routes to P times routes from P.

    A→P: C(2, 1) = 2; P→B: C(5, 3) = 10. Multiply: 20.

    Answer: 20

  2. How many triangles of all sizes are in the figure?

    Show the working

    Start: A triangle is fixed by choosing two lines from the top corner and one base line.

    Each strip between parallel lines gives C(6, 2) = 15 triangles (choose 2 of the 6 lines from the top corner), and there are 1 such levels: 15.

    Answer: 15

  3. What number is hidden at “?” in Pascal’s triangle?

    1111211331146411510105116?201561
    Show the working

    Start: Add the two numbers just above.

    Each number is the sum of the two above it. It is C(6, 2) = 15.

    Answer: 15

  4. How many different arrangements can be made of all the letters of the word APPLE?

    Show the working

    Start: n! ÷ (p! q! …) for repeated letters.

    5! divided by the factorials of the repeated letters = 60.

    Answer: 60

Practise more

New questions every time, at exam level

Moving only right or up, how many shortest routes from A to B avoid the point P?

ABP

Learn it properly

Full chapters with animations, each with an “Explained simply” version.

  • Permutations and combinationsClass 11
  • Binomial theoremClass 11

Sit a timed IOQM mock test

GeometryNext: Inequalities