A program that diagnoses a car fault like a mechanic, an email filter that gets better at spotting spam the more you use it: both simulate intelligent behaviour. Learn what AI means, its main characteristics, and how the two kinds in your syllabus, expert systems and machine learning, actually work.
Artificial intelligence (AI) is a branch of computer science dealing with the simulation of intelligent behaviours by computers. Its main characteristics are: a collection of data and rules for using that data; the ability to reason (apply the rules to reach conclusions); and it can include the ability to learn and adapt. At IGCSE you study two kinds: expert systems, which have a knowledge base, rule base, inference engine and interface; and machine learning, where a program can automatically adapt its own processes and/or data.
Fig. 1: how the parts of an expert system work together
Section 01
What is AI?
AI does not mean a computer that is conscious or truly understands. It means a computer that behaves as if it were intelligent: it uses data and rules to make decisions a person would normally make.
Characteristic
What it means
Example
Collection of data and rules for using it
The system stores facts and the rules that link them
"IF temperature > 38 °C THEN patient has a fever"
Ability to reason
It applies the rules to the data to reach a conclusion or make a decision
fever AND rash → suggests a possible illness
Can learn and adapt
It changes its own data or processes based on new data or feedback, so it improves over time
a spam filter that gets better as users mark emails as spam
Everyday AI: voice assistants, chatbots, recommendations on streaming and shopping sites, face recognition, game opponents, route planning.
Your turn
A calculator gives the correct answer to 365 × 24 every time. Explain why it is not usually described as AI.
It follows a fixed calculation and is not simulating intelligent behaviour: it does not use a collection of data and rules to reason towards a decision, and it does not learn or adapt.
Examiner trap
"AI is when a computer thinks like a human" is too vague for marks. Use the syllabus words: simulates intelligent behaviour, using data and rules, the ability to reason, and possibly to learn and adapt.
Section 02
Expert systems.
An expert system gives a non-expert the advice a human expert would give, such as a doctor, a mechanic or a geologist. It has four components (Fig. 1).
Knowledge base: a database of facts about the subject, collected from human experts.
Rule base: a set of rules, usually IF ... THEN rules, for using the facts, e.g. IF the engine will not start AND the lights are dim THEN the battery is flat.
Inference engine: the part that reasons. It applies the rules in the rule base to the facts in the knowledge base and to the user's answers, to reach a conclusion. It also decides which question to ask next.
Interface: lets the user interact with the system. It asks the user questions (often yes/no or multiple choice) and displays the conclusion, often with a probability and an explanation of the reasoning.
Worked example Medical diagnosis
Describe how an expert system helps a doctor diagnose an illness.
The interface asks the doctor questions about the patient's symptoms, e.g. "Does the patient have a temperature above 38 °C?"
The doctor enters the answers through the interface.
The inference engine compares the answers with the facts in the knowledge base, using the rules in the rule base.
It chooses the next question based on the answers so far, narrowing down the possible illnesses.
The interface displays the most likely diagnosis (often with a percentage probability) and an explanation of how it was reached.
Answer: interface → inference engine + rule base + knowledge base → conclusion
Your turn
Give two uses of expert systems other than medical diagnosis.
Any two: diagnosing car engine faults; mineral or oil prospecting (where to drill); financial decisions such as approving loans or spotting fraud; plant or animal identification; playing chess.
Examiner trap
Do not mix up the knowledge base and the rule base. The knowledge base holds the facts; the rule base holds the rules; the inference engine uses the rules on the facts.
Stage 1 · Learn
Check what the sim just showed you
Four quick checks. Each correct answer earns XP and records this skill on your profile.
Quick check+10 XP
Which is the best description of artificial intelligence?
Quick check+10 XP
Which component of an expert system applies the rules to the facts to reach a conclusion?
Quick check+10 XP
What does the knowledge base of an expert system contain?
Quick check+10 XP
Which describes machine learning?
Section 03
Machine learning.
In a normal program, a programmer must change the code to change what it does. A machine learning program can automatically adapt its own processes and/or data, so it improves with experience.
Fig. 2: a machine learning program improves each time round the loop
Training data: the program is given a large amount of data, e.g. thousands of emails already labelled spam or not spam, and finds patterns in it.
Decisions: it uses the patterns to make predictions or decisions about new data.
Adapting: when it gets new data or feedback (e.g. a user moves an email to the spam folder), it automatically updates its own data and processes, without a programmer rewriting it.
Examples: spam filters, recommendations on video and shopping sites, speech and handwriting recognition, face recognition, fraud detection on bank cards, game opponents that improve.
Expert system
Machine learning
Where the rules come from
written in by people from expert knowledge
worked out by the program from data
Changes over time?
only if someone updates the knowledge or rule base
adapts itself automatically with new data
Your turn
A music streaming site suggests songs. Explain how machine learning means the suggestions improve over time.
The program collects data on what the user plays, skips and likes. It finds patterns and recommends similar songs. Every new play or skip is new data, so it automatically adapts its own data and processes, and its suggestions match the user's taste better without a programmer changing the code.
Examiner trap
"Machine learning is when a computer learns" just repeats the question. Say it automatically adapts its own processes and/or data, without being reprogrammed.
Stage 2 · Exam
Exam-style questions
Unlocks once the four checks above are done. Worth more XP, written to IGCSE Paper 1 standard.
Finish the four checks above to unlock the exam questions
Exam style+20 XP
An expert system asks a user "Is the engine making a clicking noise?" Which component displays this question?
Exam style+20 XP
Which is a main characteristic of AI listed in the syllabus?
Exam style+20 XP
An email filter wrongly lets a spam email through. The user marks it as spam, and similar emails are blocked in future. What does this show?
Exam style+20 XP
Which is an example of an IF ... THEN rule that would be stored in the rule base of a medical expert system?
Skill unlocked
Artificial intelligence, mastered.
This skill is now recorded on your profile. Keep the chain going.