🎯 Syllabus & Goals 3 min
Cambridge 6.3 · AI systems — expert systems Paper 1 · Computer Systems
By the end of this lesson you can:
- Name and describe the four components of an expert system: knowledge base, rule base, inference engine, user interface.
- Explain how an expert system reaches a conclusion, step by step, from a user's answers.
- Give applications, advantages and disadvantages of expert systems, and describe how one is set up.
Textbook: Chapter 6, §6.3.3 (pp. 243–246) — expert systems.
Recap / Warm-Up 5 min
AI is data plus rules, with the ability to reason and to learn. An expert system is the "data plus rules plus reasoning" part, built around one area of human expertise.
Quick starter
Think of the game where one player asks yes/no questions to guess an animal. What does the guesser need in their head to win?
Reveal the answer
Facts about many animals (a knowledge base), rules linking answers to animals (a rule base), and a way of choosing the next question and reaching a conclusion (an inference engine).
🧠 Key Concept 14 min
1 · What is an expert system?
It asks the user a series of questions. Each answer decides the next question. It then gives a conclusion, suggested actions and the probability that it is right — e.g. "the chance of oil-bearing rock at this site is about 21%". It can also explain its reasoning.
| Applications of expert systems |
|---|
| Oil and mineral prospecting · diagnosing a patient's illness · fault diagnosis in mechanical and electronic equipment · tax and financial calculations · strategy games such as chess · logistics (efficient parcel routes) · identifying plants, animals and chemical compounds |

2 · The components of an expert system
| Component | What it does (exam wording) |
|---|---|
| User interface | How the user and the system interact — dialogue boxes, command prompts. Questions usually need Yes/No answers and depend on earlier answers. |
| Inference engine | The main processing element. Acts like a search engine, examining the knowledge base for data that matches the user's answers. Chooses each question from previous responses. Uses the rules base to find a match. |
| Knowledge base | A repository of facts about one area of expertise, gathered from experts. A collection of objects and their attributes. |
| Rules base | A set of inference rules (usually IF statements) used by the inference engine to draw conclusions, following human-like logic. |
3 · Inside the knowledge base and the rules base
| Object | Class | Can fly? | Lives in water? | Covering | Legs |
|---|---|---|---|---|---|
| bat | mammal | yes | no | fur | 2 |
| cat | mammal | no | no | fur | 4 |
| dolphin | mammal | no | yes | skin | 0 |
| penguin | bird | no | yes | feathers | 2 |
| eagle | bird | yes | no | feathers | 2 |
An inference rule, written as Cambridge pseudocode (one statement per line):
Pseudocode · two rules from the rules base
IF Class = "bird" AND CanFly = "no" AND LivesInWater = "yes"
THEN
Animal ← "penguin"
ENDIF
IF Class = "mammal" AND LivesInWater = "yes"
THEN
Animal ← "dolphin"
ENDIFWorked Example 12 min
(a) The inference engine identifies an animal
The user is thinking of an animal. Watch the inference engine narrow the knowledge base down.
- Q: "Is it a mammal?" → No. Remaining: penguin, eagle.bat, cat and dolphin fail the attribute "mammal".
- The engine picks a question that splits the two: "Can it fly?" → No. Remaining: penguin.each question is based on the previous responses.
- It checks the rules base: bird AND cannot fly AND lives in water → penguin. Q: "Does it live in water?" → Yes.the rule confirms the match.
- Output: "It is a penguin", with a high probability, and the reasons.expert systems give a conclusion + probability + reasoning.
(b) A fault-diagnosis tree for a printer
- The user interface shows Yes/No questions, one at a time.interface = interaction with the user.
- The inference engine chooses each next question from the previous answer.that choice is the inference engine's job, not the interface's.
- It matches the answers against facts in the knowledge base using rules such as IF power = on AND connected AND paper AND error light THEN jam or ink.rules base + knowledge base together.
- It outputs a diagnosis, a suggested fix and a probability (e.g. 70%).three typical outputs of an expert system.
Try It Yourself 12 min
Goal: Match each description to a component: (a) a repository of facts; (b) asks Yes/No questions on screen; (c) contains the inference rules; (d) the main processing element.
Goal: Build a knowledge base of four fruits with three attributes each. Then write three inference rules as pseudocode, one statement per line.
Goal: A laptop cannot connect to the school Wi-Fi. Draw a question tree for an expert system that finds the fault. Include at least five questions and a probability on each diagnosis.
Hint
Start broad (is Wi-Fi switched on? can other devices connect?) and narrow down (password accepted? right network?). Each question must depend on the one before.
📝 Exam Practice 10 min
Name and describe the function of four components of an expert system.
Mark scheme
- Knowledge base: a repository of facts / collection of objects and attributes (1).
- Rules base: a set of inference rules (IF statements) used to draw conclusions (1).
- Inference engine: main processing part; searches the knowledge base for matches using the rules base (1).
- User interface: lets the user interact with the system, e.g. answering Yes/No questions (1).
Describe how an expert system is used to diagnose a patient's illness.
Mark scheme
- An interactive screen / user interface asks a series of questions about the symptoms (1).
- The user answers (Yes/No or multiple choice); each question depends on earlier answers (1).
- The inference engine compares the symptoms with data in the knowledge base (1).
- …using the rules base / inference rules to find a match (1).
- It outputs a diagnosis with its probability / suggested treatment / reasons (1).
Give three applications of expert systems, other than medical diagnosis.
Mark scheme
- Any three (1 each): oil / mineral prospecting · fault diagnosis in equipment · tax / financial calculations · strategy games (chess) · logistics / parcel routing · identifying plants, animals or chemicals.
Explain two advantages and two disadvantages of using an expert system instead of a human expert.
Mark scheme
- Advantage: consistent / unbiased results, as it applies the same rules every time (1).
- Advantage: very fast responses / stores vast numbers of facts / multiple areas of expertise / gives a probability (1).
- Disadvantage: only as good as the facts entered into it (1).
- Disadvantage: high set-up and maintenance cost / users need training / "cold" responses / users may wrongly assume it is infallible (1).
🗝️ Recap & Key Terms 3 min
Advantages
- High level of expertise and accuracy.
- Consistent, unbiased results.
- Stores vast numbers of facts; multiple expertise.
- Traceable, logical conclusions.
- Very fast; gives the probability of being right.
Disadvantages
- Users need considerable training.
- High set-up and maintenance costs.
- "Cold" responses — unsuitable in some medical cases.
- Only as good as the facts entered.
- Users may wrongly assume it is infallible.
Setting one up: gather facts from experts and written sources → build the knowledge base → build the rules base → set up the inference engine → develop the user interface → test with cases whose answers are known.
- Expert system
- A form of AI developed to mimic a human's knowledge and expertise.
- Knowledge base
- A repository of facts, which is a collection of objects and their attributes.
- Rules base
- A collection of inference rules used to draw conclusions.
- Inference engine
- A kind of search engine that examines the knowledge base for information matching the queries.
- Inference rules
- Rules, using IF statements, used by the inference engine to draw conclusions.
- User interface
- The means by which the user and the expert system communicate.
Homework 1 min
Task (≤ 15 min): A garden centre wants an expert system that identifies plant diseases. Describe how the system would be set up. [5]
Model answer
- Information is gathered from human experts (plant scientists) and written sources (1).
- The knowledge base is created and filled with facts: diseases (objects) and symptoms (attributes) (1).
- A rules base of inference rules (IF … THEN) is created (1).
- The inference engine is set up to use the rules to search the knowledge base (1).
- A user interface is developed, then the system is tested with known cases and corrected (1).