Small Group Tutorials

Here to help students catch up, keep up, and move ahead. Book a consultation here.

Primary Mathematics: Function Machines, Input–Output Tables and Inverse Rules | Worked Learning Guide

BTT Mathematics / Primary Mathematics Learning Hub / Function Machines

A function machine applies a stated rule to an input and produces an output. The same input must produce the same output when the rule and conditions have not changed. Input–output tables make the rule visible across several examples; inverse reasoning asks which input could have produced a known output.

For a machine “multiply by three, then add two,” input four gives fourteen: 4×3+2=14. To reverse output fourteen, undo the operations in reverse order: subtract two, then divide by three, giving four.

This guide is Primary Mathematics enrichment. It extends Patterns, Early Algebra and Equations and Working Backwards and Reverse Processes. Formal function notation is optional bridge work rather than a required Primary convention. Use the MOE Primary curriculum page and current school scope for required content.

Read the rule · Complete tables · Compose machines · Inverse rules · Restrictions and ambiguity · 24 questions · Worked answers · Teaching and transfer

1. Order matters inside the machine

“Add two, then multiply by three” is not the same as “multiply by three, then add two.” With input four, the first gives eighteen while the second gives fourteen.

Worked example A: Linear rule

Rule: double, then add five. Input seven gives 14+5=19.

Worked example B: Subtract then square

Rule: subtract one, then multiply the result by itself. Input five gives (5−1)²=16.

Worked example C: One verbal rule, one algebraic expression

“Multiply by four, then subtract three” can be recorded as output=4x−3. The symbol x is simply a placeholder for the input.

A machine rule should be complete

“Make the number bigger” does not determine one output. “Add four” does. The same input can have different outputs only when the rule, state or conditions have changed.

2. Tables reveal both rule and exceptions

A table can list inputs 1,2,3,4 and outputs 5,8,11,14. The change of +3 in the output suggests rule 3x+2. Test several rows: 3×1+2=5 and 3×4+2=14.

Worked example D: Find a missing output

For output=2x+7, input nine gives 25.

Worked example E: Find a missing input

For output=5x−1 and output twenty-nine, solve 5x−1=29. Then 5x=30, so input=6.

Worked example F: Infer a constant-step rule

Inputs 0,1,2,3 have outputs 4,7,10,13. The rule 3x+4 fits every shown row. A short table can suggest this rule; if the task claims a unique rule for all unseen inputs, that rule or a rule family should be stated.

3. Two machines in sequence form one composite rule

Machine A adds three. Machine B doubles. Passing input x through A and then B gives 2(x+3)=2x+6.

Worked example G: A then B

Input five: A gives eight, then B gives sixteen. Composite output=16.

Worked example H: Reverse the order

If B acts first and A second, input five doubles to ten and then becomes thirteen. The new composite rule is 2x+3, not 2x+6.

Worked example I: Three operations

Start with x, add two, multiply by four, subtract five. Composite expression=4(x+2)−5=4x+3. Input six gives 27.

Equivalent machines can look different

“Double then add six” and “add three then double” both give 2x+6. Different descriptions can produce the same final rule. Check by algebra or by reasoning about how the addition is scaled.

4. An inverse undoes a reversible rule in reverse order

If the forward rule is “multiply by three, then add two,” the reverse rule is “subtract two, then divide by three.” Reversing the order is essential.

Worked example J: Reverse a two-step rule

Output thirty-five came from “×4, then +3.” Subtract three to get thirty-two, then divide by four. Input=8.

Worked example K: Reverse a fraction rule

Forward: divide by five, then add seven. Output eleven. Undo +7 to get four, then multiply by five. Input=20.

Worked example L: Check by round trip

Forward rule 2x+9; inverse operation on output y is (y−9)÷2. Starting with x=12 gives 33; applying the inverse returns twelve. A round trip is a strong structural check.

Inverse rules need a one-to-one relationship on the allowed domain

Rule “square the input” sends both 3 and −3 to 9. If negative and positive inputs are both allowed, output nine does not identify a unique input. Restricting the domain to non-negative inputs makes the inverse unique for this example.

5. Domain restrictions decide what inputs are legal

A machine may accept only whole numbers, only positive values or only inputs satisfying another condition. The rule and the domain together define the task.

Worked example M: Whole-number outputs

Machine divides the input by four. If inputs must be whole numbers and outputs must also be whole, then inputs 8,12,20 are valid while input 10 gives 2.5 and fails the whole-output condition.

Worked example N: Input range

Rule y=3x+1 with integer input 2≤x≤5 produces outputs 7,10,13,16.

Worked example O: Output restriction

Rule y=2x+3. Which whole-number inputs from 0 through 10 give y≤15? Solve 2x+3≤15, so x≤6. The accepted inputs are 0 through 6.

Worked example P: Non-unique reverse

Rule y=|x|, the distance of x from zero. Output five can come from x=5 or x=−5. The inverse is not a single value unless the input domain is restricted.

6. Practice: 24 original questions

Questions 1–8: Apply and infer rules

1. Rule: double then add 5. Find the output for input 7.

2. Rule: multiply by 4 then subtract 3. Find the output for input 6.

3. Rule: add 2 then multiply by 3. Find the output for input 4.

4. Rule: multiply by 3 then add 2. Find the output for input 4.

5. Rule y=2x+7. Find y when x=9.

6. Rule y=5x−1. Find x when y=29.

7. Inputs 0,1,2,3 give outputs 4,7,10,13 under the stated linear rule. Write the rule.

8. Rule: subtract 1, then square the result. Find the output for input 5.

Questions 9–16: Composite and inverse machines

9. Machine A adds 3; Machine B doubles. Pass input 5 through A then B.

10. Pass input 5 through B then A.

11. Start with x, add 2, multiply by 4, subtract 5. Find the output for x=6.

12. Forward rule: ×4 then +3. Output is 35. Find the input.

13. Forward rule: ÷5 then +7. Output is 11. Find the input.

14. Forward rule y=2x+9. Find the input that gives y=33.

15. Forward rule: subtract 6, then divide by 2. Write the reverse operations in order.

16. Explain why “square the input” does not have a unique inverse on all integers for output 9.

Questions 17–24: Tables, restrictions and feasibility

17. For y=3x+1 and integer 2≤x≤5, list all outputs.

18. For y=2x+3 and whole-number 0≤x≤10, list the inputs giving y≤15.

19. A divide-by-4 machine requires whole-number output. Which of 8,10,12,20 are accepted?

20. Rule y=4x+2. Find the outputs for inputs 1,3,5.

21. Rule y=10−x. Find the input that gives output 3.

22. Machine A triples; Machine B subtracts 4. Find the composite output for input 6 when A acts first.

23. Machine A triples; Machine B subtracts 4. Find the output for input 6 when B acts first.

24. Rule y=|x|. If integer inputs from −6 to 6 are allowed, list all inputs giving output 5.

7. Worked answers

Answers 1–8

1. 19. 7×2+5.

2. 21. 6×4−3.

3. 18. (4+2)×3.

4. 14. 4×3+2. The changed order changes the output.

5. 25. 2×9+7.

6. 6. 5x−1=29 gives x=6.

7. y=3x+4. It matches every shown row.

8. 16. (5−1)².

Answers 9–16

9. 16. 5→8→16.

10. 13. 5→10→13.

11. 27. 6→8→32→27.

12. 8. 35−3=32; 32÷4=8.

13. 20. 11−7=4; 4×5=20.

14. 12. (33−9)÷2=12.

15. Multiply by 2, then add 6. Undo division first, then subtraction.

16. Both 3 and −3 square to 9. The output does not determine one integer input.

Answers 17–24

17. 7,10,13,16. Substitute x=2,3,4,5.

18. 0,1,2,3,4,5,6. 2x+3≤15 gives x≤6.

19. 8,12,20. Their outputs are 2,3,5. Ten gives 2.5.

20. 6,14,22.

21. 7. 10−x=3.

22. 14. 6×3−4.

23. 6. (6−4)×3.

24. −5 and 5. Both have distance five from zero.

8. Teaching and transfer

If a learner changes the operation order, use two physical cards labelled with the operations and swap their positions. Apply each arrangement to the same input. The difference becomes observable rather than verbal.

When a table is treated as decoration

Ask the learner to check the proposed rule against at least two rows. Then use it to predict a new row. A rule should compress the table, not merely restate one entry.

When inverse steps are written in forward order

Use a short journey: “put on socks, then shoes.” Undoing requires removing shoes first. The same reverse-order principle governs arithmetic operations.

When a reverse answer is assumed unique

Use the squaring example. Ask which allowed inputs can produce nine. This links inverse reasoning to the domain and to feasible ranges.

When two machines are composed

Record the intermediate value explicitly before simplifying to one formula. This reduces order errors and prepares the learner for multi-step algorithms.

Continue through this enrichment collection

For accepted input ranges, use Inequalities, Number Lines and Feasible Ranges. For branching procedures, use Mathematical Algorithms, Flowcharts and Decision Trees. For spatial rules based on distance, use Loci, Distance Constraints and Grid Geometry.

Return to the BTT Primary Mathematics Learning Hub.

Original enrichment guide with 24 original practice questions and separate worked answers. Function-machine rules and domains are stated locally; no official examination requirement is implied.