Function machine puzzles for kids

A machine turns numbers into other numbers. Your child works out the rule from a few examples, predicts what comes out, works backwards, and meets two machines in a row. Six levels, a daily set and printable worksheets.

How it works

  1. Pick a level, or let the game move up as your child wins
  2. Read what goes in and what comes out, then answer the last row or pick the rule card
  3. Print a worksheet with an answer key when you want a break from the screen

What a function machine teaches

A function machine is a box that does the same thing to every number that goes in. Seeing 3 become 5, then 7 become 9, a child can work out that the machine adds 2, and use that to predict the next number. That step, finding a rule from examples and then using it, is the heart of early algebra and a common question type in children's maths contests. This game uses only whole numbers from 0 to 50, so every number on screen is one a child of 6 or 7 can add, take away or double in their head. The machine never shows a rule that needs a symbol the child has not met: the rules are written as words such as Add 3, Take away 2 and Double. The first levels give the examples and ask for the next output, and the later levels ask for the rule, for an input, or for two machines at once.

The six levels

Level 1 shows two examples of a machine that adds 1 to 5, and asks what comes out of a new number; the numbers stay small, with inputs up to 15 and outputs up to 20. Level 2 shows three examples of a machine that adds or takes away 1 to 9. Level 3 shows three examples and four rule cards, and the child picks the card that matches. The cards are Add, Take away or Double, and the wrong cards often fit the first example, so a quick guess is not enough. Level 4 uses two steps in one machine: double then add or take away 1 to 3, or add or take away 1 to 3 and then double, with three examples and a new number to try. Level 5 works backwards through two or three steps. The machine's rule is on the box, it gave a number, and the child says what went in, for example Double then add 3 gave 31, or Add 2, then double, then take away 4 gave 20. Level 6 puts two machines in a row. The first one adds, takes away or doubles and shows its rule; the second is hidden and has two steps, a double together with an add or a take away. The examples show the number in the middle and the number at the end, and the child works out the hidden machine to answer for a new number.

How each puzzle is made and checked

Every rule here is a straight-line rule: add a number, take away a number, or double, alone or one after another. The game picks a rule and a few inputs where every number along the way stays between 0 and 50, then draws the examples. In the levels that show examples (1, 2, 4 and 6) the game also tries every rule a child might guess from them: any straight-line rule, a rule that adds one amount to even numbers and another to odd numbers (which covers make the next even number), next ten, and add the ones digit. A puzzle is only kept when every such guess that fits the examples gives the same answer, so examples such as 8 to 10 and 14 to 16 are thrown away when they could also mean make the next even number. The tests repeat this with a wider list of guesses on 500 or more seeds per level, and also list every rule made of one or two steps with numbers from 1 to 10, 462 rules in all, to check that the examples leave one rule. Some rules written differently are the same rule, for example double then add 2 and add 1 then double, so they count once. At level 3 only one of the four cards fits every example. At level 5, which shows its rule and gives an output, the tests check that only one number from 0 to 50 goes into the machine and gives that output. At level 6 the examples have to leave one hidden two-step machine.

Worksheets, the daily set and what it does not do

Print a worksheet by choosing the level, 4, 6 or 8 puzzles, and Letter or A4 paper. Each sheet has new puzzles, and the last page is an answer key that shows the rule and the numbers it makes. The daily set, Today's 5, is made from the date on your device, so a child who plays on two devices on the same day sees the same five puzzles. There is no timer by default, no ads inside the play area and no account, and a speaker button reads each question aloud with your device's voice. This game does not teach the written symbols of algebra, it has no rules with more than two steps, it never uses numbers above 50 and it is not a test of a school curriculum. Progress is saved in this browser only.

Frequently asked questions

What age are function machine puzzles for?

They are made for a child of about 6 or 7 who can add and take away within 20 and double small numbers. Level 1 only adds 1 to 5, with numbers up to 20, and shows two examples. Levels 4 to 6 use two steps, backwards thinking and two machines, and are meant for a child who finds the first levels easy.

Can two different rules fit the same examples?

Not among the rules a child is likely to guess. In the levels with examples, the game keeps a puzzle only when every guess that fits the examples, such as add a number, make the next even number or next ten, gives the same answer, and the tests check 462 rules of one or two steps as well. Two rules written differently but always giving the same output, such as double then add 2 and add 1 then double, count as one rule.

What does working backwards mean here?

At level 5 the machine gives an output and the child says what went in. For Double then add 3 giving 31, the child takes away 3 to get 28, then halves it to get 14. The explanation after each answer shows these steps and checks them going forwards.

Why are the numbers never higher than 50?

So a child can work every step in their head and the printed picture stays clear. The game only makes a puzzle when each number along the way, including the number in the middle of two machines, is between 0 and 50.

How do the printable worksheets work?

Choose a level, 4, 6 or 8 puzzles and Letter or A4. The sheet is made in your browser from new puzzles each time, in black and white, and the last page is an answer key. Nothing is uploaded.

Does the game keep my child's scores?

Only in this browser, on this device: the level, stars and daily progress are saved in local storage and nothing is sent anywhere. The page counts visits with Google Analytics, never answers. Clearing site data for this page removes the saved progress.