ROOTED IN SAHARANPUR. IMAGINING A BRIGHTER INDIA. 2026 • A journey of discovery
Logic & puzzles Classes 45

Build a rule machine

Can a clear instruction work for every number?

About 10 minutes Read · try · explain
Take your time. Speak, draw or write your answers.
01 / UNDERSTAND

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.

02 / MAKE IT YOUR OWN

Your little investigation

What you need

Paper and a pencil; no computer needed.

  1. Use this rule: if a whole number is even, add 1; otherwise subtract 1.

  2. Try 2, 5 and 8. Write input and output in two columns.

  3. Explain which instruction was chosen for each input.

03 / CHECK YOUR UNDERSTANDING

What does this machine output for 5?

Choose one answer
KEEP ASKING

Another question is waiting.

All activities in your group