6.3 Artificial intelligence

Test yourself on Artificial intelligence 12 questions — drag-to-order, code completion, matching and multiple choice.
Start the quiz

Artificial Intelligence

Watch this lesson Video 6.3.1 · 8:58 · What AI is, the three types, and how an expert system actually reaches a conclusion

1. What is AI?

Artificial Intelligence is the simulation of human intelligence by computer systems. It involves the ability of a machine to learn from data, reason (make decisions), and self-correct.

2. Key AI Technologies

Machine Learning

A subset of AI where the system improves its performance over time by analyzing large amounts of data without being explicitly programmed for every scenario.

Example: A streaming service learning your music taste based on what you skip.

Expert Systems

A computer program that mimics the decision-making ability of a human expert in a specific field (like medicine or law).

Example: A system that diagnoses a disease based on a list of symptoms.

2b. The Three Types of AI

The syllabus classifies AI by how broad its capability is, and the three terms are examinable.

  • Narrow AI (also called weak AI) — can perform one specific task, or a narrow range of tasks, often extremely well. It cannot apply what it knows to anything outside that task. This is the only kind that currently exists. Every example in this lesson — voice assistants, image recognition, recommendation systems, chess engines, self-driving cars — is narrow AI.
  • General AI (also called strong AI in some texts) — would be able to perform any intellectual task a human can, transferring knowledge from one problem to a completely different one. It does not exist; it is a goal, not a product.
  • Strong AI — would go further still, possessing genuine understanding, consciousness and self-awareness rather than simulating them. Whether it is even possible is an open question.
The point to take away: a system that plays chess at world-champion level cannot make a cup of tea, and cannot even be asked to try. That is what narrow means. Public discussion often blurs narrow AI with general AI, which is why the distinction is worth stating clearly in an answer.

3. Components of an Expert System

To act like an "expert," the system needs these four core parts:

  • Knowledge Base: A large store of facts about the subject, provided by human experts.
  • Rule Base: The set of IF…THEN rules saying how to reason with those facts — for example, IF the temperature is high AND a rash is present THEN consider measles. The knowledge base holds what is known; the rule base holds how to use it.
  • Inference Engine: The "brain" that applies logical rules to the knowledge base to find answers.
  • User Interface: The screen where the user enters data and receives the system's advice.

4. AI Applications in the Real World

  • Autonomous Vehicles: AI processes sensor data instantly to navigate roads safely.
  • Healthcare: Analyzing X-rays to spot tumors that might be missed by the human eye.
  • Search Engines: Predicting what you want to find before you finish typing.
  • Game Playing: AI (like AlphaGo) beating world champions by calculating millions of possible moves.

5. The Ethics of AI

As AI becomes more advanced, it raises important questions:

  • Bias: If the data used to train the AI is biased, the AI's decisions will also be biased.
  • Accountability: If a self-driving car crashes, who is responsible? The owner or the programmer?
  • Job Displacement: AI can perform cognitive tasks (like accounting or coding) faster than humans.
⚠️ Exam Tip: When describing an Expert System, you must mention the Inference Engine. It is the component that does the actual "reasoning" by searching the Knowledge Base.

Machine Learning

Watch this lesson Video 6.3.2 · 8:02 · Learning the rules from data instead of being given them

1. What is Machine Learning?

Machine Learning is a method of data analysis that automates analytical model building. It is based on the idea that systems can learn from data, identify patterns, and make decisions with minimal human intervention.

2. ML vs. Expert Systems: The Core Difference

To understand why ML is powerful, we must compare it to the "Old Way" (Expert Systems).

Expert Systems

Rule-Based: Humans must manually write every "IF-THEN" rule.

Static: It only knows what it is told. It cannot handle a situation that wasn't programmed into its Knowledge Base.

Machine Learning

Data-Driven: The computer analyzes millions of examples to find its own rules.

Dynamic: It continuously improves. The more data it sees, the more accurate its predictions become.

3. Why ML Solves Problems Better

Machine Learning is superior for complex problems where humans cannot easily explain the rules. These include:

  • Unstructured Data: Recognizing a face or a voice involves billions of tiny variations. A human cannot write enough "IF" statements to cover every angle of a face.
  • Constant Change: Email spam changes every day. ML adapts to new spam patterns automatically, whereas an Expert System would need a human to constantly update the rules.
  • Hidden Patterns: ML can find connections in massive datasets (like DNA or financial markets) that are invisible to the human eye.

4. Worked Example: Email Spam Detection

This is a classic problem that Expert Systems failed at, but Machine Learning solved.

How ML solves Spam:

  • Data Collection: The system is fed millions of emails marked as "Spam" and "Not Spam."
  • Pattern Discovery: The ML algorithm notices that spam often contains specific word combinations, unusual sender IP addresses, and hidden tracking links.
  • Model Building: It creates a mathematical model of what a "Spam" email looks like.
  • Prediction: When a new email arrives, the ML model calculates the probability of it being spam.
  • Self-Correction: If you mark a "clean" email as spam, the model updates itself to be more accurate next time.

5. The Training Process

Machine Learning typically follows three stages:

  1. Training: Inputting massive datasets (Big Data).
  2. Testing: Giving the AI data it hasn't seen yet to check its accuracy.
  3. Application: Using the trained model in the real world.
⚠️ Exam Alert: If asked for the difference, remember:
Expert Systems = Human-made rules.
Machine Learning = Patterns discovered from data.