Class 3 · CBSE AI · Strand C — Algorithms are Recipes
If-then decisions — how algorithms make choices
Algorithms make choices with 'if this, then that'. The conditional, explained for Class 3 children.
Class 3 · CBSE AI · Strand C — Algorithms are Recipes
Algorithms make choices with 'if this, then that'. The conditional, explained for Class 3 children.
Monsoon season in India
Every monsoon morning, you make a decision: if there are dark clouds, carry an umbrella; otherwise, leave it at home. That 'if-then-otherwise' thinking is exactly how computers make decisions — they check a condition and then choose what to do next.
A toll booth on a highway
At a toll booth, the rule is: if the driver has a FASTag, the barrier lifts automatically; otherwise, they stop and pay cash. The barrier follows an if-then rule all day long without anyone having to think about it each time.
Every Dhee Learning session for this concept follows three stages. We share the questions Dhee actually asks, so you can hear what a session sounds like.
Stage 1 — Surface
Your mum says: 'If it's raining, take an umbrella; otherwise, don't.' Is that an instruction? What makes it different from a normal step like 'put on your shoes'?
Rote answer
"Child says 'it has an if in it' without understanding that it represents a choice based on a condition"
Understood
"Child explains that the action changes depending on the situation — if the condition is true, one thing happens; if not, something else happens"
Stage 2 — Reasoning
A robot follows this instruction: 'If the traffic light is green, walk forward; if it is red, stop.' What would happen if we left out the 'if red, stop' part? Why is the ELSE part of an if-then so important?
Follow-up Dhee may use: Can you think of a situation from your day where 'if this, do that — but if NOT this, do something else' happens naturally?
Stage 3 — Application
Write an if-then instruction for a robot guard dog at a school gate: it should let students with a school ID card in, but ask people without one to wait. What are the two possible situations? What does the robot do in each one?
Misconception Dhee watches for: Child writes only the 'if' part and forgets the 'else' — leaving the algorithm with no instruction for the second case
Dhee turns this concept into a 15-minute spoken session — asking, listening, and probing — so your child builds the idea themselves.
Algorithms make choices with 'if this, then that'. The conditional, explained for Class 3 children.
If-then instructions are only needed for complicated programs — simple algorithms don't need decisions
Dhee opens with a question — for example: "Your mum says: 'If it's raining, take an umbrella; otherwise, don't.' Is that an instruction? What makes it different from a normal step like 'put on your shoes'?" — listens to your child's answer, then probes the reasoning behind it. The session ends when the child can apply the idea to a brand-new situation, not just recall it.