Level 2 · Module 4 · 10 minutes
Rules, flowcharts and hand-written logic
- Describe how a rule-based programme produces an answer.
- Give two tasks where hand-written rules are the better choice.
- Explain the difference between a rule-based programme and a trained model.
A traditional programme is a set of instructions a person writes. The programmer decides every step in advance: read the input, check it against conditions, and produce the output. The computer follows the instructions exactly. It does not study examples, and it does not guess.
A familiar example
Think of a stock alert in a small shop. The owner writes a rule: if the number of bags of flour left falls below ten, send a message to reorder. The rule is explicit. Every part of it is visible, and changing the number ten to twelve changes the behaviour immediately. No data is needed to make the rule work.
Other everyday rules are just as clear. A password checker requires a minimum length and one number. A payroll deduction follows a fixed schedule. A delivery charge is higher for same-day orders. A ticket becomes urgent when a message contains the word urgent. Each rule is written by a person and can be read aloud.
Why rules are valuable
- Predictable: the same input always produces the same output.
- Explainable: you can point at the line that made the decision.
- Testable: you can list every branch and check it before use.
- No training data is required.
Banks, clinics and airlines still run critical work on rules for exact arithmetic, safety limits and policy. A rule is not old technology. Rules are the right tool when the decision can be stated precisely.
Where rules become painful
Some tasks resist written rules. The question of whether a message is unwanted has thousands of variations, and a person cannot list them all. Whether a photo shows a cracked bottle depends on lighting, angle and shape in ways that are hard to capture as a condition. When a programmer writes rules for such tasks, each new exception risks breaking an earlier one, and the list of conditions grows without end.
Rules are not training
This distinction matters for the rest of the course. A rule-based programme behaves as it does because a person wrote it. A machine learning model behaves as it does because training software adjusted its internal numbers after comparing many examples. When a classroom exercise asks you to write an if-then flowchart for judging messages, you are practising rule design. No model is being trained, because you are the one making every decision. Real training happens inside software, across many examples, and the person cannot read a simple list of the resulting rules.
The next lesson looks at the tasks where writing rules by hand stops being practical.
Common misconception
Machine learning is just traditional programming with more data. The computer still follows rules that a person wrote. A trained model contains no written rules for the task. Training software adjusts internal numbers using examples, and the result usually cannot be read as instructions. Traditional programming has explicit rules written by a person; machine learning does not.
Guided practice
List five decisions made during a normal day at a shop, clinic or office. For each, write a short set of if-then rules a new staff member could follow, or mark it as too many variations to write down. Then explain in two sentences why one of the marked tasks might suit machine learning. This is a paper exercise; no model is trained.
Knowledge check
Independent practice
Write a short example from your own work or daily life and decide whether it is AI, ordinary software or a mixture. Then explain why. Save it in your notes; no account is required.
Last reviewed: · Report a problem