Some rules
we write.
Others we learn.
From sorting numbers to seeing the world.
Four problems. Two ways to solve
them.

YOUR LEARNING NOTEBOOK · OPTIONALPredict. Investigate. Explain.Open before the lab. Return with evidence.
Make a prediction before you experiment. Afterward, compare it with what happened and apply the idea to a different situation.
Before the experiment
Which task needs examples: sorting numbers, recognizing footwear, or describing an unfamiliar scene? Explain what a written rule would need to know.
Try it in the lab below
Run the sorting algorithm, inspect the classifier, and compare an image description with the actual image. Identify the input, output, and source of correctness in each task.
Name one result you can check exactly and one result that needs evidence beyond a plausible answer.
A different situation
A shop needs invoice totals and a way to recognize damaged boxes. Which parts would you implement with rules, which with learned models, and how would you check each?
Compare your reasoning with an explanation
Sorting and invoice arithmetic have precise rules and exact checks. Visual recognition usually benefits from examples because a usable boundary is difficult to specify for every image. A generated description still needs comparison with the image. Learning is appropriate when its evidence and error costs justify it; it is not a requirement for every automated task.
Use this to check your reasoning against the experiment. Your written notes are not automatically graded.
Put the numbers in order, from smallest to largest.
A recipe for
the right answer.
- 1Compare two neighbors.
- 2If the left is bigger, swap them.
- 3Repeat until a full pass makes no swaps.
We wrote the rule. It works on new numbers without learning from examples.
Reflection & vocabulary
Why learn an image classifier when we can write an algorithm for sorting?
- Algorithm
- A sequence of explicit steps, such as comparing and swapping neighboring numbers.
- Features
- The numbers a model receives as inputs, such as the brightness of image pixels.
- Labels
- The desired answers in supervised learning, such as “sneaker” or “ankle boot.”
- Prediction
- A model’s output for an input. It is an estimate, not a fact.