Module 1
Module 1
Module 1
Module 1
Dr. Bhavanishankar K
Asst. Prof. Dept. of CSE
RNSIT, Bangalore
Artificial Intelligence
• Artificial
– Defining “artificial” is easy.
– Any thing made by man
• Natural
– Any thing made by nature
• Intelligence
– No broad consensus in precise, concrete terms for “Intelligence”.
– Is it
• An exclusive state of human being?
• A natural phenomenon exhibited by living organisms?
• an arbitrarily specified set of abilities?
– Any other definitions??
What is Intelligence?
• “Ability to learn, understand and think” ( Oxford dictionary )
Note: Varying kinds and degrees of intelligence occur in people, many animals
and some machines.
Computer v/s Human
• Machine
– Man made
– Performs precisely defined tasks with speed and accuracy
– Not gifted with common sense
• Human
– Struggle on complex Computations
– Capable of Understanding and Reasoning
– More likely to understand the results and determine what to do
next with little common sense
{4, 0} {0, 3}
{4, 3} {1, 3}
{3,0} {4, 3}
{3, 3} {0, 0}
{4, 2} {0, 3}
{0, 2} .. and so on
{2, 0}
Water Jug problem
• Try for 6-litre and 8-litre jugs; indicate how 8-
litre jug can be filled with 4-litre of water.
Man –Tiger –Cow - Grass Problem [MTCG]
47
Is the problem decomposable?
48
Is the problem decomposable?
Start Goal
A
C B
A B C
Blocks World
49
Is the problem decomposable?
ON(B, C) and ON(A, B)
ON(B, C) ON(A, B)
CLEAR(A) ON(A, B)
A
C B
A B C
50
Can solution steps be ignored or undone?
• Consider the following examples
– Ignorable (e.g. theorem proving), in which
solution steps can be ignored
– Recoverable (e.g. 8-puzzle), in which solution
steps can be undone
– Irrecoverable (e.g.chess), in which solution steps
cannot be undone
2 8 3 1 2 3
1 6 4 8 4
7 5 7 6 5
51
Can solution steps be ignored or undone?
• Ignorable problems can be solved using a
control structure that never backtracks.
• Recoverable problems can be solved using
slightly complicated control strategy that
makes mistakes –use back tracking.
• Irrecoverable problems can be solved using
recoverable style methods via planning.
52
Is the universe predictable?
• The planning process can only be done effectively for
certain-outcome.
• e.g.The 8-Puzzle
⁻ Every time we make a move, we know exactly what will
happen.
Certain outcome!!!
• e.g. playing card game : Bridge
⁻ We cannot know exactly where all the cards are or what
the other players will do on their turns.
⁻ Planning is not possible
Uncertain outcome !!!
53
Is the universe predictable?
• Planning is – problem solving without feedback from the
environment
• For certain-outcome problems, planning can be used
to generate a sequence of operators that is guaranteed
to lead to a solution.
• For uncertain-outcome problems, a sequence of
generated operators can only have a good probability of
leading to a solution.
• Plan revision is made as the plan is carried out and the
necessary feedback is provided.
54
Is the universe predictable?
• The hardest problems are those with the following
characteristics
• Irrecoverable
• Uncertain outcomes
• Following are few of them
– Playing bridge: we can do fairly well since we have available
accurate estimates of the probabilities of each of the possible
outcomes.
– Controlling a robot arm: The outcome is uncertain for a variety of
reasons.
• Someone might move something into the path of the arm.
• The gears of the arm might stick.
• A slight error could cause the arm to knock over a whole stack of things.
– Helping a lawyer decide how to defend his client against a
murder charge: Here we probably cannot even list all the possible
55
outcomes,
Is a good solution absolute or relative?
Consider the following facts
1. Marcus was a man.
2. Marcus was a Pompeian.
3. Marcus was born in 40 A.D.
4. All men are mortal.
5. All Pompeians died when the volcano erupted in 79 A.D.
6. No mortal lives longer than 150 years.
7. It is now 2004 A.D.
is Marcus alive ?
56
Is a good solution absolute or relative?
57
Which one to chose as an answer ? Doesn’t matter!!!!
Is a good solution absolute or relative?
Consider TSP,
58
Is a good solution absolute or relative?
60
Is the solution a state or a path?
• In contrast,
– Water jug problem, the final state is not just enough the
path that has been used to find the solution is important
• Natural language understanding :
– Solution is the state of the world
• Water jug problem
– Solution is a path to a state
61
What is the role of knowledge
• Playing Chess
– Knowledge is important only to constrain the search for
a solution.
• Reading Newspaper
– Knowledge is required even to be able to recognize a
solution.
62
Does the task require human-interaction?
63
Problem Classification
64
AI Technique
• Intelligence requires Knowledge
• Knowledge possesses some less desirable properties
such as:
– Voluminous
– Hard to characterize accurately
– Constantly changing
– Differs from data that can be used
• AI technique is a method that exploits knowledge that
should be represented in such a way that:
– It captures generalization
– It can be understood by people who must provide it
– It can be easily modified to correct errors.
– It can be used in variety of situations
AI-Problem Solving:
Formal description of a Problem
– Identify the objects
– Define the state space that contain all possible configurations/
situations/states of these objects
– Specify the initial state within the space from which problem-
solving process may start
– Specify the goal state that would be acceptable as solution to
the problem
– Specify the set of rules/productions which describe available
actions (Operators) that get you from one state to another
– Define Search techniques that systematically consider all
possible action sequences to find a path from the initial to goal
state
– Also, Think of
• What knowledge is given (set of constraints/ restrictions)
• What knowledge has to be assumed
• What assumptions are present in the problem and to be made
• How to make rules and in what order they should be applied
A Water Jug Problem
1
Formal Description of an AI-Problem
Water-Jug problem
• “You are given two jugs, a 4 gallon one, and a 3 gallon one.
Neither has any measuring markers on it. There is a tap that can
be used to fill the jugs with water. How can you get exactly 2
gallons of water in the 4 gallon jug?”
• Initial State: pair {x, y}, where x & y represents the amount of
water in Jug1 and Jug2. (4, 1) means 4 gallons in 4 gallon jug, 1
gallon in 3 gallon jug.
{4, 0} {0, 3}
{4, 3} {1, 3}
{3,0 {4,
} 3}
{3, {0,
3} 0}
{4, {0,
2} 3}
{0, .. and so on.
2}
{2,
State Space Search
71
State Space Search: Playing Chess
72
State Space Search: Playing Chess
73
State Space Search: Water Jug Problem
• State: (x, y)
x = 0, 1, 2, 3, or 4 y = 0, 1, 2, 3
• Start state: (0, 0).
74
State Space Search: Water Jug Problem
1. (x, y) → (4, y)
if x < 4
2. (x, y) → (x, 3)
if y < 3
3. (x, y) → (x − d, y)
if x > 0
4. (x, y) → (x, y − d)
if y > 0
75
State Space Search: Water Jug Problem
5. (x, y) → (0, y)
if x > 0
6. (x, y) → (x, 0)
if y > 0
7. (x, y) → (4, y − (4 − x))
if x + y ≥ 4, y > 0
8. (x, y) → (x − (3 − y), 3)
if x + y ≥ 3, x > 0
76
State Space Search: Water Jug Problem
9. (x, y) → (x + y, 0)
if x + y ≤ 4, y > 0
10. (x, y) → (0, x + y)
if x + y ≤ 3, x > 0
11. (0, 2) → (2, 0)
77
State Space Search: Water Jug Problem
1. (x, y) → (4, y)
if x < 4
2. (x, y) → (x, 3)
if y < 3
79
State Space Search: Water Jug Problem
80
One Solution to the
Water Jug Problem
2
State Space Search: Summary
82
Production Systems
1. A set of rules.
2. Knowledge/databases.
3. A control strategy.
4. A rule applier.
2
The Four Categories of Production
Systems
3
Agents
• An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators
• Types of Agents
Human agent:
sensors: eyes, ears, and other organs
actuators: hands, legs, mouth, and other body parts
Robotic agent:
sensors: cameras and infrared range finders actuators:
various motors
Agents and Environments
PEAS:
Performance measure
Environment
Actuators
Sensors
PEAS
• Example: Agent = Taxi driver