VisualAI
Chapter 1 · Foundations

What is AI?

You won't program the rules. You'll show examples — and watch a machine find the rule itself.

6 minLesson 1 of 23

For seventy years, making a computer do something meant writing down the exact rules. AI is the moment we stopped writing rules — and started showing examples instead.

Think about how you'd teach a computer to recognise a cat. You could try writing rules: has pointy ears, has whiskers, has fur… But a dog has those too. A cat curled up in a ball has no visible ears at all. The rules pile up, contradict each other, and still miss a thousand cases.

Now imagine a different approach. You don't write a single rule. You just show the computer thousands of pictures labelled cat or not cat, and let it work out the pattern on its own. That's the whole idea of AI.Let's do exactly that — in miniature.

Teach the Machine

Click the canvas to add examples

Click to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this exampleClick to remove this example
Mystery point →Class B(67%)

Click empty space to drop a Class A example · drag the ringed dot to test · click a dot to delete it

Placing examples

Neighbors to ask (k)3
Class A7
Class B7
You're not programming a boundary. You're giving examples — and the machine fills in the rest.
Try this

Drop a few Class A dots in one corner and Class Bdots in another. Watch the background bloom into two coloured territories — that's the machine's guess for every point it hasn't seen. Now drag the ringed mystery dot around and watch its prediction flip. Then hit New example set → Island: a straight line could never split those, yet examples handle it easily.

What just happened?

You never wrote “if the dot is in the bottom-left, call it Class A.” You placed examples, and to classify the mystery dot the machine simply asked: which of my known examples are closest?The closest ones vote. That's a real algorithm called k-Nearest Neighbours, and the slider labelled k sets how many neighbours get a vote.

Two pieces of vocabulary you'll meet everywhere from here on. The dots you placed are the training data. The thing that turns a new input into a prediction — the coloured map — is the model.

Key idea

Traditional software: a human writes the rules, the computer follows them. AI flips it: the human provides examples, and the computer writes the rule. Change the examples and the rule changes — no reprogramming required.

This also explains AI's biggest weakness. The model only knows what its examples taught it. Feed it lopsided or biased examples and it will confidently learn the wrong pattern. Garbage in, garbage out — but learned, not coded.

The payoff

Every AI you've heard of — spam filters, face unlock, ChatGPT — is this one idea scaled up enormously: collect examples, find the pattern, predict the next case. The only real question left is what those examples are actually made of.Spoiler: it's numbers. That's the next lesson.