A timer does exactly what you set it to do. A fruit-sorting machine has a different problem: the next apple will not look exactly like the last one. A bruise moves. The light changes. Someone puts a pear in the bowl.
How could we tell a computer what to do without writing a separate instruction for every fruit?
Start with a rule
A programmed rule is an instruction a person writes for a computer to follow. If the timer reaches zero, ring the bell. The computer does not need to learn that rule from photographs of timers.
We can write rules for fruit too: put every red object in this basket. It works until a red pepper arrives or a green apple needs sorting. The rule is doing what we asked. Our description of the task was too simple.
Rules remain useful. A cafe should calculate a bill with arithmetic, not ask a language model to guess the total. Using AI somewhere in an application does not mean replacing all its ordinary code.
Let examples change the sorter
Machine learning is a way to build a model by adjusting it using examples. Instead of spelling out every visible detail of an apple, we provide examples and a learning procedure. The procedure changes the model so its answers better match the task.
Imagine trying several sorting boundaries on a drawing of fruit. Move the boundary, count the mistakes, and adjust it again. That is a small picture of learning from data. Real methods use different ways to make those adjustments, and some never draw a boundary at all.
A pattern is a relationship that recurs in examples. Roundness might help distinguish one kind of fruit from another. But the machine might also notice the background cloth. If every apple was photographed on a blue cloth, it could learn the wrong shortcut.
Learning means a useful mathematical change, not a machine having a childhood or deciding what fruit means.
Where AI fits
Artificial intelligence, or AI, is a broad field concerned with making computers perform tasks such as recognizing patterns, using language, or planning actions. Some approaches use human-written rules. Others learn from data.
Think of AI as a shelf label, not a particular appliance. Machine learning belongs on that shelf, but the shelf holds other approaches too. A program can combine them.
Deep learning is a kind of machine learning that uses neural networks with multiple processing layers. Each layer changes a numerical representation before passing it onward. We will build the idea of a layer in chapter 5. For now, keep the nesting: deep learning is part of machine learning, which is part of AI.
These are overlapping families of methods, not three inventions that took turns making the previous one useless.
A small question, not a magic machine
Our first task will be simple: estimate how long a fictional cafe takes to prepare an order. We will use made-up examples so we can see every number. Later, the cafe will gain a recipe assistant. We will separate what it can say from what it is allowed to do.
This guide is a core map, not an encyclopedia of AI. The path covers learning, neural networks, language models, retrieval, tools, agents, harnesses, evaluation, and operation. It leaves robotics, advanced mathematics, and specialist research branches for another day. You need curiosity and ordinary arithmetic, not coding experience.
A tiny observation: which task needs learning?
A timer ringing at zero can use a rule. Recognizing fruit in varied photographs might benefit from learning. A cafe can use both in the same application. Choosing the simplest suitable method is part of the work.