Unit 1
Unit 1
❑ Proving A Theorem
❑ Playing Chess
❑ Speech Recognition
❑ Computer Vision
❑ Expert Systems
❑ Machine Learning
Application of AI
INTELLIGENCE ARTIFICIAL
INTELLIGENCE
It is a natural process. It is programmed by
humans.
It is actually hereditary. It is not hereditary.
Knowledge is required for KB and electricity are
intelligence. required to generate output.
No human is an expert. We Expert systems are made
may get better solutions which aggregate many
from other humans. person’s experience and
ideas.
23
1.2 DEFINITION
24
Definition
25
a. Intelligence - Ability to apply knowledge in order to
perform better in an environment.
b. Artificial Intelligence - Study and construction of agent
programs that perform well in a given environment, for a
given agent architecture.
c. Agent - An entity that takes action in response to precepts
from an environment.
d. Rationality - property of a system which does the “right
thing” given what it knows.
e. Logical Reasoning - A process of deriving new
sentences from old, such that the new sentences are
necessarily true if the old ones are true.
26
Four Approaches of Artificial Intelligence:
27
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
• The Turing Test, proposed by Alan Turing (1950), was
designed to provide a satisfactory operational definition
of intelligence.
• A computer passes the test if a human interrogator,
after posing some written questions, cannot tell whether
the written responses come from a person or from a
computer.
28
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
Turing Test 29
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
• natural language processing to enable it to
communicate successfully in English;
• knowledge representation to store what it knows or
hears;
• automated reasoning to use the stored information to
answer questions and to draw new conclusions
• machine learning to adapt to new circumstances and to
detect and extrapolate patterns.
30
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
• Total Turing Test includes a video signal so that the
interrogator can test the subject’s perceptual abilities,
as well as the opportunity for the interrogator to pass
physical objects “through the hatch.” To pass the total
Turing Test, the computer will need
• computer vision to perceive objects, and robotics
to manipulate objects and move about.
31
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
Thinking humanly: The cognitive modelling approach
• Analyse how a given program thinks like a human, we must have
some way of determining how humans think. The interdisciplinary
field of cognitive science brings together computer models from
AI and experimental techniques from psychology to try to
construct precise and testable theories of the workings of the
human mind.
• Although cognitive science is a fascinating field in itself, we are
not going to be discussing it all that much in this book. We will
occasionally comment on similarities or differences between AI
techniques and human cognition. Real cognitive science,
however, is necessarily based on experimental investigation of
actual humans or animals, and we assume that the reader only
has access to a computer for experimentation. We will simply
note that AI and cognitive science continue to fertilize each other,
especially in the areas of vision, natural language, and learning.
32
1.3 ACTING HUMANLY: THE TURING TEST
APPROACH
Thinking rationally: The “laws of thought” approach
34
1.4 FUTURE OF ARTIFICIAL INTELLIGENCE
36
1.4 FUTURE OF ARTIFICIAL INTELLIGENCE
37
1.5 CHARACTERISTICS OF INTELLIGENT
AGENTS
• Situatedness
The agent receives some form of sensory input from its
environment, and it performs some action that changes its
environment in some way.
Examples of environments: the physical world and the
Internet.
• Autonomy
The agent can act without direct intervention by humans or
other agents and that it has control over its own actions
and internal state.
38
1.5 CHARACTERISTICS OF INTELLIGENT
AGENTS
• Adaptivity
1. The agent is capable of reacting flexibly to changes in
its environment;
2. taking goal-directed initiative (i.e., is pro-active), when
appropriate; and
3. Learning from its own experience, its environment, and
interactions with others.
• Sociability
• The agent is capable of interacting in a peer-to-peer
manner with other agents or humans
39
1.6 AGENTS AND ITS TYPES
Agent types
40
1.6 AGENTS AND ITS TYPES
• An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators.
• Human Sensors:
• Eyes, ears, and other organs for sensors.
• Human Actuators:
• Hands, legs, mouth, and other body parts.
• Robotic Sensors:
• Mic, cameras and infrared range finders for sensors
• Robotic Actuators:
• Motors, Display, speakers etc
41
1.6 AGENTS AND ITS TYPES
An agent can be:
43
1.6 AGENTS AND ITS TYPES
Effectors
44
1.7 PROPERTIES OF ENVIRONMENT
• An environment is everything in the world which surrounds
the agent, but it is not a part of an agent itself. An
environment can be described as a situation in which an
agent is present.
• The environment is where agent lives, operate and provide
the agent with something to sense and act upon it.
45
1.7 PROPERTIES OF ENVIRONMENT
Fully observable vs Partially Observable:
46
1.7 PROPERTIES OF ENVIRONMENT
1. Deterministic vs Stochastic
• If an agent's current state and selected action can
completely determine the next state of the environment, then
such environment is called a deterministic environment.
• A stochastic environment is random in nature and cannot be
determined completely by an agent.
• In a deterministic, fully observable environment, agent does
not need to worry about uncertainty.
2. Episodic vs Sequential
• In an episodic environment, there is a series of one-shot
actions, and only the current percept is required for the
action.
• However, in Sequential environment, an agent requires
memory of past actions to determine the next best actions.
47
1.7 PROPERTIES OF ENVIRONMENT
3. Single-agent vs Multi-agent
48
1.7 PROPERTIES OF ENVIRONMENT
4. Static vs Dynamic
49
1.7 PROPERTIES OF ENVIRONMENT
5. Discrete vs Continuous
50
1.7 PROPERTIES OF ENVIRONMENT
6. Known vs Unknown
51
1.7 PROPERTIES OF ENVIRONMENT
7. Accessible vs. Inaccessible
52
1.7 PROPERTIES OF ENVIRONMENT
Task environments, which are essentially the "problems" to
which rational agents are the "solutions."
PEAS: Performance Measure, Environment, Actuators,
Sensors
Performance
• The output which we get from the agent. All the necessary
results that an agent gives after processing comes under its
performance.
Environment
• All the surrounding things and conditions of an agent fall in
this section. It basically consists of all the things under which
the agents work.
53
1.7 PROPERTIES OF ENVIRONMENT
Actuators
• The devices, hardware or software through which the agent
performs any actions or processes any information to produce
a result are the actuators of the agent.
Sensors
• The devices through which the agent observes and perceives
its environment are the sensors of the agent.
54
1.7 PROPERTIES OF ENVIRONMENT
57
1.7 PROPERTIES OF ENVIRONMENT
• Ideal Agent describes by ideal mappings. “Specifying which
action an agent ought to take in response to any given percept
sequence provides a design for ideal agent”.
58
1.7 PROPERTIES OF ENVIRONMENT
The Structure of Intelligent Agents
59
1.8 TYPES OF AGENTS
Agents can be grouped into four classes based on their degree
of perceived intelligence and capability :
60
1.8 TYPES OF AGENTS
1. The Simple reflex agents
61
1.8 TYPES OF AGENTS
1. The Simple reflex agents
62
1.8 TYPES OF AGENTS
1. The Simple reflex agents
• Condition-Action Rule − It is a rule that maps a state
(condition) to an action.
• Ex: if car-in-front-is-braking then initiate- braking.
63
A simple reflex agent
1.8 TYPES OF AGENTS
2. Model Based Reflex Agents
• The Model-based agent can work in a partially observable
environment, and track the situation.
• A model-based agent has two important factors:
• Model: It is knowledge about "how things happen in the
world," so it is called a Model-based agent.
• Internal State: It is a representation of the current state
based on percept history.
• These agents have the model, "which is knowledge of the
world" and based on the model they perform actions.
• Updating the agent state requires information about:
• How the world evolves
• How the agent's action affects the world.
64
1.8 TYPES OF AGENTS
2. Model Based Reflex Agents
66
1.8 TYPES OF AGENTS
3. Goal Based Agents
A goal-based agent
67
1.8 TYPES OF AGENTS
4. Utility Based Agents
• These agents are similar to the goal-based agent but provide
an extra component of utility measurement (“Level of
Happiness”) which makes them different by providing a
measure of success at a given state.
• Utility-based agent act based not only goals but also the best
way to achieve the goal.
• The Utility-based agent is useful when there are multiple
possible alternatives, and an agent has to choose in order to
perform the best action.
• The utility function maps each state to a real number to check
how efficiently each action achieves the goals.
68
1.8 TYPES OF AGENTS
4. Utility Based Agents
A utility-based agent 69
1.8 TYPES OF AGENTS
5. Learning Agents
• A learning agent in AI is the type of agent which can learn
from its past experiences, or it has learning capabilities.
• It starts to act with basic knowledge and then able to act and
adapt automatically through learning.
• A learning agent has mainly four conceptual components,
which are:
a. Learning element: It is responsible for making improvements by
learning from environment
b. Critic: Learning element takes feedback from critic which describes
that how well the agent is doing with respect to a fixed performance
standard.
c. Performance element: It is responsible for selecting external action
d. Problem generator: This component is responsible for suggesting
actions that will lead to new and informative experiences.
70
1.8 TYPES OF AGENTS
5. Learning Agents
• Hence, learning agents are able to learn, analyze
performance, and look for new ways to improve the
performance.
Learning Agents 71
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Problem-solving agents
In Artificial Intelligence, Search techniques are universal
problem-solving methods. Rational agents or Problem-
solving agents in AI mostly used these search strategies or
algorithms to solve a specific problem and provide the best
result. Problem- solving agents are the goal-based agents and
use atomic representation. In this topic, wewill learn various
problem-solving search algorithms.
• Some of the most popularly used problem solving with the
help of artificial intelligence are:
1. Chess.
2. Travelling Salesman Problem.
3. Tower of Hanoi Problem.
4. Water-Jug Problem.
72
5. N-Queen Problem.
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Problem Searching
73
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Steps : Solve Problem Using Artificial Intelligence
• The process of solving a problem consists of five steps.
These are:
74
Problem Solving in Artificial Intelligence
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Defining The Problem: The definition of the problem must be
included precisely. It should contain the possible initial as well
as final situations which should result in acceptable solution.
1. Analyzing The Problem: Analyzing the problem and its
requirement must be done as few features can have
immense impact on the resulting solution.
2. Identification of Solutions: This phase generates
reasonable amount of solutions to the given problem in a
particular range.
3. Choosing a Solution: From all the identified solutions, the
best solution is chosen basis on the results produced by
respective solutions.
4. Implementation: After choosing the best solution, its
implementation is done.
75
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Measuring problem-solving performance
76
1.9 PROBLEM SOLVING APPROACH TO
TYPICAL AI PROBLEMS
Search Algorithm Terminologies
• Search: Searching is a step by step procedure to solve a
search-problem in a given search space. A search problem
can have three main factors:
1. Search Space: Search space represents a set of
possible solutions, which a system may have.
2. Start State: It is a state from where agent begins the
search.
3. Goal test: It is a function which observe the current state
and returns whether the goal state is achieved or not.
• Search tree: A tree representation of search problem is called
Search tree. The root of the search tree is the root node which
is corresponding to the initial state.
• Actions: It gives the description of all the available actions to
the agent. 77
Example Problems
• A Toy Problem is intended to illustrate or exercise various
problem-solving methods.
• A real- world problem is one whose solutions people actually
care about.
Toy Problems
• Vacuum World
• States: The state is determined by both the agent location
and the dirt locations. The agent is in one of the 2 locations,
each of which might or might not contain dirt. Thus there are
2*2^2=8 possible world states.
• Initial state: Any state can be designated as the initial state.
• Actions: In this simple environment, each state has just three
actions: Left, Right, and
• Suck. Larger environments might also include Up and Down. 78
Example Problems
• Transition model: The actions have their expected effects,
except that moving Left in the leftmost squ are, moving Right
in the rightmost square, and Sucking in a clean square have
no effect. The complete state space is shown in Figure.
• Goal test: This checks whether all the squares are clean.
• Path cost: Each step costs 1, so the path cost is the number
of steps in the path.
8- Puzzle Problem
81
2) Queens Problem
Queens Problem
• States: Any arrangement of 0 to 8 queens on the board is a
state.
• Initial state: No queens on the board.
• Actions: Add a queen to any empty square.
• Transition model: Returns the board with a queen added to
the specified square.
• Goal test: 8 queens are on the board, none attacked. 82
2) Queens Problem
• Consider the given problem. Describe the operator
involved in it. Consider the water jug problem: You are
given two jugs, a 4-gallon one and 3-gallon one. Neither
has any measuring marker on it. There is a pump that can
be used to fill the jugs with water. How can you get
exactly 2 gallon of water from the 4-gallon jug ?
• Explicit Assumptions: A jug can be filled from the pump,
water can be poured out of a jug on to the ground, water
can be poured from one jug to another and that there are
no other measuring devices available.
• Here the initial state is (0, 0). The goal state is (2, n) for
any value of n.
83
2) Queens Problem
• State Space Representation: we will represent a state of the
problem as a tuple (x, y) where x represents the amount of
water in the 4-gallon jug and y represents the amount of water
in the 3-gallon jug. Note that 0 ≤ x ≤ 4, and 0 ≤ y ≤ 3.
• To solve this we have to make some assumptions not
mentioned in the problem. They are:
• We can fill a jug from the pump.
• We can pour water out of a jug to the ground.
• We can pour water from one jug to another.
• There is no measuring device available.
Solution
86
2) Queens Problem
S S.No Gallons in 4- Gallons in 3- Rule Applied
. gel jug(x) gel jug (y)
o
1. 0 0 Initial state
l
2.. 4 0 1. Fill 4
u
3 1 3 6. Poor 4 into 3 to fill
t 4. 1 0 4. Empty 3
i 5. 0 1 8. Poor all of 4 into
3
o 6. 4 1 1. Fill 4
n 7. 2 3 6. Poor 4 into 3
87
2) Queens Problem
S
• 4-gallon one and a 3-gallon Jug
o
u
•No measuring mark on the jug.
t •There is a pump to fill the jugs with water.
•How can you get exactly 2 gallon of water into the 4-
i gallon jug?
n
88
END
89