CBSE Math Revision Start revising
Extension & competition maths

Intermediate logic problems (ages 13 to 16)

27 original competition-style problems: truth-tellers, calendars, games and reasoning puzzles. 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.

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 I35

LogicMultiple choice

Five people A, B, C, D, E are each either a truth-teller or a liar. A says: “Exactly four of us are liars.” B says: “A is a truth-teller.” C says: “E is a liar.” D says: “B is a liar.” E says: “D is a liar.” Who are the truth-tellers?

Hint

“X is a truth-teller” means speaker and X are the same type; “X is a liar” means they are opposite types.

Second hint

B says A is truthful, so A and B are the same type; D says B is a liar, so B and D are opposite types.

Full worked solution

Answer: B, C and D

  1. “X is a truth-teller” means the speaker and X are the same type; “X is a liar” means they are opposite types.
  2. B says A is truthful, so A and B are the same type.
  3. D says B lies: D is the opposite of B. E says D lies: E is the opposite of D, so the same as B. C says E lies: C is the opposite of E, so the same as D.
  4. So A, B, E are one type and C, D the other.
  5. If A, B, E were truthful, only C and D would lie — 2 liars, but A says 4. Contradiction.
  6. So A, B, E lie (3 liars, and A’s ‘four’ is false, as it must be), and the truth-tellers are C and D (B).

Why this works: Statements about other people’s types give ‘same’ or ‘opposite’ links. Following the chain splits everyone into two camps, and one counting statement decides which camp tells the truth.

Where it leads: Encoding ‘same type / opposite type’ links turns knight–knave puzzles into colouring a graph with two colours.

Strategy: Organised cases, Proof techniques

Problem I36

LogicShort answer

Five teams play each other once. A win gives 2 points, a draw 1 point each, a loss 0. At the end, all five teams have different point totals. What is the largest number of points the bottom team can have?

Hint

How many points are handed out in total? Five different totals must add up to that.

Second hint

20 points in total over 10 games. Five different totals adding to 20 with the smallest as large as possible.

Full worked solution

Answer: 2

  1. 10 games, each giving out 2 points (2 for a win, or 1 + 1 for a draw): 20 points in total.
  2. Let the bottom team have p points. The others have different, larger totals, so at least p + 1, p + 2, p + 3, p + 4.
  3. Then 5p + 10 ≤ 20, so p ≤ 2.
  4. p = 2 is possible with totals 2, 3, 4, 5, 6. Example with teams T1–T5: T1 beats T2; T2 beats T3; T3 beats T1 and T4; T4 beats T1 and T5; T5 beats T1, T2 and T3; T2 and T4 draw.
  5. Totals: T1 2, T2 2 + 1 = 3, T3 4, T4 4 + 1 = 5, T5 6 — all different.
  6. The bottom team can have at most 2 points.

Why this works: A bound from totals (the points in the system are fixed) plus one example that meets the bound is a complete answer: that is how most ‘largest possible’ problems are closed.

Where it leads: Making the smallest value large means bunching the totals together: 2, 3, 4, 5, 6 is as tight as distinct totals can be.

Strategy: Extremal principle

Problem I37

LogicMultiple choice

In a year that is not a leap year, what is the largest number of months that can begin on the same day of the week?

Hint

Find how many days of the week each month’s start is shifted from 1 January (month lengths mod 7).

Second hint

The month starts are shifted by 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 days from January (mod 7). Which value is most common?

Full worked solution

Answer: B, 3

  1. In a non-leap year, month lengths modulo 7 are: Jan 3, Feb 0, Mar 3, Apr 2, May 3, Jun 2, Jul 3, Aug 3, Sep 2, Oct 3, Nov 2.
  2. Add them up to get how many weekdays after 1 January each month starts: Jan 0, Feb 3, Mar 3, Apr 6, May 1, Jun 4, Jul 6, Aug 2, Sep 5, Oct 0, Nov 3, Dec 5.
  3. Count repeats: 3 occurs three times (Feb, Mar, Nov); 0, 5 and 6 occur twice; the others once.
  4. The weekday of 1 January only relabels the days, so every non-leap year has the same pattern.
  5. The largest number is 3 (B).

Why this works: Only month lengths modulo 7 matter. Once the pattern of shifts is written down, the day of 1 January just relabels the days, so every non-leap year behaves the same.

Where it leads: In a leap year the shifts change from March onwards; the most common value then appears only twice, and in different months.

Strategy: Spot the pattern and generalise

Problem I38

LogicShort answer

A sequence starts with 2027. Each later term is the sum of the squares of the digits of the term before (so the second term is 22 + 02 + 22 + 72 = 57). What is the 100th term?

Hint

Work out the first dozen terms. Something repeats.

Second hint

2027 → 57 → 74 → 65 → 61 → 37 → 58 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → …

Full worked solution

Answer: 4

  1. Compute terms: 2027 → 4 + 0 + 4 + 49 = 57 → 25 + 49 = 74 → 49 + 16 = 65 → 36 + 25 = 61 → 36 + 1 = 37.
  2. Continue: 37 → 58 → 89 → 145 → 42 → 20 → 4 → 16 → 37, so the terms cycle with length 8 from the 6th term (37).
  3. The cycle is 37, 58, 89, 145, 42, 20, 4, 16 (positions 1 to 8 of the cycle), starting at term 6.
  4. Term 100 is 100 − 6 = 94 places after term 6. 94 = 8 × 11 + 6, so it is 6 places along the cycle from 37: the 7th entry.
  5. The 7th entry is 4, so the 100th term is 4.

Why this works: Digit-square sums quickly drop below 1000 and then must eventually repeat. Once a cycle appears, a far-off term only needs its position modulo the cycle length.

Where it leads: Every starting number ends either at 1 (a ‘happy number’) or in the cycle 4, 16, 37, 58, 89, 145, 42, 20.

Strategy: Spot the pattern and generalise

Problem I39

LogicShort answer

You have one each of the weights 1 g, 2 g, 5 g and 10 g, and a balance where weights may only go in one pan. How many different whole-number masses can you weigh exactly?

Hint

Each weight is either used or not. Could two different selections give the same total?

Second hint

Could two different selections of 1, 2, 5, 10 give the same total? Check the sums carefully.

Full worked solution

Answer: 15

  1. Each weight is either in the pan or not: 24 = 16 selections, 15 of them non-empty.
  2. Could two selections give the same mass? Each weight is heavier than all the smaller ones together: 2 > 1, 5 > 1 + 2, 10 > 1 + 2 + 5.
  3. So the heaviest weight used decides which ‘range’ the total is in, and no two selections collide.
  4. The masses are 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 15, 16, 17, 18 g.
  5. That is 15 different masses.

Why this works: If each weight is bigger than the sum of all smaller ones, every selection gives a different total. Here 5 > 3 and 10 > 8, so there are no collisions.

Where it leads: With weights 1, 2, 4, 8 (powers of 2) every total from 1 to 15 is possible exactly once: binary notation.

Strategy: Organised cases

Problem I40

LogicShort answer

A three-digit code has three different digits. The digits add up to 14. The code is a multiple of 11. Its first digit is larger than its last digit. The code is less than 500. What is the code?

Hint

A three-digit number abc is a multiple of 11 when a − b + c is 0 or a multiple of 11.

Second hint

a − b + c is 0 or 11 and a + b + c = 14. Subtracting: 2b = 14 or 3, so b = 7.

Full worked solution

Answer: 473

  1. Write the code as abc. A three-digit number is a multiple of 11 when a − b + c is a multiple of 11 (0, 11, …).
  2. a + b + c = 14 and a − b + c differ by 2b, so they have the same parity: a − b + c is even, and between −9 and 18, so it is 0.
  3. a − b + c = 0 and a + b + c = 14 give 2b = 14: b = 7 and a + c = 7.
  4. With a > c and all digits different: 7 0 (770 repeats 7), 6 1, 5 2, 4 3, giving 671, 572, 473.
  5. Below 500: only 473. Check: 473 = 11 × 43 and 4 + 7 + 3 = 14. ✓ The code is 473.

Why this works: The alternating-sum test for 11 plus the digit sum gives two equations; noticing that they must have the same parity pins down the middle digit.

Where it leads: Divisibility by 11 uses the alternating digit sum because 10 ≡ −1 (mod 11).

Strategy: Organised cases

Problem I145

LogicShort answer

Each of A, B, C and D is either a knight (always tells the truth) or a knave (always lies). A says: ‘B and C are different types.’ B says: ‘D is a knave.’ C says: ‘A is a knight.’ D says: ‘At least three of us four are knights.’ How many of them are knights?

Hint

Split on whether D is a knight or a knave.

Second hint

C’s statement means A and C are the same type. If D is a knave, B is a knight: follow that through.

Full worked solution

Answer: 3

  1. C says A is a knight, so C and A are the same type (a knight says it truly; a knave says it falsely about a knave).
  2. Suppose D is a knave. Then B’s statement is true, so B is a knight. If A is a knight, B and C differ, so C is a knave, but C matches A: contradiction. If A is a knave, B and C are the same, so C is a knight, but C matches A: contradiction. So D is a knight.
  3. D is a knight, so at least three are knights, and B (who says D is a knave) is a knave. So A, C and D are all knights.
  4. Check: A says B and C differ (knave, knight) ✓; C says A is a knight ✓. There are 3 knights.

Why this works: Pairing up people whose types must match or differ cuts the 16 possibilities down quickly; the remaining case split on D finishes it.

Where it leads: Each statement is a logical equation in true/false variables. With n people there are 2n cases, so organised deduction beats checking them all.

Strategy: Organised cases, Proof techniques

Problem I146

LogicShort answer

In how many ways can the numbers 1, 2 and 3 be written in a 3 by 3 grid so that each row and each column contains each number exactly once?

Hint

How many ways can the first row be filled? Then the second?

Second hint

Once the first row is chosen, the second row must be one of two ‘shifts’ of it, and then the third row is forced.

Full worked solution

Answer: 12

  1. The first row is any order of 1, 2, 3: 6 ways.
  2. The second row must differ from the first in every column. Of the 6 orders, only the two cyclic shifts of the first row do this: 2 ways.
  3. The third row is then forced (each column needs its missing number), and it is always a valid order.
  4. Total: 6 × 2 = 12.

Why this works: Filling row by row and noticing that later rows are tightly constrained gives a short product.

Where it leads: These are Latin squares. There are 576 of size 4 and 161,280 of size 5; sudoku grids are special 9 × 9 Latin squares (about 6.67 × 1021 of them).

Strategy: Organised cases

Problem I147

LogicMultiple choice

There are 21 counters in a pile. Two players take turns to remove 1, 2 or 3 counters. The player who takes the last counter loses. With perfect play, who wins?

Hint

Which pile sizes are losing for the player about to move? Start with a pile of 1.

Second hint

With 1 counter you must take it and lose. From 2, 3 or 4 you can leave 1. So 5 is losing again…

Full worked solution

Answer: D, The second player

  1. With 1 counter left, the player to move must take it and loses.
  2. From 2, 3 or 4 counters you can leave exactly 1, so those are wins for the mover. From 5, every move leaves 2, 3 or 4: 5 is losing.
  3. In the same way the losing positions are 1, 5, 9, 13, 17, 21: one more than a multiple of 4.
  4. 21 is a losing position for the first player: whatever she takes, the second player takes enough to make 4 in that round. The second player wins (D).

Why this works: Working backwards from the end labels every pile size as winning or losing; the pattern repeats every 4 because each round can be forced to total 4.

Where it leads: ‘Last counter loses’ is called misère play. For single-pile games it just shifts the pattern by one; for Nim with several piles it changes the strategy only at the very end.

Strategy: Working backwards, Invariants

Problem I148

LogicShort answer

How many times in 12 hours (from noon until just before midnight) do the hour hand and minute hand of a clock make a right angle?

Hint

How fast does the minute hand gain on the hour hand, in degrees per minute?

Second hint

It gains 6 − 0.5 = 5.5° per minute, so 360° every 720/11 minutes. In each such lap it passes 90° and 270° once.

Full worked solution

Answer: 22

  1. The minute hand turns 6° per minute and the hour hand 0.5° per minute, so the gap grows by 5.5° per minute.
  2. In 12 hours (720 minutes) the gap grows by 5.5 × 720 = 3960° = 11 full turns.
  3. In each full turn of the gap it passes 90° once and 270° once: 2 right angles per turn.
  4. Total: 11 × 2 = 22 (not 24, because the hands overlap only 11 times in 12 hours).

Why this works: Thinking about the gap between the hands (relative motion) instead of each hand separately turns the clock into one steadily turning angle.

Where it leads: The hands point in exactly opposite directions 11 times in 12 hours too. Do the hour, minute and second hands ever all coincide except at 12 o’clock? (No.)

Strategy: Invariants, Spot the pattern and generalise

Problem I149

LogicShort answer

ABC is a three-digit number with three different digits, and A and C are not zero. Reversing it gives CBA, and ABC − CBA = 297. How many such numbers ABC are there?

Hint

Write ABC − CBA in terms of A, B and C.

Second hint

(100A + 10B + C) − (100C + 10B + A) = 99(A − C).

Full worked solution

Answer: 48

  1. ABC − CBA = 99(A − C) = 297, so A − C = 3. The middle digit B cancels.
  2. C ≥ 1 and A ≤ 9, so (A, C) = (4, 1), (5, 2), …, (9, 6): 6 pairs.
  3. B can be any digit except A and C: 8 choices.
  4. Total: 6 × 8 = 48.

Why this works: Algebra on the digits shows the difference depends only on A − C, so the condition splits into two independent choices.

Where it leads: Reverse-and-subtract with three digits always gives a multiple of 99. Continue by reversing and adding the result and you often reach 1089: try to prove when.

Strategy: Spot the pattern and generalise, Organised cases

Problem I150

LogicMultiple choice

The numbers 1, 2, 3, …, 10 are written on a board. A move is to rub out any two numbers a and b and write |a − b| instead. After nine moves one number is left. Which statement is true?

Hint

Look at the sum of all the numbers on the board. How does a move change it?

Second hint

a + b and |a − b| have the same parity (they differ by 2 × min(a, b)).

Full worked solution

Answer: C, It is always odd

  1. Replacing a and b by |a − b| changes the total by (a + b) − |a − b| = 2 × min(a, b), an even number.
  2. So the parity of the total never changes. At the start the total is 55, which is odd.
  3. So the last number is always odd: (C). It is not always 1: for example you can end with 3 or 5.
  4. So the true statement is it is always odd.

Why this works: An invariant (the parity of the sum) survives every move, whatever choices are made, so it pins down a property of the final number.

Where it leads: Finding invariants (or monovariants, which only change one way) is the standard way to answer ‘can this process ever reach …?’ questions.

Strategy: Invariants, Parity and remainders

Problem I151

LogicMultiple choice

The numbers 1, 2, 3, …, 20 are written on a board. A move is to rub out two numbers a and b and write a + b + ab instead. After 19 moves one number is left. What is it?

Hint

a + b + ab = (a + 1)(b + 1) − 1.

Second hint

Look at the product of (x + 1) over all numbers x on the board.

Full worked solution

Answer: D, 21! − 1

  1. a + b + ab + 1 = (a + 1)(b + 1). So if you add 1 to every number on the board, a move multiplies two of these ‘plus one’ values together.
  2. So the product of (x + 1) over the board never changes. At the start it is 2 × 3 × … × 21 = 21!.
  3. At the end there is one number N with N + 1 = 21!, so N = 21! − 1 (D), whatever the order.

Why this works: Spotting the factorisation reveals an invariant product, which fixes the final answer regardless of the choices made.

Where it leads: The operation a * b = a + b + ab is just multiplication in disguise (shift by 1). Recognising a known operation under a change of variable is a powerful trick.

Strategy: Invariants

Problem I152

LogicShort answer

What is the smallest number of different whole numbers you must choose from 1 to 30 to be certain that two of the chosen numbers have a sum divisible by 7?

Hint

Group the numbers by their remainder on division by 7. Which remainders add up to a multiple of 7?

Second hint

Remainders 1 and 6, 2 and 5, 3 and 4 pair up; two numbers with remainder 0 also work.

Full worked solution

Answer: 16

  1. Two numbers have a sum divisible by 7 when their remainders are (0, 0), (1, 6), (2, 5) or (3, 4).
  2. From 1 to 30: remainder 0: 4 numbers; 1: 5; 2: 5; 3: 4; 4: 4; 5: 4; 6: 4.
  3. Largest set with no such pair: all of remainder 1 (5), all of remainder 2 (5), all of remainder 3 or 4 (4), and at most one multiple of 7 (1): 15 numbers.
  4. So 15 is not enough, but any 16 numbers must contain a good pair: the answer is 16.

Why this works: The pigeonhole principle with carefully chosen ‘holes’ (pairs of remainders) gives the guarantee; an explicit 15-number set shows nothing smaller works.

Where it leads: Erdős–Ginzburg–Ziv: among any 2n − 1 whole numbers, some n of them have a sum divisible by n.

Strategy: Pigeonhole principle, Extremal principle

Problem I153

LogicShort answer

Four houses stand in a row, numbered 1 to 4 from the left, painted red, blue, green and yellow (one each). The red house is immediately to the left of the blue house. The green house is at one end of the row. The yellow house is not next to the green house. What is the number of the blue house?

Hint

Red and blue sit together as a block, red first. Where can that block go?

Second hint

Green takes an end. Try green in house 1, then green in house 4.

Full worked solution

Answer: 3

  1. Red and blue form a block ‘red, blue’ in houses (1, 2), (2, 3) or (3, 4). Green is in house 1 or 4.
  2. Green in house 1: the block is in (2, 3) or (3, 4). Block (3, 4) puts yellow in house 2, next to green: not allowed. Block (2, 3) leaves yellow in 4: G R B Y. ✓
  3. Green in house 4: the block is in (1, 2) or (2, 3). Block (1, 2) puts yellow in 3, next to green: not allowed. Block (2, 3) leaves yellow in 1: Y R B G. ✓
  4. Two arrangements fit, but in both the blue house is number 3.

Why this works: Even when a puzzle has more than one solution, the question may have a unique answer: check every arrangement that fits.

Where it leads: Deciding what is certain versus merely possible is the core of constraint reasoning, from timetables to diagnosing faults.

Strategy: Organised cases

Problem I154

LogicShort answer

A secret code uses three different digits from 1 to 6, in order. For each guess you are told how many digits are correct and in the right place, and how many are correct but in the wrong place. Guess 123: 0 right place, 2 wrong place. Guess 456: 0 right place, 1 wrong place. Guess 264: 1 right place, 0 wrong place. Guess 512: 0 right place, 1 wrong place. What is the code?

Hint

From the first two guesses, how many of the code’s digits come from {1, 2, 3} and how many from {4, 5, 6}?

Second hint

Two from {1, 2, 3} and one from {4, 5, 6}. Now ask whether 2 is in the code.

Full worked solution

Answer: 361

  1. Guesses 123 and 456 show the code has two digits from {1, 2, 3} and one from {4, 5, 6}.
  2. If 2 were in the code: guess 264 says it is the only one of 2, 6, 4 and sits first; guess 512 says 5 and 1 are out; so the code uses 2, 3 and one of 4, 5, 6, but 4, 5, 6 are all ruled out. Contradiction. So 2 is out, and the code contains 1 and 3.
  3. Guess 512: 1 is in the code, not in place 2; guess 123: 1 is not in place 1. So 1 is in place 3. Then 5 is out, so the third digit is 4 or 6.
  4. Guess 264: exactly one of 6 (in place 2) or 4 (in place 3) is right; place 3 is taken by 1, so 6 is in place 2. Then 3 is in place 1 (and indeed not in place 3).
  5. The code is 361.

Why this works: Each clue is a constraint; combining clues about which digits are present before worrying about positions keeps the reasoning manageable.

Where it leads: Knuth showed every code in the classic Mastermind game (4 positions, 6 colours, repeats allowed) can be found in at most 5 guesses.

Strategy: Organised cases, Proof techniques

Problem I155

LogicShort answer

A 12-hour digital clock shows times from 1:00 to 12:59 (for example 3:07 or 11:45). How many times between 1:00 and 12:59 does it show a palindrome, reading the same forwards and backwards when you ignore the colon (like 4:34 or 12:21)?

Hint

Split by whether the hour has one digit or two.

Second hint

h:mm with one-digit hour is a palindrome when the last minute digit equals h. The tens-of-minutes digit can be 0 to 5.

Full worked solution

Answer: 57

  1. One-digit hours h = 1 to 9: the time h:ab reads h a b, a palindrome when b = h, with a = 0 to 5: 6 times per hour, 54 in total.
  2. Two-digit hours 10, 11, 12: hh:ab is a palindrome when a = second hour digit and b = first: 10:01, 11:11, 12:21. 3 times.
  3. Total: 54 + 3 = 57.

Why this works: Splitting by the number of digits makes the palindrome condition a simple rule in each case.

Where it leads: On a 24-hour clock the count is different: hours 13 to 15 give 13:31, 14:41, 15:51, while 16:61 is not a time. Try counting it.

Strategy: Organised cases

Problem I156

LogicShort answer

In a game of Nim there are three heaps of 3, 4 and 5 counters. Players take turns; a move is to remove any positive number of counters from one heap. The player who takes the last counter wins. The first player can force a win. How many different first moves win (lead to a forced win)?

Hint

Write the heap sizes in binary and look at each column of digits.

Second hint

A position is losing for the player to move exactly when every binary column has an even number of 1s.

Full worked solution

Answer: 1

  1. Bouton’s rule: the player to move loses exactly when the ‘Nim-sum’ (binary addition without carrying) of the heaps is 0.
  2. 3 = 011, 4 = 100, 5 = 101. Nim-sum: 011 ⊕ 100 ⊕ 101 = 010 = 2, not 0, so the first player can win.
  3. A winning move makes the Nim-sum 0: change a heap h to h ⊕ 2 if that is smaller. 3 → 1 works (1 < 3); 4 → 6 and 5 → 7 are increases, not allowed.
  4. So the only winning move is to take 2 from the heap of 3: 1 move.

Why this works: The binary columns stay balanced after a move to Nim-sum 0, and any move from such a position unbalances them, so the winner can always restore the balance.

Where it leads: The Sprague–Grundy theorem says every impartial game is equivalent to a Nim heap, so this binary trick solves a huge family of games.

Strategy: Invariants, Working backwards

Problem I157

LogicShort answer

2026 is not a leap year and begins on a Thursday. What is the next year in which every date falls on the same day of the week as in 2026 (so a 2026 calendar could be reused)?

Hint

A normal year moves every date on by 1 weekday; a leap year by 2. You also need a year that is not a leap year.

Second hint

Add up the shifts year by year from 2026 and look for a total that is a multiple of 7.

Full worked solution

Answer: 2037

  1. Each normal year shifts the weekday of 1 January by 1, each leap year by 2. The target year must start on a Thursday and must not be a leap year.
  2. Shifts after 2026, 2027, 2028 (leap), …: running totals 1, 2, 4, 5, 6, 7 (reaching 2032), but 2032 is a leap year, so its calendar differs from February.
  3. Continuing: 2033: 9, 2034: 10, 2035: 11, 2036: 12, 2037: 14 ≡ 0 (mod 7), and 2037 is not a leap year.
  4. The answer is 2037.

Why this works: Tracking the weekday shift modulo 7 year by year, while respecting leap years, finds the first exact match.

Where it leads: Calendars repeat every 6, 11 or 28 years depending on where the year sits in the leap cycle; the full Gregorian calendar repeats every 400 years (146097 days, exactly 20871 weeks).

Strategy: Parity and remainders, Spot the pattern and generalise

Problem I158

LogicShort answer

In a group of 40 people, 25 like tea and 30 like coffee. What is the smallest possible number of people who like both?

Hint

How many people at most can like tea or coffee?

Second hint

At most 40. And 25 + 30 counts the ‘both’ group twice.

Full worked solution

Answer: 15

  1. People liking tea or coffee = 25 + 30 − (both) ≤ 40.
  2. So both ≥ 55 − 40 = 15.
  3. 15 is possible: 10 like only tea, 15 like both, 15 like only coffee. The smallest number is 15.

Why this works: Inclusion–exclusion turns the overlap into a single inequality; an example shows the bound is reached.

Where it leads: The largest possible overlap is 25 (everyone who likes tea also likes coffee). Bounds like these are called Bonferroni inequalities in probability.

Strategy: Extremal principle, Pigeonhole principle

Problem I159

LogicShort answer

Seven friends want every pair of them to have a one-to-one phone call. Calls happen in rounds; in each round a person can be on at most one call. What is the smallest number of rounds needed?

Hint

How many calls are there altogether, and at most how many can happen in one round?

Second hint

21 calls; with 7 people at most 3 calls per round (someone sits out).

Full worked solution

Answer: 7

  1. There are C(7, 2) = 21 calls. In a round at most 3 calls can happen, since 7 people make at most 3 pairs.
  2. So at least 21/3 = 7 rounds are needed.
  3. 7 rounds are enough: seat the friends at the corners of a regular heptagon; in round k, the person at corner k sits out and the others pair up along chords parallel to the ‘opposite’ side. Every pair meets exactly once.
  4. The answer is 7.

Why this works: A counting bound shows at least 7 rounds; a symmetric construction shows 7 suffice.

Where it leads: This is a round-robin schedule (a 1-factorisation of the complete graph). Sports leagues use the same ‘circle method’ to build fixture lists.

Strategy: Extremal principle, Symmetry

Problem I160

LogicShort answer

Three discs of sizes small, medium and large are stacked on peg A, largest at the bottom. A move takes the top disc from one peg and puts it on a neighbouring peg (A and B are neighbours, B and C are neighbours, but A and C are not), never on top of a smaller disc. What is the smallest number of moves to move the whole stack to peg C?

Hint

Find the answer for 1 disc and 2 discs first.

Second hint

To move the largest disc from A to C it must stop at B, and each time it moves, all smaller discs must be out of the way on the far peg.

Full worked solution

Answer: 26

  1. With 1 disc: A → B → C: 2 moves.
  2. With n discs: move the top n − 1 discs A → C, move the big disc A → B, move n − 1 discs C → A, big disc B → C, then n − 1 discs A → C. So m(n) = 3m(n − 1) + 2.
  3. m(1) = 2, m(2) = 8, m(3) = 26.
  4. The answer is 26 (= 33 − 1).

Why this works: The largest disc forces a rigid plan; the smaller discs repeat the same problem three times, giving a recurrence.

Where it leads: m(n) = 3n − 1: this version visits every one of the 3n legal arrangements of the discs exactly once, tracing a path through all of them.

Strategy: Working backwards, Spot the pattern and generalise

Problem I161

LogicShort answer

A box holds 20 balls, each red or blue. Among any 10 of the balls there is at least one red ball, and among any 15 of the balls there is at least one blue ball. How many different numbers of red balls are possible?

Hint

What does ‘any 10 balls include a red’ tell you about the number of blue balls?

Second hint

At most 9 blue balls, and (from the second condition) at most 14 red balls.

Full worked solution

Answer: 4

  1. If there were 10 or more blue balls, you could pick 10 blue ones with no red: so there are at most 9 blue, i.e. at least 11 red.
  2. Similarly at most 14 red balls.
  3. So the number of red balls is 11, 12, 13 or 14, and each of these satisfies both conditions.
  4. That is 4 possibilities.

Why this works: ‘Any k contain a red’ is the same as ‘fewer than k are blue’: turning a statement about all selections into a count is the key step.

Where it leads: Translating ‘every subset of size k has property P’ into a statement about the whole set is the heart of extremal combinatorics (Turán, Ramsey).

Strategy: Extremal principle, Pigeonhole principle

Problem I162

LogicShort answer

Four friends have different heights. You may compare any two of them in one step (and learn which is taller). What is the smallest number of comparisons that always finds the tallest?

Hint

Each comparison can rule out at most one person from being the tallest.

Second hint

Three people must each lose at least one comparison.

Full worked solution

Answer: 3

  1. Each person who is not the tallest must be shown to be shorter than someone, so must lose at least one comparison.
  2. Each comparison has exactly one loser, so at least 3 comparisons are needed.
  3. 3 suffice: compare A with B, the winner with C, and that winner with D.
  4. The answer is 3.

Why this works: Counting ‘losers’ (like counting knocked-out players in a tournament) gives a lower bound that a simple method meets.

Where it leads: Finding both the tallest and the shortest of n needs about 3n/2 comparisons, not 2n; finding the second tallest needs n + ⌈log2 n⌉ − 2.

Strategy: Extremal principle, Proof techniques

Problem I163

LogicShort answer

On an island, knights always tell the truth and knaves always lie. A says: ‘I am a knave and B is a knight.’ B says: ‘A is a knight.’ C says: ‘B is a knave.’ How many of A, B and C are knights?

Hint

Can a knight ever say ‘I am a knave and …’?

Second hint

A knight would be saying something false, so A is a knave. Then A’s whole statement is false; which part fails?

Full worked solution

Answer: 1

  1. A knight cannot say ‘I am a knave and …’ (the first part would be false). So A is a knave.
  2. A’s statement is then false. Its first part (‘I am a knave’) is true, so the second part must be false: B is a knave.
  3. B says A is a knight, which is false: consistent with B being a knave. C says B is a knave, which is true, so C is a knight.
  4. Exactly 1 knight (C).

Why this works: A statement containing ‘I am a knave’ immediately fixes the speaker as a knave; then the rest of the statement must be what makes it false.

Where it leads: A compound statement ‘P and Q’ is false when at least one part is false. Careful handling of ‘and’, ‘or’ and ‘not’ is the start of formal logic.

Strategy: Proof techniques, Organised cases

Problem I164

LogicMultiple choice

A 3 by 3 grid of lamps starts with all lamps off. Pressing a lamp switches it and its horizontal and vertical neighbours (on becomes off, off becomes on). Which set of presses leaves only the centre lamp on?

Hint

The order of presses does not matter, and pressing a lamp twice cancels out. So you just choose a set of lamps. Count how many times each lamp is switched.

Second hint

A lamp ends up on exactly when it is switched an odd number of times.

Full worked solution

Answer: D, Press the centre and the four edge-middle lamps

  1. Order does not matter and double presses cancel, so a plan is a set of lamps; a lamp ends on when it is switched an odd number of times.
  2. Check D (centre and four edge-middles, a plus shape). Centre: switched by all 5 presses: odd, on. Each edge-middle: by itself and the centre: 2, off. Each corner: by its two edge-middle neighbours: 2, off. ✓
  3. The others fail: A also lights the four edge-middles; B lights the corners; C lights the corners and leaves the edge-middles switched 3 times (on).
  4. So the answer is press the centre and the four edge-middle lamps (D). (Checking all 512 sets shows it is the only one.)

Why this works: Working with parities (odd or even numbers of switches) turns the puzzle into simple counting, independent of the order of presses.

Where it leads: This is the game ‘Lights Out’. It is linear algebra over the field with two elements: on the 3 × 3 board every pattern is reachable in exactly one way, but on 4 × 4 or 5 × 5 boards some patterns are impossible.

Strategy: Parity and remainders, Invariants

Problem I165

LogicMultiple choice

Five cards lie in a row, all face up. A move turns over any three cards that are next to each other. What is the smallest number of moves needed to make all five cards face down?

Hint

Order does not matter and doing the same move twice cancels out. So the question is which of the three possible moves to use.

Second hint

Card 1 is turned only by the move on cards 1-2-3, and card 5 only by the move on 3-4-5. Follow what that forces.

Full worked solution

Answer: E, It cannot be done

  1. The moves turn cards 1-2-3, 2-3-4 or 3-4-5. Order does not matter, and using a move twice cancels, so each move is effectively used once or not at all. Every card must be turned an odd number of times.
  2. Card 1 is turned only by 1-2-3, so that move must be used. Card 5 is turned only by 3-4-5, so that move must be used.
  3. Card 2 is turned by 1-2-3 and 2-3-4. To be turned an odd number of times, 2-3-4 must not be used. But then card 3 is turned twice (by 1-2-3 and 3-4-5): even. Contradiction.
  4. So it cannot be done (E), however many moves you make.

Why this works: Reducing the problem to ‘which moves, each used once or not’ leaves only 8 cases, and parity forces a contradiction without trying them all.

Where it leads: With 6 cards it can be done (turn 1-2-3 and 4-5-6). Which numbers of cards work? This is linear algebra over the numbers mod 2, the same maths as error-correcting codes.

Strategy: Parity and remainders, Proof techniques

Keep going

More Intermediate problems: Number theory · Combinatorics · Geometry · Algebra · Probability

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

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