Logic & puzzles • Classes 4–5
Build a rule machine
Can a clear instruction work for every number?
Take your time. Speak, draw or write your answers.
Here is what is happening.
An algorithm is a set of instructions. A condition chooses which instruction to follow. Test a rule with several inputs, including a case where the condition is false.
Your little investigation
What you need
Paper and a pencil; no computer needed.
Use this rule: if a whole number is even, add 1; otherwise subtract 1.
Try 2, 5 and 8. Write input and output in two columns.
Explain which instruction was chosen for each input.
What does this machine output for 5?
KEEP ASKING
All activities in your group