IGCSE Math Revision Start revising
Extension & competition maths

Senior combinatorics problems (ages 16 to 18)

22 original competition-style problems: counting arrangements, paths, subsets and tilings. Try each one before opening the hints; the second hint gives more away, and the full solution explains why the method works and where the idea leads.

15 free with full solutions. Problems marked ‘With a plan’ show the question to everyone; their hints, answer checking and full solutions are included with every A Level, IB, IGCSE and CBSE plan. See plans.

Filter by strategy

Answer a problem to track what you have solved.

For teachers: project, add to a worksheet or set as homework

Press Project on any problem to show it full screen with a timer, the hints, the answer and the worked solution one step at a time (arrow keys move between problems; Space reveals the next step; F full screen; Esc closes). Switch on the ‘Add to worksheet’ buttons, pick problems, then print them from the worksheet builder or set them as homework for a class, with the full solutions as the mark scheme. Free problems are free for every class; problems marked ‘With a plan’ can be set by teachers with a plan or school licence. Ready-made sessions: maths club packs.

Your worksheet basket is empty.Open worksheet builderSet as homework

Problem S08

CombinatoricsShort answer

A 2 by 8 board is tiled with 1 by 2 dominoes (either way round) and 2 by 2 squares. How many tilings are there?

Hint

Let t(n) be the number of tilings of a 2 by n board. How can the left edge be covered?

Second hint

The left edge is covered by an upright domino (leaving 2 by (n − 1)), two flat dominoes, or a 2 by 2 square (both leaving 2 by (n − 2)).

Full worked solution

Answer: 171

  1. Let t(n) be the number of tilings of a 2 by n board.
  2. Look at the left-hand column. Either a vertical domino covers it (leaving 2 by (n − 1)), or two horizontal dominoes cover the first two columns, or a 2 by 2 square does (each leaving 2 by (n − 2)).
  3. So t(n) = t(n − 1) + 2 t(n − 2).
  4. Start: t(0) = 1 (the empty board) and t(1) = 1 (one vertical domino).
  5. Then t(2) = 3, t(3) = 5, t(4) = 11, t(5) = 21, t(6) = 43, t(7) = 85.
  6. t(8) = 85 + 2 × 43 = 171.

Why this works: Tilings of strips satisfy linear recurrences found by asking how the first column is covered. Here t(n) = (2n+1 + (−1)n)/3, the Jacobsthal numbers.

Where it leads: t(n) = t(n − 1) + 2t(n − 2) gives the Jacobsthal numbers, (2n+1 + (−1)n)/3.

Strategy: Working backwards

Problem S09

CombinatoricsShort answer

How many strings of 8 letters, each A or B, never contain three identical letters in a row?

Hint

Such a string is made of runs of length 1 or 2 that alternate between A and B.

Second hint

Count compositions of 8 into parts 1 and 2 (the run lengths), then double for starting with A or B.

Full worked solution

Answer: 68

  1. A good string splits into runs of equal letters, each of length 1 or 2, alternating A and B.
  2. Once the first letter is chosen (2 ways), the letters are forced by the run lengths, so count sequences of 1s and 2s adding to 8.
  3. Let c(n) be the number of sequences of 1s and 2s adding to n: the last part is 1 or 2, so c(n) = c(n − 1) + c(n − 2), with c(1) = 1, c(2) = 2.
  4. c(3) = 3, c(4) = 5, c(5) = 8, c(6) = 13, c(7) = 21, c(8) = 34.
  5. Total: 2 × 34 = 68.

Why this works: Describing strings by run lengths separates ‘which letter’ (fixed once the first is chosen) from ‘how long each run is’, a composition count.

Where it leads: The compositions of n into 1s and 2s are counted by Fibonacci numbers, so the answer is 2F9 = 68.

Strategy: Spot the pattern and generalise

Problem S10

CombinatoricsShort answer

Three vertices of a regular 12-sided polygon are chosen to form a triangle. How many of the possible triangles are obtuse?

Hint

An inscribed triangle is obtuse exactly when all three vertices lie strictly within a half of the circle.

Second hint

For each vertex A, count triangles whose other two vertices are among the next 5 vertices clockwise: C(5, 2).

Full worked solution

Answer: 120

  1. An angle inscribed in a circle is obtuse exactly when it stands on an arc greater than a semicircle; so a triangle is obtuse when its three vertices lie inside an arc smaller than a semicircle.
  2. On a regular 12-gon, neighbouring vertices are 30° apart, so ‘less than a semicircle’ means the three vertices lie among 6 consecutive vertices (spanning at most 150°).
  3. Count each obtuse triangle from its first vertex going clockwise: choose that vertex (12 ways), then the other two from the next 5 vertices: C(5, 2) = 10.
  4. Each obtuse triangle has exactly one such first vertex, so there are 12 × 10 = 120.
  5. Check: of C(12, 3) = 220 triangles, 60 are right-angled (a diameter, 6 ways, and a third vertex, 10 ways), and 220 − 120 − 60 = 40 acute.
  6. Answer: 120.

Why this works: An inscribed angle is obtuse when it stands on an arc greater than a semicircle. Counting from a canonical starting vertex avoids counting the same triangle several times.

Where it leads: As the number of sides grows, three random vertices form an obtuse triangle with probability approaching 3/4.

Strategy: Organised cases, Symmetry

Problem S11

CombinatoricsShort answer

How many paths from (0, 0) to (6, 6), using unit steps right or up, avoid every point whose coordinates are both odd?

Hint

From a point with both coordinates even, where can the path go next, and what must the step after that be?

Second hint

From an even-even point the path must take two steps in the same direction to reach the next allowed point.

Full worked solution

Answer: 20

  1. The path starts at (0, 0), where both coordinates are even.
  2. From an even–even point, one step makes exactly one coordinate odd.
  3. The next step must not make both odd, so it must change the same coordinate again, back to even: the path moves in double steps RR or UU between even–even points.
  4. So the path is a route on the grid of even points, from (0, 0) to (6, 6) in steps of 2: 3 double steps right and 3 double steps up.
  5. Number of routes: C(6, 3) = 20.

Why this works: Spotting an invariant (you can only be at an odd coordinate for one step at a time) turns the problem into a smaller, familiar one.

Where it leads: Shrinking the grid by a factor of 2 turns the problem into ordinary paths from (0, 0) to (3, 3): C(6, 3).

Strategy: Spot the pattern and generalise

Problem S12

CombinatoricsMultiple choice

Six different books are given to three students so that each student gets at least one book. In how many ways can this be done?

Hint

Count all 36 ways, then remove those where somebody gets nothing (inclusion–exclusion).

Second hint

36 − 3 × 26 + 3 × 16.

Full worked solution

Answer: C, 540

  1. Each book goes to one of 3 students: 36 = 729 ways, but some leave a student with nothing.
  2. Ways where a particular student gets nothing: 26 = 64. Three students: 3 × 64 = 192.
  3. Ways where two particular students get nothing (all books to the third) were subtracted twice: there are 3 of them, so add 3 back.
  4. No way leaves all three with nothing.
  5. Inclusion–exclusion: 729 − 192 + 3 = 540 (C).

Why this works: ‘Every box non-empty’ is the classic inclusion–exclusion count of onto functions: kn − C(k,1)(k − 1)n + C(k,2)(k − 2)n − ….

Where it leads: This is 3! × S(6, 3), where S is a Stirling number of the second kind: surjections onto k students.

Strategy: Count the opposite

Problem S13

CombinatoricsShort answer

How many whole numbers from 1 to 10 000 have digits that add up to 10?

Hint

Treat numbers below 10 000 as four-digit strings with leading zeros. Stars and bars, then remove strings with a ‘digit’ of 10.

Second hint

Four-digit strings with digit sum 10: C(13, 3) = 286. Remove those with a ‘digit’ 10 (one digit 10, rest 0): 4.

Full worked solution

Answer: 282

  1. Write every number from 0 to 9999 as four digits d1d2d3d4 (with leading zeros). 0 has digit sum 0, so it never counts.
  2. Count solutions of d1 + d2 + d3 + d4 = 10 with di ≥ 0: stars and bars, C(13, 3) = 286.
  3. Remove the ones where some ‘digit’ is 10 or more: that digit is 10 and the others 0: 4 cases. (Two digits ≥ 10 is impossible.)
  4. So 286 − 4 = 282 numbers below 10 000.
  5. 10 000 has digit sum 1, so the answer is 282.

Why this works: Leading zeros make every number the same length so stars and bars applies; the digit cap of 9 is handled by subtracting the few overflows.

Where it leads: Stars and bars with an upper limit needs one round of inclusion–exclusion; larger sums need more rounds.

Strategy: Count the opposite

Problem S14

CombinatoricsMultiple choice

How many ways can the numbers 1, 2, 3, 4, 5, 6 be arranged in a row so that every number is at most one place away from its own position (number k in position k−1, k or k+1)?

Hint

Look at number 1: it stays in place, or it swaps with 2.

Second hint

If 1 stays, arrange 2 to 6 in the same way; if 1 and 2 swap, arrange 3 to 6.

Full worked solution

Answer: C, 13

  1. Let a(n) be the number of arrangements of 1 to n with every number at most one place from home.
  2. Look at number 1. If it stays in position 1, the other n − 1 numbers form the same problem: a(n − 1) ways.
  3. If 1 moves to position 2, position 1 must be filled by 2 (no other number may move that far). So 1 and 2 swap, and the rest is the problem for n − 2: a(n − 2) ways.
  4. So a(n) = a(n − 1) + a(n − 2), with a(1) = 1 and a(2) = 2.
  5. a(3) = 3, a(4) = 5, a(5) = 8, a(6) = 13 (C).

Why this works: Local rules (each item moves at most one place) force the arrangement into fixed points and adjacent swaps, which gives a Fibonacci recurrence.

Where it leads: an = an−1 + an−2: Fibonacci again, since the arrangements are tilings by ‘stay’ and ‘swap’ pieces.

Strategy: Working backwards, Spot the pattern and generalise

Problem S56

CombinatoricsShort answer

In how many ways can the numbers 1 to 6 be arranged in a row so that no number is in its own position (1 is not first, 2 is not second, and so on)?

Hint

Use inclusion–exclusion on the arrangements that fix at least one number.

Second hint

Dn = n!(1 − 1/1! + 1/2! − … ± 1/n!), or the recurrence Dn = (n − 1)(Dn−1 + Dn−2).

Full worked solution

Answer: 265

  1. Let Dn count such arrangements (derangements). D1 = 0, D2 = 1.
  2. Recurrence: number 1 goes to position k (n − 1 choices). Either k goes to position 1 (leaving Dn−2) or not (behaving like Dn−1). So Dn = (n − 1)(Dn−1 + Dn−2).
  3. D3 = 2(1 + 0) = 2, D4 = 3(2 + 1) = 9, D5 = 4(9 + 2) = 44, D6 = 5(44 + 9) = 265.

Why this works: Splitting on where 1 goes, and whether the number it displaces swaps back, gives a recurrence that avoids listing 720 orders.

Where it leads: Dn/n! tends to 1/e, and Dn is the nearest whole number to n!/e: 720/e ≈ 264.9.

Strategy: Organised cases, Count the opposite

Problem S57

CombinatoricsShort answer

How many subsets of {1, 2, 3, …, 12} (including the empty set) contain no two consecutive numbers?

Hint

Let an count such subsets of {1, …, n}. Does the subset contain n?

Second hint

If it contains n it cannot contain n − 1: an = an−1 + an−2.

Full worked solution

Answer: 377

  1. Let an be the count for {1, …, n}. Subsets without n: an−1. Subsets with n: n − 1 is excluded, leaving an−2.
  2. So an = an−1 + an−2 with a1 = 2 ({}, {1}) and a2 = 3.
  3. a3 = 5, 8, 13, 21, 34, 55, 89, 144, 233, a12 = 377.

Why this works: Conditioning on the largest element gives a Fibonacci recurrence.

Where it leads: an = Fn+2. Counting by size instead gives Fn+2 = Σ C(n − k + 1, k): Fibonacci numbers are diagonal sums of Pascal’s triangle.

Strategy: Working backwards, Spot the pattern and generalise

Problem S58

CombinatoricsShort answer

How many 4-element subsets of {1, 2, …, 20} can be arranged to form an arithmetic sequence?

Hint

A 4-term arithmetic sequence a, a + d, a + 2d, a + 3d with d ≥ 1 is fixed by a and d.

Second hint

For each d, a can run from 1 to 20 − 3d.

Full worked solution

Answer: 57

  1. Arrange the set in increasing order: a, a + d, a + 2d, a + 3d with d ≥ 1. Each set gives exactly one (a, d).
  2. Need a + 3d ≤ 20, so a has 20 − 3d choices, and d ≤ 6.
  3. Sum: 17 + 14 + 11 + 8 + 5 + 2 = 57.

Why this works: Matching each set to its first term and common difference makes the count a simple sum over d.

Where it leads: Van der Waerden’s theorem: colour 1 to N in two colours; for N large enough there is always a one-coloured arithmetic sequence of length 4 (N = 35 suffices, and is the smallest).

Strategy: Organised cases

Problem S59

CombinatoricsMultiple choice

10 identical balls are placed in 4 different boxes so that no box has more than 4 balls. In how many ways can this be done?

Hint

Count without the limit, then subtract the arrangements where some box has 5 or more.

Second hint

Without limit: C(13, 3) = 286. A given box with ≥ 5: put 5 in first, C(8, 3) = 56 ways.

Full worked solution

Answer: C, 68

  1. Without the limit: stars and bars, C(10 + 3, 3) = 286.
  2. A particular box has at least 5: pre-place 5, share the other 5 freely: C(8, 3) = 56. Four boxes: 224.
  3. Two particular boxes with at least 5 each: all 10 used, 1 way. C(4, 2) = 6 pairs: 6. Three boxes is impossible.
  4. Inclusion–exclusion: 286 − 224 + 6 = 68 (C).

Why this works: Upper limits are handled by counting the violations (pre-placing balls) and correcting overlaps with inclusion–exclusion.

Where it leads: This is the coefficient of x10 in (1 + x + x2 + x3 + x4)4: generating functions and inclusion–exclusion are two views of one calculation.

Strategy: Count the opposite

Problem S60

CombinatoricsShort answer

Four couples sit in a row of 8 chairs so that each couple sits together. In how many ways can they sit?

Hint

Treat each couple as a block.

Second hint

Arrange 4 blocks, then each couple can sit in 2 orders.

Full worked solution

Answer: 384

  1. Glue each couple into a block: 4 blocks in a row, 4! = 24 orders.
  2. Each couple can sit in 2 orders within its block: 24 = 16.
  3. Total: 24 × 16 = 384.

Why this works: Blocks handle ‘must sit together’; the internal orders multiply in independently.

Where it leads: The harder question, with no couple together, needs inclusion–exclusion over the couples. Around a circular table with men and women alternating it becomes the ménage problem.

Strategy: Organised cases

Problem S61

CombinatoricsShort answer

How many strings of ten 0s and 1s contain exactly four 1s, with no two 1s next to each other?

Hint

Place the six 0s first. Where can the 1s go?

Second hint

Six 0s create 7 gaps (including the ends); put at most one 1 in each.

Full worked solution

Answer: 35

  1. Write the six 0s in a row. They create 7 gaps: before, between and after them.
  2. No two 1s adjacent means each gap gets at most one 1. Choose 4 of the 7 gaps.
  3. C(7, 4) = 35.

Why this works: Placing the unrestricted symbols first creates slots in which the restricted ones automatically stay apart.

Where it leads: This ‘gaps’ method gives C(n − k + 1, k) for k non-adjacent items among n. Summing over k gives Fibonacci numbers again.

Strategy: Organised cases

Problem S62

CombinatoricsMultiple choice

How many paths from (0, 0) to (5, 5), using unit steps right or up, touch the line y = x only at their two ends?

Hint

Such a path starts either right or up and then stays strictly on one side of the line.

Second hint

By symmetry, count paths staying strictly below and double. A path strictly below goes (0,0) → (1,0), ends (5,4) → (5,5), and in between never goes above y = x − 1.

Full worked solution

Answer: B, 28

  1. A path that avoids the diagonal except at its ends stays strictly below it or strictly above it; by reflection these are equally many.
  2. Strictly below: the first step is right to (1, 0) and the last step is up from (5, 4). In between it goes from (1, 0) to (5, 4) without crossing y = x − 1: shifting left by 1, that is a path from (0, 0) to (4, 4) never above y = x, counted by the Catalan number C4 = 14.
  3. Total: 2 × 14 = 28 (B).

Why this works: Symmetry halves the work, and stripping off the forced first and last steps reveals a Catalan count.

Where it leads: By the same argument the probability that a random 2n-step path to (n, n) avoids the diagonal is 2Cn−1/C(2n, n) = 1/(2n − 1).

Strategy: Symmetry, Spot the pattern and generalise

Problem S63

CombinatoricsShort answer

How many 3-element subsets of {1, 2, 3, …, 15} have a sum divisible by 3?

Hint

Sort the numbers by remainder on division by 3: five of each.

Second hint

The sum is divisible by 3 when all three remainders are equal, or all three are different.

Full worked solution

Answer: 155

  1. Remainders 0, 1, 2 each occur 5 times in 1 to 15.
  2. Sum ≡ 0 (mod 3) when the remainders are all equal (0 + 0 + 0, 1 + 1 + 1, 2 + 2 + 2) or all different (0 + 1 + 2).
  3. All equal: 3 × C(5, 3) = 30. All different: 5 × 5 × 5 = 125.
  4. Total: 155.

Why this works: Only remainders matter for divisibility, so classify the numbers into three equal classes and count combinations of classes.

Where it leads: 155 is very close to C(15, 3)/3 = 151.67: sums are spread almost evenly among the remainders. Roots of unity make this exact in generating-function proofs.

Strategy: Organised cases, Parity and remainders

Problem S64

CombinatoricsShort answerWith a plan

In how many ways can the six people {A, B, C, D, E, F} be split into three non-empty groups (the groups are unlabelled and the order within a group does not matter)?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Organised cases, Symmetry

Problem S65

CombinatoricsShort answerWith a plan

How many arrangements of 1, 2, 3, …, 7 in a row have exactly one number in its own position?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Organised cases

Problem S66

CombinatoricsShort answerWith a plan

The six corners of a hexagon (fixed in place) are each coloured with one of 3 colours so that neighbouring corners have different colours. How many colourings are there?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Count the opposite, Spot the pattern and generalise

Problem S67

CombinatoricsShort answerWith a plan

In an election, Amina gets 6 votes and Ben gets 4. The 10 votes are counted one at a time in some order. In how many of the C(10, 4) = 210 possible orders is Amina strictly ahead throughout the count (after every vote)?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Symmetry, Count the opposite

Problem S68

CombinatoricsMultiple choiceWith a plan

How many ordered triples (x, y, z) of whole numbers with 0 ≤ x, y, z ≤ 6 satisfy x + y + z = 15?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Symmetry, Count the opposite

Problem S69

CombinatoricsShort answerWith a plan

Eight rooks are placed on a chessboard so that no two attack each other (one in each row and each column), and none is on the main diagonal from the bottom-left corner to the top-right corner. In how many ways can this be done?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Spot the pattern and generalise, Count the opposite

Problem S70

CombinatoricsShort answerWith a plan

Six points are placed on a circle and every pair is joined by a straight chord. No three chords meet at one point inside the circle. Into how many regions do the chords divide the inside of the circle?

Hints, answer check and full worked solution. Included with every A Level, IB, IGCSE and CBSE plan.

See plansSign in

Strategy: Spot the pattern and generalise, Proof techniques

Keep going

More Senior problems: Number theory · Geometry · Algebra · Probability · Logic · Calculus and functions

Combinatorics at other levels: Junior (ages 11 to 13) · Intermediate (ages 13 to 16) · Olympiad-style (ages 15 to 18)

Problem-solving strategies · Where next · Extension & competition maths