Ages 9–10 · 8 little discoveries
Logic with Piko
Finding a rule from examples, two rules at once, elimination tables, the order of steps, repeat commands, conditions, finding a bug, and one answer with reasons.
- Learn
- Play
- Show
Choose a lesson. You can revisit any discovery.
Read the lessons
Find the rule
Names the one rule that fits every example in a set.
A rule is a feature that every example in a set shares. Look at 3, 6 and 9 together.
The rule “multiples of 3” fits 3, 6 and 9: 3 × 1, 3 × 2 and 3 × 3. Each number fits the rule.
Counter-example: “multiples of 3” breaks when 10 joins the set, because 10 is not a multiple of 3. A rule that breaks one example is not the rule.
Try it: which rule fits 2, 4, 6 and 8? Check every example, not only the first one.
Both rules at once
Finds the items that satisfy two rules at the same time.
Two rules can work together. “Both … and …” means both rules must be true at the same time. Look at 4, 6, 8 and 9.
Rule A: the number is even. Rule B: the number is bigger than 6. 8 is even and bigger than 6, so it follows both rules.
Counter-example: 9 is bigger than 6, but it is odd. It follows only rule B, so it does not follow both rules.
Try it: 4 is even, but it is not bigger than 6. Which rule does it break?
Eliminate in a table
Uses an elimination table and clues to find one pairing.
In an elimination table, each friend has a row and each pet has a column. A cross means “not possible”.
Clue 1: Selin has no cat. Put a cross in Selin’s cat box. Each cross is one fact.
Counter-example: one cross does not solve the puzzle. Selin can still have a dog or a bird, so keep reading the clues.
Try it: after clues 1 and 2, only the dog and the bird are left for Selin and Can. Clue 3 decides which one is Selin’s.
Order of steps
Predicts the result of a list of steps and shows that the order changes it.
A program is a list of steps. The computer runs them from top to bottom. Start with x = 3.
Step A: add 4. Step B: multiply by 2. Run A, then B: 3 + 4 = 7, and 7 × 2 = 14.
Counter-example: the same two steps in the other order give a different result. Run B, then A: 3 × 2 = 6, and 6 + 4 = 10.
Try it: the order changes the result. Read the steps from top to bottom and never skip one.
Repeat the steps
Expands a repeat command into the full list of steps it stands for.
A repeat command runs the same steps again. “Repeat 2 times: right, down” means right, down, right, down.
Start at the top-left square. Follow right, down, right, down, and you reach the bottom-right square.
Counter-example: “Repeat 2 times: right, down” is not the same as “right, right, down, down”. The order inside the repeat stays the same.
Try it: write the steps of “Repeat 3 times: down” one by one. How many steps are there?
If this, then that
Applies an if–else rule to decide which branch a program takes.
A condition is a question with a yes or no answer. “x is less than 5” is either true or false.
If the condition is true, the first branch runs. If it is false, the other branch runs. Example: x = 3 is less than 5, so add 5. The result is 8.
Counter-example: x = 7 is not less than 5, so the other branch runs: subtract 5. The result is 2, not 12.
Try it: x = 5. Is 5 less than 5? Be careful: “less than” does not include 5 itself.
Find the bug
Finds the single faulty step in a short program and checks the fix.
Debugging means checking a program step by step to find the first step that goes wrong.
Program: right, right, down, left. The goal is the right end of the middle row. After the last step, the robot is in the middle of the middle row, not on the goal.
Counter-example: the step “down” is not a bug. Without it, the robot never reaches the middle row.
Try it: remove one step and run the program again. Which removal leaves the robot on the goal?
One answer, with reasons
Solves a four-clue puzzle with one answer and says which clue decided it.
Read the clues in order. Each clue removes some answers. Keep the clues that still help.
Clue 4 says Ece finished second. Clue 3 says Deniz finished last, so Deniz is fourth. Those two places are already known.
Counter-example: clue 1 alone does not give a place. Selin finished before Ece, but that does not fix Selin’s place: Selin could finish first, second or third.
Try it: with clue 4, Ece is second, so Selin must finish first. Where can Can finish?