Course Content
Introduction to AI
4 sections · 10 lessons
What is Artificial Intelligence?
Before you read another word, consider what has already happened to you today without your noticing.
Your email app quietly moved three messages into spam. Your phone finished a sentence you were typing before you got to the end of it. A map app told you to take a different road than usual, and it was right — there was traffic. A bank sent you a text asking whether a payment was really yours.
Every one of those was artificial intelligence. None of them looked like it. There was no robot, no glowing interface, nothing that announced itself. And that gap — between what people picture when they hear "AI" and what AI actually is in daily life — is the first thing worth fixing, because almost every misunderstanding that follows grows out of it.
By the end of this lesson you will be able to define AI precisely, explain the one mechanism that separates it from ordinary software, name the four steps every AI system runs through, and correctly place terms like machine learning and generative AI in relation to one another. More importantly, you will be able to look at any product and work out what is going on inside it.
Start with a problem no rulebook can solve
Forget definitions for a moment. Let us try to solve a real problem the old-fashioned way and watch it fail. That failure is the whole reason AI exists.
The task: write a program that looks at a photograph and says whether there is a cat in it.
You are a good programmer. You start writing rules.
"A cat has pointy ears." Fine — but so does a fox, and so does a cat-shaped cushion. Also, what if the cat is facing away from the camera? What if only its tail is visible in the corner of the frame?
"A cat has fur." So does a dog, a rug, and a coat. And in a blurry night-time photo, fur is just a grey smudge.
"A cat has whiskers." In a photo taken from ten feet away, whiskers are two or three pixels wide and often invisible entirely.
Keep going and it gets worse. Cats can be black, white, ginger, striped, spotted. They can be sitting, jumping, curled into a shape that looks nothing like a cat. They can be half-hidden behind a chair. The photo can be overexposed, underexposed, taken through a window, taken on a phone from 2009.
Here is the honest conclusion: you cannot write down the rules for recognising a cat. Not because you are not clever enough. Because nobody can. You recognise cats instantly and effortlessly, and yet if someone asked you to write out the complete instructions, you would fail. The knowledge is real, but it is not stored in your head as a list of rules.
And yet a three-year-old, shown a few dozen cats, can then identify a cat they have never seen before — a breed they do not know, in a pose they have never encountered, in bad lighting. They were never given rules either. They were given examples.
That is the entire idea behind artificial intelligence, in one sentence: when you cannot write the rules, provide examples instead, and let the system work the rules out for itself.
The definition
Now the formal version, which will make sense because you have felt the problem it solves:
Artificial intelligence is software that performs tasks normally requiring human judgement, by learning patterns from data rather than following instructions written by a person.
Two phrases in that sentence carry all the weight. Let us take them one at a time, slowly, because getting these right will save you a lot of confusion later.
"Tasks normally requiring human judgement"
This phrase draws the line around what AI is for.
Calculating 847 × 293 does not require judgement. There is exactly one correct answer, a known procedure produces it, and a calculator from 1975 does it perfectly. Building an AI for this would be absurd.
Deciding whether a customer review is angry or merely disappointed does require judgement. Two people might reasonably disagree. The answer depends on tone, on context, on what the reader knows about how people write. There is no procedure to follow.
Here is a useful test. Ask yourself: could I write down complete instructions that a stranger could follow to get this right every time?
- Yes → this is a job for ordinary software. Sorting a list, calculating tax, checking whether a password matches.
- No, but I can recognise the right answer when I see it → this is a job for AI. Is this photo a cat? Is this email spam? Is this transaction fraudulent? Does this sentence sound angry?
That second category — I know it when I see it, but I cannot explain the rule — is precisely where AI earns its place.
"Learning patterns from data rather than following instructions"
This phrase describes the mechanism, and it is the part people skip.
In ordinary software, a human decides the logic and writes it down. The program is a faithful record of somebody's thinking. If it makes a mistake, a human made that mistake first, and you can find it by reading the code.
In AI, a human decides the goal and supplies examples. The system works out its own internal logic by finding statistical regularities across those examples. Nobody wrote that logic. Often nobody can fully read it back afterwards.
This is a genuine trade, and it is worth being clear-eyed about both sides:
- What you gain: the ability to solve problems that have no writable rules. This is enormous. It is why photo search, voice assistants, translation and fraud detection exist at all.
- What you give up: certainty and transparency. The system will sometimes be wrong, and explaining exactly why it was wrong can be genuinely difficult.
Watching the difference in code
Abstract descriptions only get you so far. Let us solve the same problem — filtering spam email — both ways, and watch what happens over time.
The rule-based attempt
Day one, this looks perfectly reasonable:
1def is_spam(email):2 body = email.body.lower()34 if "free money" in body:5 return True6 if "you have won" in body:7 return True8 if email.subject.count("!") > 3:9 return True10 if email.sender in known_spammers:11 return True1213 return FalseIt catches the obvious cases. You ship it. Then reality arrives.
A spammer writes fr33 m0ney. Your check for "free money" does not fire. So you add a rule for that spelling. The next week it is f r e e m o n e y. Another rule. Then FREE M0NEY with a zero and mixed case. Another rule.
Meanwhile a genuine problem appears from the other direction. A colleague emails about a free trial of some software, and your filter eats it. So you add an exception. Now you have a rule and a counter-rule, and you must be careful about the order they run in.
Six months later there are four thousand rules. Nobody understands all of them. Changing one breaks two others. Every new spam campaign means an emergency code change and a deployment. The system is not stupid — it is just fighting a problem it structurally cannot win, because the number of ways to write "free money" is effectively unlimited, and you are trying to enumerate them by hand.
The machine learning attempt
Now the same problem, approached differently:
1# Step 1: gather examples. Each email has a label a human assigned.2emails = [email_1, email_2, email_3, ...] # 50,000 real messages3labels = ["spam", "not spam", "spam", ...] # what each one actually was45# Step 2: let the system find the patterns itself.6model.train(emails, labels)78# Step 3: use it on something it has never seen.9model.predict(new_email) # -> 0.94Look closely at what is missing. There is no list of suspicious words anywhere in this code. Nobody typed "free money". Nobody typed anything about exclamation marks.
So how does it know? During training, the system compared fifty thousand messages against their labels and measured which patterns tend to accompany which outcome. It may have noticed that certain phrases appear far more often in the spam pile. It may have noticed that spam is more likely to arrive at 3am, more likely to contain a link whose visible text does not match its destination, more likely to address you as "Dear Customer". It found hundreds of such signals, weighted each by how reliable it turned out to be, and combined them.
Some of those signals no human would have thought to write down. That is the point.
And when spammers change tactics? You do not rewrite logic. You feed the system more recent examples and retrain. The code stays the same; the knowledge updates.
What that 0.94 actually means
This deserves its own moment, because misreading it causes real harm in real products.
model.predict() returned 0.94. That is not "this is spam". It is "of the messages that look like this one, roughly 94 out of 100 turned out to be spam".
Which means, quietly: about 6 out of 100 are not. If your product treats 0.94 as a fact and silently deletes the message, then six times in every hundred you have destroyed somebody's real email.
This is why well-built AI products almost never act on a prediction alone. They set a threshold, they route uncertain cases to a person, and they give the user a way to correct the system. A spam filter puts messages in a folder you can check — it does not delete them. Hold on to this idea; it separates thoughtful AI products from careless ones.
The two approaches side by side
| Traditional software | Artificial intelligence | |
|---|---|---|
| Who writes the logic | A programmer, by hand | The system, from examples |
| What a human supplies | The rules | The data, and the correct answers |
| Output | The same answer every time | A best guess, with a confidence |
| Can you read why? | Yes — read the code | Often not directly |
| Typical failure | A bug in the logic | Input unlike anything in training |
| How you improve it | Change the code | Change the data, retrain |
| Good fit for | Problems with writable rules | Problems you recognise but cannot specify |
One warning before we move on. AI is not an upgrade to traditional software — it is a different tool for a different job. If your problem has clear rules, writing those rules is faster, cheaper, more reliable and easier to debug. Reaching for AI where a simple condition would do is one of the most common and most expensive mistakes in the industry.
The four steps inside every AI system
Whatever you are looking at — a recommendation feed, a self-driving car, a chatbot, a fraud detector — the same loop is running underneath. Learn it once and you can take apart any AI product you meet.
Step 1 — Perceive
The system takes in information: a photo, a sentence, a sensor reading, a database row, a click.
Everything the system will ever know comes through this step, which makes it more important than it looks. A model can only reason about what it perceives. If your camera cannot see in the dark, no amount of clever processing downstream will recover what was never captured. If your training data contains only daytime photos, the system has no idea what night looks like.
There is a phrase you will hear constantly, and it belongs here: garbage in, garbage out. The quality of what enters at step one sets a hard ceiling on everything that follows.
Step 2 — Reason
The system compares what it perceived against the patterns it learned, and produces a judgement.
"This image is 91% likely to contain a stop sign." "This sentence is probably a refund request." "This transaction scores 0.02 for fraud."
Notice the shape of these outputs. They are not statements of fact; they are degrees of belief. That is not a weakness or a temporary limitation — it is the honest form of the answer, because the system is reasoning from patterns, and patterns have exceptions.
Step 3 — Act
The system does something with its judgement. Apply the brakes. File the message. Show these five products instead of those five. Flag the payment for review.
This step is where design decisions matter enormously, and where AI ethics stops being abstract. The same prediction can be acted on gently or harshly. A fraud score of 0.7 could trigger a text asking you to confirm, or it could freeze your account on a Friday evening. Same model, same number, completely different experience for a real person.
Step 4 — Learn
The system uses what happened to improve. The user ignored all five recommendations — signal. The flagged payment turned out to be genuine and the customer complained — signal. The email you rescued from spam — signal.
Not every system does this, and it is worth knowing which kind you are dealing with. A recommendation feed often learns continuously, adjusting within hours. A medical imaging model usually does not learn automatically — it is retrained deliberately, tested carefully and re-approved, because silent changes to a system that affects diagnoses would be dangerous.
Practising the loop
Take a music streaming app and trace it through:
| Step | What happens |
|---|---|
| Perceive | What you played, skipped, saved, replayed; time of day; device |
| Reason | Score thousands of tracks for how likely you are to enjoy each right now |
| Act | Build a playlist from the highest-scoring tracks |
| Learn | You skipped track three after eight seconds — lower that kind of track for you |
Try this yourself with an app you use daily. It is the fastest way to build real intuition, and it works on essentially every AI product in existence.
Sorting out the vocabulary
"AI", "machine learning", "deep learning" and "generative AI" are used interchangeably in casual conversation and in a great deal of marketing. They are not the same thing. They sit inside one another, like nested boxes.
| Term | What it covers | Example |
|---|---|---|
| Artificial intelligence | The whole field — any software doing judgement-like tasks | A thermostat that learns your schedule |
| Machine learning | The part of AI that learns from data instead of hand-written rules | Spam filtering, credit scoring |
| Deep learning | The part of ML using many-layered neural networks | Face unlock, speech recognition |
| Generative AI | Deep learning that creates new content instead of picking a label | Writing an email, generating an image |
Read that as four circles, each inside the last:
- Every generative AI system is deep learning.
- Every deep learning system is machine learning.
- Every machine learning system is AI.
The reverse is not true, and this is where nearly everyone slips. A chess program from 1985 that searched moves using rules a grandmaster wrote is genuinely AI — it plays a game requiring judgement — but it is not machine learning, because it never learned anything. It knew what it was told, and nothing more.
Two quick tests. Was it built by showing it examples? Then it is machine learning. Does it produce new text, images, audio or code, rather than choosing from a fixed set of answers? Then it is generative AI.
Why does this pedantry matter? Because "AI-powered" on a product page tells you almost nothing. It could mean a large language model, or it could mean an if statement somebody felt optimistic about. Knowing the vocabulary lets you ask the question that actually matters: what kind, trained on what?
The AI you have already used this week
Concrete examples beat definitions. Every one of these is running on your devices right now.
- Your keyboard's next-word suggestions. A model trained on enormous amounts of text, then adapted to how you personally write. This is why it eventually learns your friends' names.
- Navigation and route timing. The suggested route is not simply the shortest path — it is a prediction of travel time, built from live traffic plus years of history about this road at this hour on this day.
- Face unlock. A neural network turns your face into a list of numbers, then checks how close today's numbers are to the ones stored when you set it up. Your actual face is never stored as a photo.
- Streaming and shopping feeds. Ranking models score thousands of candidates against the behaviour of people similar to you, and show you the top handful.
- Fraud alerts. A model that has seen millions of transactions notices that this one does not fit your pattern — wrong country, wrong hour, wrong amount.
- Spam and phishing filters. The system from earlier, quietly processing every message before you ever see it.
- Photo search. Type "beach" into your gallery and it finds beach photos you never tagged. A vision model labelled them silently, months ago.
Notice how unglamorous this list is. Real AI is mostly invisible plumbing that makes ordinary things work slightly better. The talking-robot image is entertainment, not engineering.
Five misconceptions worth dismantling
"AI understands what it is doing"
It does not, in the way you mean by "understand".
A model that labels photographs has no concept of a cat. No sense of a small animal that purrs, scratches furniture, and belongs to your neighbour. What it has is a mathematical function mapping certain pixel arrangements to the output "cat".
This is not philosophical hair-splitting — it has practical consequences. Because there is no underlying concept, you can sometimes change an image in ways a person would barely register and flip the answer entirely. The system was never reasoning about cats. It was reasoning about patterns that happen to correlate with cats.
"If it is maths, it must be right"
We covered this with the 0.94, and it is worth repeating because it is the single most consequential misunderstanding in the field.
AI output is a probability. Probabilities are wrong a predictable fraction of the time — that is what they mean. A system that is 95% accurate is wrong once in every twenty attempts. At a million decisions a day, that is fifty thousand mistakes. Any product built as though the model is always right will eventually harm someone: a declined loan, a frozen account, a missed diagnosis.
"More data always makes it better"
More relevant, accurate, varied data helps. More of the wrong data actively hurts.
A model trained on a million daylight photographs will still fail at night — and another million daylight photographs will not fix it. What it needs is night photographs. Similarly, if your labels are sloppy, more sloppy labels teach the system to be confidently wrong on a larger scale. Data quality and data variety beat raw quantity, consistently.
"AI is going to replace all jobs shortly"
What actually happens is narrower and more interesting: AI takes over specific tasks inside jobs, and the job reorganises around what remains.
A radiologist's work includes spotting anomalies on a scan — a model genuinely helps there. But it also includes correlating findings with patient history, deciding what to investigate next, explaining frightening news to a person in a difficult moment, and being professionally accountable for the call. The task changed; the role shifted rather than vanished.
The useful question is never "will AI replace this job?" It is "which tasks in this job are pattern-matching, and which need context, accountability, or human contact?"
"AI is objective because it removes human bias"
This one is backwards, and it causes real damage.
A model learns from data, and that data records human decisions with all their historical bias intact. Train a hiring model on ten years of a company's decisions and it learns to reproduce those decisions — including any patterns of unfairness. The bias is not removed; it is encoded, scaled up, and given a veneer of mathematical neutrality, which makes it considerably harder to challenge.
What stays human
Three things no model supplies, regardless of size.
Context it was never shown. A model trained on data up to last year does not know what changed last week. It cannot know the factory closed, the regulation changed, or this particular customer has been on the phone for an hour already. Someone has to bring that in.
Accountability. When an automated decision harms someone, "the model decided" satisfies no regulator, no court, and no customer. Responsibility does not transfer to software. A person owns the outcome, which means a person must be able to review and override it.
Choosing what is worth optimising. A model will relentlessly pursue whatever target you set. Optimise a feed for time spent and you may well get it — along with consequences nobody wanted. Deciding what to optimise is a human judgement with real stakes, and no model can make it for you.
Check your understanding
0 of 3 answered
1.Which of these tasks is a better fit for AI than for ordinary hand-written software?
2.A spam model scores an incoming email at 0.94. What should a well-built email product do with it?
3.A 1985 chess program chooses moves using scoring rules a grandmaster wrote. Where does it belong?