Year 11 · Computer Science · Autumn 2 – mid-December

Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Artificial intelligence and expert systems

Theory6.3 Artificial intelligence (AI)

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

You will learn to

  • Explain what artificial intelligence (AI) is.
  • Describe the main characteristics of AI: data and rules, reasoning, and learning and adapting.
  • Describe the four parts of an expert system and how they work together.
  • Explain what machine learning is, with one example and one limit.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Success criteria

You have got it when you can say:

  • I can draw and label the knowledge base, rule base, inference engine and interface.
  • I can describe what the inference engine does with the rules and the facts.
  • I can explain how machine learning is different from following fixed rules.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last lesson

    Which memory is volatile?

    A An SSDB RAMC ROM

    B. RAM

  2. Last unit

    DNS…

    A Turns a domain name into an IP addressB Stores cookiesC Encrypts the page

    A. Turns a domain name into an IP address

  3. Earlier this year

    The bootloader…

    A Translates PythonB Loads the operating system from storage into RAM at start-upC Prints documents

    B. Loads the operating system from storage into RAM at start-up

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Key words (1 of 2)

Set value
The target value stored in the system that sensor readings are compared with.
Artificial intelligence (AI)
The simulation of intelligent behaviour by a computer.
Expert system
An AI system that uses facts and rules to give expert-like advice in one subject.
Knowledge base
The part of an expert system that stores facts about the subject.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Key words (2 of 2)

Rule base
The part of an expert system that stores IF … THEN rules for using the facts.
Inference engine
The part of an expert system that applies the rules to the facts to reach a conclusion.
Interface
The part of an expert system that asks the user questions and shows conclusions and reasons.
Machine learning
AI in which the program adapts its own processes or data by learning from examples.

The explanation · step 1 of 4 · part 1 of 3

What AI is and its characteristics

Artificial intelligence (AI) is a branch of computer science that deals with the simulation of intelligent behaviour by computers. The computer behaves in a way we would call clever if a person did it.

AI has three main characteristics.

1. The collection of data and the rules for using that data. The system stores facts and rules about how to use them.

2. The ability to reason. It can use its rules and data to reach a conclusion or make a decision.

The explanation · step 1 of 4 · part 2 of 3

What AI is and its characteristics (continued)

3. It can learn and adapt. Some AI systems change their own rules or data as they get new experience.

e.g.Example
A sat-nav app collects live traffic data (data), applies rules about speed and distance (rules), works out the fastest route (reasoning), and changes the route when a road is blocked (adapting).

The explanation · step 1 of 4 · part 3 of 3

What AI is and its characteristics (continued)

!Watch out

Not every AI system can learn. An expert system reasons with fixed rules. Machine learning is the kind that learns and adapts.

The explanation · step 2 of 4 · part 1 of 3

Expert systems: the four parts

An expert system is an AI program that copies the knowledge and decisions of a human expert in one subject, such as a doctor or a car mechanic.

It has four parts. Cambridge expects all four.

PartWhat it does
Knowledge baseA database of facts about the subject, collected from human experts
Rule baseA set of rules, usually IF … THEN …, that say how to use the facts to reach conclusions
Inference engineThe 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
InterfaceHow the user communicates with the system: it asks questions, takes the user's answers, and shows the conclusions and the reasons for them

The explanation · step 2 of 4 · part 2 of 3

Expert systems: the four parts (continued)

e.g.Example
A car fault-finding expert system: Knowledge base: "A flat battery stops the engine turning over." Rule base: IF engine does not turn over AND lights are dim THEN battery is probably flat. Interface asks: "Does the engine turn over?" User: No. "Are the lights dim?" User: Yes. Inference engine applies the rule and concludes: battery is probably flat (90% likely). Interface shows the conclusion and explains which answers led to it.

The explanation · step 2 of 4 · part 3 of 3

Expert systems: the four parts (continued)

?Why?

Keeping facts (knowledge base) apart from the logic (rule base) means experts can add new facts or rules without rewriting the program.

The explanation · step 3 of 4 · part 1 of 2

How an expert system reaches a conclusion

Try the expert toy. It finds out why a laptop will not start. Answer its Yes or No questions. When a rule fires, read How I decided to see which rules the inference engine used.

The system often gives a probability or confidence with each answer, for example "75% likely". It can also explain its reasoning, which helps the user trust it.

Uses include medical diagnosis, car and machine fault finding, mineral prospecting, financial planning and plant identification.

The explanation · step 3 of 4 · part 2 of 2

How an expert system reaches a conclusion (continued)

AdvantagesDisadvantages
Gives consistent answers with no bad daysOnly as good as the facts and rules put in
Fast, available 24/7 and in many places at onceHas no common sense; cannot handle cases outside its rules
Stores the knowledge of several expertsExpensive to build; experts' time is costly
Can explain how it reached its conclusionUsers may trust it too much and stop thinking for themselves

There is something to try for this step in the IGCSE library.

The explanation · step 4 of 4 · part 1 of 3

Machine learning

Machine learning is a type of AI where the program adapts its own processes and/or data as it is used. It is not given every rule by a programmer.

It is given lots of example data. It finds patterns in that data and builds its own way of making decisions.

As it gets more data and feedback, it changes itself and becomes more accurate.

The explanation · step 4 of 4 · part 2 of 3

Machine learning (continued)

e.g.Example
An email spam filter: 1. It is shown thousands of emails already marked "spam" or "not spam". 2. It finds patterns, such as certain words or senders, that appear in spam. 3. It uses those patterns to sort new emails. 4. When you mark a missed email as spam, it adapts and improves. Other examples: video and music recommendations, face recognition on a phone, translation apps.

The explanation · step 4 of 4 · part 3 of 3

Machine learning (continued)

?Why?

Some problems are too complex to write every rule by hand. It is easier to let the program learn the rules from examples.

!Watch out

Expert system versus machine learning: an expert system's rules are written by people and stay the same. A machine learning system changes its own rules from data.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Quick quiz · 1 of 3

In 8-bit two's complement, 11111111 is…

  1. A −1
  2. B 255
  3. C −127

A. −1

The left bit is worth −128. −128 + 127 = −1.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Quick quiz · 2 of 3

Which of these is lossy?

  1. A PNG
  2. B ZIP
  3. C JPEG

C. JPEG

JPEG throws away detail. PNG and ZIP give every bit back.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Quick quiz · 3 of 3

A 10 × 10 image at 8 bits per pixel takes…

  1. A 800 bits = 100 bytes
  2. B 8,000 bits
  3. C 80 bytes

A. 800 bits = 100 bytes

10 × 10 × 8 = 800 bits. Divide by 8 for bytes.

Year 11 · Computer Science · Automated and emerging technologies; Paper 1 practice · Lesson 3 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. A packet's header holds…

    A The sender's and receiver's addresses and the packet numberB The whole fileC Only the data

    A. The sender's and receiver's addresses and the packet number The header is the label. The payload is the data.

  2. Sending one bit at a time down one wire is…

    A DuplexB SerialC Parallel

    B. Serial Parallel sends several bits at once down several wires.