Tutorpip← About this lessonOpen the sheet →Download PDF
Ages 8+ · Coding · Patterns and algorithms
Finding the biggest
Blocks in each tower0246810124192331247556blocks
Six towers, one at a time.
The big ideaTo find the biggest, look at each one in turn and remember the biggest so far.

How it works

To find the biggest, look at each one in turn. Bo can only peek at one tower at a time.

Bo keeps the biggest so far in his memory box.

Each time he asks one question: is this tower bigger than the box? If yes, swap it in. If not, the box stays the same.

When you run out of towers, the one in the box is the biggest.

Tower• 1 has 4• 2 has 9• 3 has 3• 4 has 12• 5 has 7The box holds• 4• 9• 9• 12• 12
What the box holds after each tower.

Example 1: The first towers

  1. Tower one has four blocks, so Bo keeps four in the box.
  2. Tower two has nine blocks. Nine is bigger than four, so Bo swaps it in.
  3. The box holds nine.

Example 2: Keep the box

  1. Tower three has three blocks.
  2. Three is smaller than nine, so Bo keeps nine in the box.

Example 3: Swap again, and finish

  1. Tower four has twelve, which is bigger than nine, so the box holds twelve.
  2. Towers five and six have seven and five. Both are smaller, so the box keeps twelve.
  3. No towers are left, so the biggest is twelve, tower four.

Example 4: A different row

  1. The towers have 5, 8, 2, 6, 11 and 9 blocks.
  2. Tower 1: the box holds 5. Tower 2 has 8, which is bigger, so the box holds 8.
  3. Towers 3 and 4 have 2 and 6, which are smaller, so the box keeps 8.
  4. Tower 5 has 11, which is bigger, so the box holds 11. Tower 6 has 9, smaller, so the box keeps 11.
  5. The biggest is 11.

Words to know

memory box
Holds the biggest tower seen so far.
swap
Put a bigger tower into the box in place of the old one.
so far
Up to the tower you are looking at now.
biggest
The most blocks of all the towers.

Watch out

Try it

  1. The box holds 9 and the next tower has 12. Do you swap or keep?
  2. The box holds 12 and the next tower has 5. Do you swap or keep?
  3. The towers have 3, 7 and 4 blocks. What does the box hold at the end?
  4. Is the last tower you look at always the biggest?
  5. The towers have 6, 2 and 9 blocks. What does the box hold after tower 2?
Answers: 1. Swap · 2. Keep · 3. 7 · 4. No · 5. 6
Try at homeAsk a grown-up to lay six number cards face down. Turn them over one at a time. Keep only one card in your hand, the biggest so far, and swap it when you find a bigger one. At the end, say which is the biggest, then turn them all over to check!
For grown-upsPlay the Mission: lay six number cards face down. Your child turns them over one at a time, keeping only one card in hand, the biggest so far, and swapping it when a bigger one comes. At the end, they say which is the biggest, then you turn them all over to check.
Open these notes on screenScan the code, or go to tutorpip.com.