B2 · How Artificial Intelligence Works: Data and Learning

Rule-Based Systems and Learning Systems

Rule-based systems follow instructions that people write by hand. Learning systems work out their own rules from examples. Rules are exact and explainable, and learning handles messy cases that are too hard to describe.

10 min Beginner Jump to the activity

What you need: Nothing. This page starts from the beginning, with no programming and no formulas.

Definition

Rule-based systems follow instructions that people write by hand. Learning systems work out their own rules from examples. Rules are exact and explainable, and learning handles messy cases that are too hard to describe.

In simple words

You can write a rule for income tax, because the law states it. You can't write a rule for "is this a photo of a cat?". Try it: pointy ears? Some dogs have them too. For cats you show examples and let the machine learn.

Why it matters

Choosing wrongly wastes months. Teams build ML for what a simple rule could do, or write thousands of rules for what only learning can handle.

How it works

RulesLearning
Best whenThe logic is clear and stablePatterns are complex or change often
NeedsAn expert's knowledgeLots of good examples
Can explain itself?YesOften not fully
When the world changesSomeone rewrites the rulesRetrain on new data
ExampleGST calculationVoice typing

Try it yourself

Rules against learning: a live race

Show the answer for each message, and watch the scores. The rule was written once. The learner keeps learning.

Write rules for a spam filter, then watch them fail

Your rule is: "If a message contains the word FREE, it is spam." Does the rule get each message right?

  • "You've won ₹50,000. Send your bank details." (spam)

  • "Free delivery on your order today" from your real shop (not spam)

  • "FR33 gift card, claim now" (spam)

  • "Are you free for lunch on Sunday?" (not spam)

  • "WIN a FREE phone! Click now!" (spam)

Common mistakes

  • Using ML where a five-line rule would do.
  • Adding rule after rule to catch new cases, until nobody understands the system.

Check yourself

Question 1

1. Calculating GST on a bill suits:

Question 2

2. Recognising handwritten digits suits:

Summary

  • Use rules when the logic is clear and stable.
  • Use learning when patterns are too complex to write down.
  • Many real systems combine both.

Finished reading?