Teachers' Portal  /  IGCSE Computer Science 0478  /  Automated and emerging technologies  /  Artificial intelligence: expert systems and machine learning
Lesson pack · IGCSE Computer Science 0478 · 6.3 · IGCSE

Artificial intelligence: expert systems and machine learning

Computers that seem to think. 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.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Automated and emerging technologies
Syllabus reference
Cambridge IGCSE Computer Science 0478, 6.3
Level
IGCSE
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 3 of 3 in Automated and emerging technologies; follows Robotics
Central model
Fig. 1: how the parts of an expert system work together
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • What is AI?: AI does not mean a computer that is conscious or truly understands.
  • 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.
  • Machine learning: In a normal program, a programmer must change the code to change what it does.
Key points to leave on the board
  • AI: the simulation of intelligent behaviours by computers.
  • Characteristics: data and rules for using it; ability to reason; can learn and adapt.
  • Expert system: knowledge base (facts), rule base (rules), inference engine (reasons), interface (questions and answers).
  • Machine learning: the program automatically adapts its own processes and/or data.
The core visual model

One picture every idea returns to

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.

the four components of an expert system User non-expert Interface questions, answers Inference engine reasons, decides Knowledge base + rule base (rules) the inference engine applies the rules to the facts to reach a conclusion
Fig. 1: how the parts of an expert system work together
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Computers that seem to think.. 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. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: What is AI?AI does not mean a computer that is conscious or truly understands. Your turn: A calculator gives the correct answer to 365 × 24 every time. Explain why it is not usually described as AI.Whole class, then pairs
13 to 21 minTeach and check: Expert systemsAn expert system gives a non-expert the advice a human expert would give, such as a doctor, a mechanic or a geologist. Model the worked example Medical diagnosis on the board, one line at a time. Your turn: Give two uses of expert systems other than medical diagnosis.Pairs
21 to 30 minTeach and check: Machine learningIn a normal program, a programmer must change the code to change what it does. Your turn: A music streaming site suggests songs. Explain how machine learning means the suggestions improve over time.Think-Pair-Share
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 17 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Machine learning, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Think-Pair-Share

Pose the question, give thirty seconds of silent thinking, then a minute to compare with a partner before a few pairs share with the class. The silent minute is the part that cannot be cut.

The full structure, with its variations and the other twelve, is on the cooperative-learning page.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
"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.
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.
"Machine learning is when a computer learns" just repeats the question.Say it automatically adapts its own processes and/or data, without being reprogrammed.
Worksheet

Artificial intelligence: expert systems and machine learning: worksheet

6 questions, 17 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[1 mark]

State what is meant by artificial intelligence.

Q2 · recall[3 marks]

Describe the main characteristics of an AI system.

Q3 · explain[4 marks]

An expert system is used to identify faults in washing machines. Identify the four components of the expert system and give the purpose of each.

Q4 · explain[5 marks]

A technician uses an expert system to find the fault in a washing machine. Describe how the expert system is used to reach a diagnosis.

Q5 · explain[2 marks]

Explain what is meant by machine learning, using an example.

Q6 · analysis[2 marks]

A bank uses software to spot fraudulent card payments. Over time it becomes better at telling unusual payments from normal ones, without a programmer changing the code. State whether this is an expert system or machine learning, and justify your answer.

Answer key and marking notes
Q1 · 1 mark

A branch of computer science dealing with the simulation of intelligent behaviours by computers.

Q2 · 3 marks
  • It has a collection of data and rules for using that data.
  • It has the ability to reason (apply the rules to the data to reach a conclusion).
  • It can include the ability to learn and adapt (change its own data or processes).
Q3 · 4 marks
  • Knowledge base: stores the facts about washing machines and their faults, gathered from experts.
  • Rule base: stores the IF ... THEN rules for using the facts, e.g. IF the drum does not turn AND the motor hums THEN the belt may be broken.
  • Inference engine: applies the rules to the facts and the user's answers to reach a diagnosis, and chooses the next question.
  • Interface: asks the user questions and displays the likely fault (and its probability / the reasoning).
Q4 · 5 marks
  • The interface asks the technician a question about the machine (e.g. does the drum turn?).
  • The technician enters an answer (e.g. yes/no) through the interface.
  • The inference engine searches the knowledge base using the rules in the rule base.
  • It uses the answers so far to decide the next question, and the questions and answers repeat.
  • The interface outputs the most likely fault, often with a probability and an explanation of the reasoning.
Q5 · 2 marks
  • A program can automatically adapt its own processes and/or data (without being reprogrammed).
  • Example: a spam filter updates itself each time a user marks an email as spam, so it blocks similar emails in future (or any valid example such as recommendations or speech recognition).
Q6 · 2 marks
  • Machine learning.
  • The software automatically adapts its own processes/data from new payment data and feedback; an expert system's rules only change when people update them.
Quiz

6 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

Which part of an expert system holds the IF ... THEN rules?

  • AThe rule base
  • BThe knowledge base
  • CThe inference engine
  • DThe interface
Q21 mark

Which of these is one of the main characteristics of AI?

  • AThe ability to reason
  • BThe ability to store more data than any other computer
  • CThe ability to process data without a program
  • DThe ability to move using actuators
Q31 mark

An expert system for diagnosing car faults shows the question "Do the headlights work?" and the conclusion "The battery is flat (85%)". Which component displays these?

  • AThe interface
  • BThe inference engine
  • CThe knowledge base
  • DThe rule base
Q41 mark

A video site recommends films. After a user watches several comedies, the program updates itself and recommends more comedies, without a programmer changing the code. What is this an example of?

  • AMachine learning
  • BAn expert system
  • CAn automated system
  • DRobotics
Q51 mark

A user answers "yes" to "Does the patient have a fever?" and "yes" to "Does the patient have a rash?". The expert system then uses the rule IF fever AND rash THEN possible measles to suggest a diagnosis. Which component carried out this reasoning?

  • AThe inference engine
  • BThe rule base
  • CThe knowledge base
  • DThe interface
Q61 mark

A bank compares two systems for spotting fraud. System A uses rules written by fraud experts. System B studies millions of past transactions and updates itself as new fraud is reported. Which statement is correct?

  • ASystem B uses machine learning and can adapt to new types of fraud automatically
  • BSystem A uses machine learning because its rules came from human experts
  • CSystem B is an expert system because it has a knowledge base of transactions
  • DBoth systems change automatically whenever a new type of fraud appears
Quiz key
Q1: A

The rule base stores the IF ... THEN rules for using the facts. The knowledge base holds the facts collected from experts. The inference engine applies the rules to the facts to reach a conclusion, but does not store them. The interface handles questions and answers with the user.

Q2: A

The main characteristics of AI are a collection of data and rules for using it, the ability to reason, and possibly the ability to learn and adapt. Storing huge amounts of data alone is not intelligence. All computers need a program. Moving with actuators is a feature of robots, not a characteristic of AI.

Q3: A

The interface lets the user interact with the system: it asks questions and displays the conclusion. The inference engine decides which question to ask and works out the conclusion, but the interface shows it. The knowledge base and rule base store facts and rules; they do not display anything.

Q4: A

The program automatically adapts its own data and processes from new data, which is machine learning. An expert system uses rules written in by people from expert knowledge and only changes if someone updates it. An automated system uses sensors, a microprocessor and actuators to control a physical process. Robotics is about the design, construction and operation of robots.

Q5: A

The inference engine applies the rules in the rule base to the facts and the user's answers to reach a conclusion, so it did the reasoning. The rule base only stores the rule. The knowledge base stores the facts. The interface collected the answers and will display the result, but does not reason.

Q6: A

System B works out patterns from data and automatically adapts its own processes and data, which is machine learning, so it can respond to new fraud patterns. System A is an expert system: its rules are written in by people, which is the opposite of machine learning. Holding data does not make System B an expert system; an expert system's rules come from human experts. System A only changes when someone updates its rule base, so 'both change automatically' is false.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonRobotics