6.
3 ARTIFICIAL INTELLIGENCE (AI) – PART 1
Artificial Intelligence (AI) is a fascinating and growing field. In this part of the tutorial, we will cover the basics of
AI, its characteristics, and an important application: expert systems.
What is Artificial Intelligence (AI)?
Artificial Intelligence refers to the simulation of human intelligence in machines. It enables machines to think,
learn, and make decisions in a way similar to humans.
Definition of AI:
AI is a branch of computer science that involves creating systems that can reason, learn, and adapt to perform
tasks that normally require human intelligence.
Characteristics of AI Systems
AI systems have several key characteristics:
1. Ability to Learn
AI systems can improve their performance over time by learning from data. This is called machine
learning.
o Example: A voice assistant like Siri improves its understanding of your commands the more you
use it.
2. Ability to Reason
AI systems can analyze information and make logical decisions based on rules or data.
o Example: A chess program decides the best move based on possible outcomes.
3. Ability to Process Large Amounts of Data
AI systems can analyze huge datasets much faster than humans.
o Example: AI in weather forecasting processes data from satellites to predict storms.
4. Ability to Adapt
AI systems can adapt to new information and change their behavior accordingly.
o Example: Self-driving cars adjust their speed when they detect nearby vehicles or obstacles.
Applications of AI
AI is used in many fields, such as healthcare, education, entertainment, and transportation. Some common
examples include:
● Voice Assistants: Devices like Alexa or Google Assistant use AI to process spoken commands.
● Healthcare: AI is used for diagnosing diseases and analyzing medical images.
● Gaming: AI creates intelligent opponents in video games that can adapt to the player’s actions.
● Self-Driving Cars: AI helps vehicles navigate roads and avoid obstacles.
Expert Systems
One important application of AI is expert systems.
What is an Expert System?
An expert system is a type of AI program that uses a database of knowledge and rules to make decisions or
solve problems. It mimics the decision-making ability of a human expert.
Example:
A medical expert system helps doctors diagnose diseases based on symptoms.
Components of an Expert System
Expert systems have four main components:
1. Knowledge Base
o What it is: This stores all the facts and information needed to solve problems.
o Example: In a car repair system, the knowledge base stores information about common car
faults and solutions.
2. Rule Base
o What it is: This contains rules that define how to use the knowledge base to make decisions.
o Example: "If the engine doesn’t start and the battery is charged, then check the fuel system."
3. Inference Engine
o What it is: This processes the rules and facts to make decisions or diagnoses.
o Example: The inference engine checks the rules and decides that the problem is a clogged fuel
line.
4. User Interface
o What it is: This is how users interact with the system, providing input and receiving output.
o Example: A mechanic types in the car's symptoms and receives possible causes on a screen.
How an Expert System Works
1. Input: The user provides information about a problem, such as symptoms of a disease or details of a
car fault.
2. Processing:
o The inference engine compares the input to the rules in the rule base.
o It uses the knowledge base to find relevant facts.
3. Output: The system provides a diagnosis, recommendation, or solution.
Example of Operation in a Medical Expert System:
● Input: A user enters symptoms such as fever, cough, and fatigue.
● Processing: The inference engine checks the rules and identifies flu as a possible diagnosis.
● Output: The system suggests, "Diagnosis: Flu. Recommendation: Take rest and stay hydrated."
Advantages of Expert Systems
1. Speed: They can make decisions much faster than human experts.
2. Consistency: The system applies the same rules every time, ensuring uniform decisions.
3. Accessibility: Expert systems can provide expertise even in remote areas where human experts may
not be available.
4. Cost-Effective: After setup, they can save costs by replacing repetitive manual tasks.
Disadvantages of Expert Systems
1. Lack of Creativity: They cannot think creatively or adapt to completely new situations.
2. High Initial Cost: Developing and maintaining expert systems can be expensive.
3. Limited Scope: They only work within the knowledge and rules programmed into them.
4. Dependence on Data: If the data in the knowledge base is outdated, the system may provide incorrect
answers.
Practice Questions
1. Define what is meant by artificial intelligence (AI).
2. List three characteristics of AI systems.
3. Explain the four components of an expert system.
4. Give two advantages and two disadvantages of using expert systems.
5. Describe how an expert system can be used in the field of car repair.
6.3 Artificial Intelligence (AI) – Part 2
In this part of the tutorial, we will explore machine learning, how AI systems adapt and learn, and the overall
advantages and disadvantages of AI.
What is Machine Learning?
Machine learning is a part of AI that allows computers to learn from data and improve their performance over
time without being explicitly programmed.
Definition:
Machine learning is when a program can analyze data, identify patterns, and adjust its processes or behavior
based on what it learns.
How Machine Learning Works
Machine learning relies on three key steps:
1. Data Collection:
o The system collects large amounts of data from its environment or inputs.
o Example: A recommendation system collects data about movies you’ve watched.
2. Pattern Recognition:
o The system analyzes the data to identify patterns or trends.
o Example: It notices that you prefer action movies.
3. Decision Making:
o Based on the patterns, the system makes decisions or predictions.
o Example: It recommends new action movies for you to watch.
Types of Machine Learning
There are three main types of machine learning:
1. Supervised Learning
o The system is trained using labeled data (data with correct answers).
o Example: A model is trained to recognize images of cats using pictures labeled as "cat" or "not
cat."
2. Unsupervised Learning
o The system is given unlabeled data and must find patterns on its own.
o Example: A shopping website groups customers based on their purchasing habits without
knowing what specific items they prefer.
3. Reinforcement Learning
o The system learns through trial and error by receiving rewards or penalties for its actions.
o Example: A self-driving car learns to navigate roads by receiving rewards for following traffic
rules and penalties for crashing.
Examples of Machine Learning in Real Life
1. Fraud Detection:
Banks use machine learning to detect unusual transactions and prevent fraud.
o Example: An AI system flags a transaction as suspicious if it doesn’t match your spending
habits.
2. Self-Driving Cars:
Machine learning helps cars recognize traffic signs, detect other vehicles, and decide when to stop or
turn.
3. Spam Filters:
Email services use machine learning to identify and filter out spam messages based on keywords and
patterns.
4. Speech Recognition:
Virtual assistants like Siri or Alexa use machine learning to understand and respond to spoken
commands.
5. Personalized Recommendations:
Streaming services like Netflix and YouTube suggest content based on your watching habits.
Advantages of AI
AI systems, including machine learning, offer several benefits:
1. Efficiency and Speed:
AI can process large amounts of data quickly, making decisions in seconds.
2. Accuracy:
Machine learning systems improve accuracy over time as they learn from more data.
3. Automation:
AI systems can automate repetitive tasks, saving time and effort.
4. Accessibility:
AI can provide services in areas where human expertise is unavailable. For example, chatbots can
answer customer queries 24/7.
5. Customization:
Machine learning allows AI systems to provide personalized experiences, such as tailored
advertisements or recommendations.
Disadvantages of AI
Despite its benefits, AI has some drawbacks:
1. High Cost of Development:
Building and training AI systems require significant resources and expertise.
2. Dependence on Data:
AI systems need large amounts of data to learn. If the data is biased or incomplete, the system may
provide inaccurate results.
3. Job Displacement:
Automation through AI can replace human workers in industries, leading to unemployment.
4. Ethical Concerns:
AI systems can raise issues such as invasion of privacy, misuse of data, or decision-making bias.
5. Limited Creativity:
AI cannot think creatively or solve problems outside the scope of its training.
AI in Problem Solving
AI systems, including expert systems and machine learning models, are used to solve real-world problems.
Let’s look at an example:
Scenario: A Robot Navigating a Maze Using AI
1. The robot uses sensors to detect walls, dead ends, and paths.
2. It uses machine learning to remember successful paths from previous attempts.
3. The robot makes decisions in real-time, adjusting its movements based on the environment.
AI vs. Human Intelligence
AI Human Intelligence
Learns from large datasets. Learns from experiences and emotions.
Processes information faster. Can think creatively and flexibly.
Cannot feel or understand emotions. Can empathize and connect with others.
Limited to its programming. Can solve problems in unique ways.
Key Differences Between AI and Machine Learning
AI Machine Learning
AI is a broad field that includes making machines
Machine learning is a subset of AI.
intelligent.
Focuses on reasoning, learning, and
Focuses specifically on learning from data.
problem-solving.
Includes supervised, unsupervised, and reinforcement
Includes expert systems, robotics, etc.
learning.
Practice Questions
1. Define what is meant by machine learning.
2. List and explain the three types of machine learning.
3. Give two real-life examples of how machine learning is used in daily life.
4. Explain how machine learning improves AI systems over time.
5. Compare AI and human intelligence, listing two differences.