AI Foundations for Students | 002. Rules, Data and Learning
AI Foundations for Students · Lesson 02 of 36
Module 1: Understanding AI
In this lesson
Learning goal: Compare hand-written rules with patterns learned from examples.
Two ways to build a sorter
Imagine a box of fictional recycling cards. Each card has a material label, such as paper or metal, and a clean-or-dirty label. A rule-based sorter follows instructions written by a person: if the material is paper and it is clean, place the card in tray A; otherwise place it in tray B. The instruction can be inspected directly. It may still be wrong if the local recycling rules differ, so the designer must define the setting.
A machine-learning approach uses examples to adjust a model. Instead of writing every decision rule, a developer provides data and a learning procedure. The resulting model uses patterns to produce an output for a new input. This does not mean the computer learns in every way a person does. The process depends on what was measured, which examples were available and what counted as a successful answer.
Patterns are not explanations by themselves
Suppose all the paper cards in a tiny training set happen to be blue and all the metal cards happen to be red. A model might use color because it helps fit those examples. Yet blue metal and red paper are possible. The accidental connection is not a sensible basis for material sorting. More data can help, but only if it includes relevant variety rather than many copies of the same mistake.
We must distinguish a pattern in the sample from a reason the pattern should remain useful. A bus may arrive late on three rainy mornings, but this tiny observation does not prove that rain is its only cause of delay. Timetables, traffic and recording errors could also matter. Careful model builders ask whether the information will be available and appropriate when the system is used.
Training and using are different activities
Training changes a model using examples and a chosen learning procedure. Using a trained model to produce an output for an input is often called inference. A classroom analogy is preparing a sorting rule from practice cards and then applying that rule to a new card. The analogy is limited: people understand and learn in ways this simple activity does not capture.
Do not assume that typing one correction into any AI tool instantly retrains its underlying model for everyone. Some systems use conversation context, some store preferences, and some have other update processes. Those are different mechanisms. A product’s current documentation would be needed to describe its actual behavior. Our paper model has a clear rule: changes happen only when the class explicitly revises the card-sorting method.
Choose rules when rules are enough
Machine learning is not automatically better than a short, accurate rule. If a library charges no fees and loans every book for fourteen days, a simple date rule can be easier to check than a prediction model. If the task is recognizing varied handwriting, writing every possible appearance rule may be difficult, and learning from examples becomes more attractive.
Both approaches need testing. A rule can mishandle an empty input; a learned model can fail on unfamiliar cases. A complete system may combine them. For example, a model proposes a category, while a fixed rule sends uncertain or missing inputs to a person. Human review is useful only if the reviewer receives enough information and has time to act. An approval button alone does not make a system reliable.
Worked practice
Worked exercise 1: Run an explicit rule
Task: Tray A accepts cards marked paper and clean. Sort these cards: clean paper, dirty paper, clean metal.
Worked solution: Clean paper satisfies both conditions, so it goes in A. Dirty paper fails the cleanliness condition and goes in B. Clean metal fails the material condition and also goes in B. We can explain each decision by tracing the stated conditions. This activity is a fictional classification exercise, not advice about real local recycling rules.
Worked exercise 2: Expose an accidental pattern
Task: A practice set has blue paper, blue paper, red metal and red metal. A learner predicts blue means paper. Give a new test that could reveal the weakness.
Worked solution: Use a blue metal card and a red paper card with materials clearly labeled. The color shortcut predicts both incorrectly. Keep these challenge cards separate from the original examples while first testing the rule. The mistake tells us the original sample could not distinguish a useful material pattern from an accidental color pattern.
Worked exercise 3: Identify the update
Task: A group applies an unchanged rule to six new cards, then changes the rule after inspecting errors. Which part resembles inference and which resembles training?
Worked solution: Applying the unchanged rule resembles inference: it produces outputs without changing the method. Revising the method based on examples resembles training. This is a simplified paper analogy, not a claim that a hand-written update is the same algorithm as a modern learning system. Recording the change makes comparisons possible.
Check your understanding
MCQ 1: A rule-based sorter primarily follows what?
- Explicit instructions written by people
- Patterns adjusted automatically from labeled examples
- The most common label in its training examples
- A new decision method learned from every card it sees
Check the answer and explanation
Answer: A. A rule is stated directly, although its design can still contain mistakes or bias.
MCQ 2: What is training in the paper analogy?
- Applying an unchanged method
- Adjusting the method from examples
- Scoring outputs while leaving the method unchanged
- Sorting a new card with the saved method
Check the answer and explanation
Answer: B. Training concerns learning or adjustment; using the resulting method is inference.
MCQ 3: Why is color a weak material shortcut here?
- The sample contains too few different colors, so repeating it would solve the problem
- Color is always a better predictor than the material label
- The sample contains an accidental color-material link
- A shortcut that fits every training card must work on future cards
Check the answer and explanation
Answer: C. New combinations can break the shortcut, revealing poor generalization.
MCQ 4: When is a simple rule a sensible starting point?
- When the requirement is explicit and easily checked
- When the task requires recognizing many unfamiliar forms without explicit criteria
- When a polished output matters more than whether the rule meets the requirement
- When the desired result cannot yet be described or checked
Check the answer and explanation
Answer: A. A transparent rule may solve a well-defined problem with less complexity.
MCQ 5: Does one correction necessarily retrain every AI service immediately?
- Yes; correcting the current response always changes the underlying model
- Yes; remembering a preference is the same as retraining for everyone
- Yes; any change in a later answer proves a model-wide update
- No; behavior depends on the system
Check the answer and explanation
Answer: D. Context use, storage and model training are distinct and must not be assumed equivalent.
Sources and further reading
- Google: What is Machine Learning?: Definitions of machine learning, models, classification and generation. Verified 11 October 2026.