Cover lesson · Maths · Year 7 · Beginner

Number machine flowcharts

DCF: Data and computational thinking → Problem-solving and modelling

Name: Class: Date:

Cover teacher — you need no subject knowledge and no computers

Print: this sheet, one per pupil. Everything pupils need is on it. Calculators are not needed and are better left away: the point is to do each step in order by hand.

Run: 5 min read the flowchart symbols together · 8 min Step 1 · 8 min Step 2, working backwards · 7 min Step 3, does the order matter? · 7 min Step 4, the mystery machine · 12 min Step 5, the halve-or-triple machine · 8 min Step 6, the mind-reading trick.

Collect: this sheet. All the answers are on the worked example sheet. If pupils get stuck on Step 5, the most common slip is forgetting to write down each new number before asking "Is it 1?" again.

What you are doing

A number machine takes a number in, does something to it and gives a number out. Draw one as a flowchart and it becomes an algorithm: a set of steps so exact that anyone — or any computer — following them gets the same answer. You will run machines forwards and backwards, find a hidden machine from clues, and finish with a flowchart that seems to read minds.

The flowchart symbols

Start / Stop Where it begins and ends IN / OUT A number goes in or comes out × 4 Do something to the number Even? A question: Yes or No

Step 1 — run Machine A

IN × 4 − 3 OUT
IN After × 4 After − 3 OUT
2
5
10
0

Step 2 — run Machine A backwards

Machine A gave these outputs. What went in? Start at OUT and undo each box, last box first.

OUT Working IN
29
1
97

Fill in the two boxes of the backwards machine:

OUT IN

Step 3 — does the order matter?

Machine B: IN → + 3 → × 2 → OUT.    Machine C: IN → × 2 → + 3 → OUT. Same two boxes, swapped round.

IN Machine B OUT Machine C OUT Difference (B − C)
1
4
10

What do you notice about the difference? Can you explain why it happens?

Step 4 — the mystery machine

This machine has two boxes: a multiply, then an add. Here is what it did.

IN12410
OUT581432

Clue: look at how much OUT goes up when IN goes up by 1.

The machine is: IN → × ____ → + ____ → OUT

Check it works for all four pairs. Then predict: what comes out if 100 goes in?

Step 5 — the halve-or-triple machine

This flowchart has decisions and a loop: arrows that go back up, so the same boxes run again and again.

Start IN: a whole number Write the number down Is it 1? Yes Stop No Is it even? Yes No Halve it × 3, then + 1

A step is one trip round the loop: one halving, or one "× 3, then + 1". Start 3 has been done for you.

IN Numbers written down, in order Steps to reach 1
33, 10, 5, 16, 8, 4, 2, 17
6
7
Your choice: ____

Look at the rows for 3 and 6. What do you notice, and why does it happen?

Mathematicians have tested this machine on every starting number up to enormous sizes and it has always reached 1 — but since the German mathematician Lothar Collatz asked the question in 1937, nobody has managed to prove that it always will.

Step 6 — the mind-reading machine

Try this on yourself three times with three different starting numbers.

IN Double it + 10 Halve it Take away the number you began with OUT
IN Double it + 10 Halve it Take away IN

(a) What always comes out? Explain why the number you start with does not matter.

(b) Change one box so the machine always gives 7 instead. Test it on one number.

Step by step

  1. 5 min — Read the four flowchart symbols. Point to each one in the Step 5 flowchart.
  2. 8 min — Step 1: run four numbers through Machine A.
  3. 8 min — Step 2: work backwards and draw the backwards machine.
  4. 7 min — Step 3: compare Machines B and C.
  5. 7 min — Step 4: find the mystery machine and test it.
  6. 12 min — Step 5: trace the halve-or-triple machine for 6, 7 and a number you choose.
  7. 8 min — Step 6: the mind-reading machine, then make it give 7.

Success criteria

If you finish early