Maths Manipulatives  /  Function Machine

Interactive function machine: guess my rule

A number goes in the IN box, moves through one or two steps inside the machine, and comes out in the OUT box. Every pair fills an In and Out table underneath.

See every step. The number changes as it passes each step card, so the class sees 10 become 30, then 32.
Guess the rule. A random rule hides behind question mark cards. The class works it out from the table, then you reveal it.
Run it backwards. Switch to Out → In, give the number that came out, and the machine finds what went in, one inverse step at a time.

Opens on the whiteboard. Free, no sign-in.

What it looks like on the board

The function machine on the whiteboard: 12 in the IN box, a rule of times 3 then add 2 inside the machine, a red question mark in the OUT box, and an In and Out table underneath showing 4 to 14, 7 to 23 and 10 to 32.

What is a function machine in maths?

A function machine is a box with a rule inside: a number goes in, the rule changes it, and a new number comes out the other side. On this one, the IN box sits on the left, the teal machine with its step cards in the middle, and the OUT box on the right. Under it is the In and Out table, which American schools call an input output table, and the row along the top holds the three ways to run it: In → Out, Out → In and Guess the rule.

  • Put a number in. Type it in the IN box, or press Random number underneath. Stop there, so the class can predict what will come out.
  • Send it through. The yellow Send it through button moves the number past each step card, and it changes as it goes. It lands in the OUT box and the pair goes into the table.
  • Change the rule. Pick 1 step or 2 steps on the right of the row, then press Change under a step to choose add, take away, multiply or divide and its number. Changing the rule clears the table, so the pairs always match the rule.

Guess my rule: a function machine game

Guess the rule turns the machine into a game: it hides a secret rule, and the class sends numbers through until someone can say what it does. The rules are sized for primary, things like add 7, times 4, or times 3 then take away 2. Every step is covered by a black question mark card, and while anything is covered no in-between number is shown, so only the In and Out give the rule away.

Send three or four numbers through and ask the class what the machine is doing. Ask them to predict the next Out before you send it. When they think they have it, press Show under one step, or Reveal rule for all of it. New rule picks another.

Running a function machine backwards (inverse)

Out → In turns the machine round: you type the number that came out, and it runs back through the inverse steps to find what went in. With times 3 then add 2, it takes away 2 first, then divides by 3, so the class sees why the last step is undone first.

This is the missing number problem made visible. Numbers stay whole, so if nothing whole can go in to give that number, the machine says so.

How to use it in a lesson

  1. Start with one step. Set a rule like add 5 and send a few numbers through. Ask what is happening to every number.
  2. Predict first. Put a number in and stop. Pupils write the Out on whiteboards, then send it through to check.
  3. Add a second step. Times 2 then add 1. Talk about why 10 goes to 21, not 22.
  4. Guess the rule. Let the class choose the numbers to send. Which numbers make the rule easiest to spot?
  5. Finish backwards. Give an Out and ask what went in. Switch to Out → In to check.

Function machines from Year 2 to Year 6

  • Year 2. One step, add or take away a single digit, then times 2, 5 or 10.
  • Year 3 and 4. One step multiplication and division facts, then two steps with add or take away. Guess the rule with one step.
  • Year 5. Two steps, and Out → In to practise inverse operations.
  • Year 6. Two step rules written as a formula: Out is 3 times In, add 2. Guess the rule with two steps, and missing number problems backwards.

Function machine misconceptions

The order of the steps doesn't matter. Swap times 3 then add 2 for add 2 then times 3 and send the same number through. The table makes the difference plain.

Running backwards means doing the same steps. Out → In divides where the rule says multiply, and undoes the last step first.

A rule only works for the numbers you tried. Guess the rule asks pupils to test their idea on a new number before it is revealed.

Frequently asked questions

Is there a free function machine for the interactive whiteboard?

Yes. It's free, with no sign-in. Type a number or press Random number, press Send it through, and watch it go through one or two steps into the OUT box.

Can I hide the rule so the class has to guess it?

Yes. Press Guess the rule. The machine picks a random rule and hides it behind question marks. Send numbers through, let the class work it out from the table, then press Reveal rule.

Can it run backwards?

Yes. Press Out → In and type the number that came out. Send it through, and it runs the other way through the inverse steps until it reaches the number that went in.

What happens if a number will not divide exactly?

The machine keeps to whole numbers. If a number would leave a remainder, it says so and asks for another one. Random number only ever picks numbers that go through cleanly.

Can I set my own rule?

Yes. Pick 1 step or 2 steps, then press Change under a step to choose add, take away, multiply or divide, and its number.

Is an input output table the same as a function machine?

They show the same rule two ways. The machine shows one number going through the steps, and the input output table keeps every pair so the class can spot the pattern. Here the table fills itself as each number comes out.

Is there a function machine game for KS2?

Guess the rule is the game. The machine hides a random rule, the class picks numbers to send through, and the first to explain the rule wins before you press Reveal rule. Two step rules make it harder for Year 5 and 6.

What is a two step function machine?

A machine with two rules in a row, such as times 3 then add 2. The number does the first step, then the second. Pick 2 steps in the row to set one up, and the number changes as it passes each step card.

Try it now

Open it, press Guess the rule, and let the class pick the first number to send through.

Other maths manipulatives

See all 21 maths manipulatives →

Written by a practising primary school teacher, part of the free Maths Manipulatives set on Sage Teachers. Last checked November 2026. Free to use, no sign-in.