Module 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 91

Artificial Intelligence

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 )

• “The capacity to acquire and apply knowledge” ( Webster )

• Is the computational part of the ability to achieve goals in the world.

• Ability to acquire, process and reasoning about the knowledge in a


particular domain.

• Ability to make valid arguments in arriving at a valid conclusion

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

Many tasks which we might Complex


reasonably think require Arithmetic
intelligence are performed by
computers without even thinking

Other tasks that people do without Recognizing


thinking are extremely difficult to a Face 4
automate
AI Problems
• Game playing –chess
• Theorem proving – logic theorist
• Common sense reasoning –General
Problem Solver (GPS)
• Physical objects and its relationships
• Action and consequences
• Perception (vision, speech), NLP, Medical
diagnosis , chemical analysis
What is Artificial Intelligence?
• A broad field that means different things to different
people
• The study of how to make computers do things at which,
at the moment, people are better (Rich & Knight, 1991)
• The branch of computer science that is concerned with
the automation of intelligent behavior (Luger &
Stubblefield, 1993)
• The study of computations that make it possible to
perceive, reason, and act (Winston, 1992)
• A field of study that seeks to explain and emulate the
intelligent behavior in terms of computational processes
(Schalkoff, 1990)
• The automation of activities that we associate with
human thinking (Bellman, 1978) Activities : Decision
making, problem solving, learning ….
Task Domains of AI
• Mundane Tasks:
– Perception
• Vision
• Speech Note: AI is concerned
– Natural Languages
• Understanding with automating
• Generation
• Translation
both mundane and
– Common sense reasoning expert tasks.
– Robot Control
• Formal Tasks
– Game Playing
– Theorem Proving, General Problem Solving
• Expert Tasks: (require specialized skills and training)
– Engineering ( Design, Fault finding, Manufacturing planning)
– Scientific Analysis
– Medical Diagnosis
– Financial Analysis
State of the art / Level of the Model
• Deep Blue defeated the leading world chess champion Garry
Kasparov in 1997

• Proved a mathematical conjecture (Robbins conjecture)


unsolved for decades

• No hands across America (driving autonomously 98% of the


time from Pittsburgh to San Diego)

• During the 1991 Gulf War, US forces deployed an AI logistics


planning and scheduling program that involved up to 50,000
vehicles, cargo, and people

• NASA's on-board autonomous planning program controlled the


scheduling of operations for a spacecraft

• Proverb solves crossword puzzles better than most humans

• Stanford vehicle in Darpa challenge completed autonomously a


132 mile desert track in 6 hours 32 minutes.
http://www.youtube.com/watch?v=-xibwwNVLgg
Four questions
• What are the underlying assumptions
abut intelligence
• What kinds of techniques will be useful for
solving AI problems
• At what level of detail , we are trying to
model human intelligence
• How do decide that we have succeeded
in building intelligent program
Underlying assumptions
Physical symbol system hypothesis
– A physical symbol system takes physical
patterns (symbols), combine them into
structures (expressions) and manipulate
(using processes) them to produce new
expressions
• A physical symbol system has the
necessary and sufficient means for general
intelligent actions
Underlying assumptions
• Examples of physical symbol systems
• Formal logic
– And, not, or, for all (symbols)
– Statements in formal logic (expressions)
– Rules of logical deductions (processes)
• Algebra
– +, -, *, / …(symbols)
• Digital computer
• Chess
Underlying assumptions
• Human intelligence
– Symbols are encoded in our brain
– Expressions are thoughts
– Processes are mental operations of thinking
What is an AI technique
• Intelligence requires knowledge
• But it comes with following less desirable
properties
• Voluminous
• Hard to characterize accurately
• Constantly changing
What is an AI technique
• But we must represent the knowledge is
such away that
– It captures generalization
– It can be understood by the people who
provide them
– It can be easily modified to correct errors and
to reflect changes in the world
– It can be used to in great many situations
even if it is not totally accurate and complete
Question answering
• The program that reads the text and then
answer questions (English)
• India massed troops on the Indo-Pak
border
– Dialogue 1
• Q: why did India do this ?
• A: because India though that it could take political
control of Pakistan by sending troops
• Q:What should the China do?
• A:The China should intervene militarily
Question answering
• Dialogue 2:
– Q: why did India do this ?
– A: Because India wanted to increase its
political influence over Pakistan
– Q:What should the China do?
– A:The China should denounce the Indian
action in the United Nations
Question answering
• Mary went shopping for a new coat. She
found a red one she really liked. When
she got it home, she discovered that it
went perfectly with her favorite dress.
– What did Mary go shopping for
– What did Mary find that she liked
– Did Mary buy anything
Question answering
• Data structures
– Question patterns: A set of templates that
match common question forms and produce
patterns to be used to match against inputs.
– For example, if the template “who did x y”
matches an input question, then the text patterns
“x, y, z” is matched against the text and the
value of z is given as the answer to the question.
– Text: The input text stored simply as a long
character string.
– Question :The current question also stored as a
character string.
Question answering
• To answer a question, do the following:
– Compare each element of Question Patterns, the
question and all those that match successfully to
generate a set of text patterns.
– Pass each of these patterns through a substitution
process that generates alternative forms of verbs so
that, for example, “go” in a question might match
“went” in the text. This step generates a new,
expanded set of text patterns.
– Apply each of these text patterns to text, and collect
all the resulting answers.
– Reply with the set of answers just collected.
Question answering
• Answers
– The template “what did x y” matches this question
and generates the text pattern “Mary go shopping
for z.”
– If the template set is very large then, the second
question can be answered .
– The third question cant be answered with the
knowledge provided .
C : Customers
S : Sales person
Question answering
M : Merchandise
D : Dollars
L : Location
• Alternate solution
Problems, Problem Spaces and
Search
To build a system to solve any problem
• Define the problem precisely: This definition must include
precise specifications of what the initial situation (s) will be as
well as what final situations constitute acceptable solutions to
the problem.
• Analyze the problem: A few very important features can have
an immense impact on the appropriateness of various possible
techniques for solving the problem.
• Isolate and represent the task knowledge that is necessary to
solve the problem.
• Choose the best problem-solving technique(s) and apply it
(them) to the particular problem.
Defining the problem as a state space search
Formal Description of a Problem
• Identity the objects /entities involved in the problem.
• Specify the Initial State (status) of the objects. i.e., the initial
configurations / situations from where the problem solving
process starts.
• Specify the goal state that would be acceptable as solution to
the problem. i.e, one or more states / configurations
acceptable as solution states.
• Define the state space that contains all possible states /
configurations / situations of the objects either in the form of
tree or graph.
• Specify the set of rules/productions that describe available
actions (operators) to get 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.
Defining the problem as a state space search
Example 1:Play Chess
• Each position can be described by an 8x8 array.
• Initial Position is the game opening position.
• Goal Position is any position in which the opponent does not
have a legal move and his/her king is under attack, (check
made).
• Legal Moves can be described by a set of rules.
• Left side of the rule matched against the current state.
• Right side of the rule describes the new resulting state.
• State space is the set of legal positions.
• Starting at the initial state, using the set of rules to move from
one state to another and attempting to end up in a goal state is
the procedure for solving problem.
Water Jug problem
You are given two jugs, a 4-litre one and a
3-litre one. Neither have any measuring
markers on it. There is a pump that can be
used to fill the jugs with water. How can you
get exacting 2 liters of water into 4- liter jug?
Water Jug problem
• Objects given are water jugs (2) and one pump.
• Let ‘x’ represents amount of water in 4-litre jug and ‘y’
3-litre jug.
• State represents pair (x, y) where
• x = 0, 1, 2, 3, or 4
y = 0, 1, 2, or 3 x-
Amount of water in jug 1 (4-litre)
y- Amount of water in jug 2 (3-litre)
– Initial / starting state: (0,0)
– Goal / final state: (2, n) for any ‘n’
– Rules / productions / operators
Water Jug problem
Production Rules
Water Jug problem
• One of the solutions to the problem
Water Jug problem
• One of the solutions to the problem
{0, 0}
Fill 4 gallon Fill 3 gallon

{4, 0} {0, 3}

Fill 3 gallon Fill 3 gallon from 4 gallon

{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]

A man has a pet Tiger, a cow, and a bundle of


grass with him. He wants to cross from one
Bank (A) to another Bank (B) of a river using a
small boat that can hold him and any one of
the remaining three. If the man is not there,
Tiger would eat cow, and similarly, the cow
would eat the grass. Man does not want to
lose any of his possessions. Indicate how he
can cross the river (BANK A to BANK B).
Man –Tiger –Cow - Grass Problem [MTCG]
State space approach for solving the MTCG problem.
• Initial State: Man (M), Tiger (T), Cow (C), Grass (G) on
BANK A and none on BANK B
• Goal State: ø; MTCG on BANK B
• Action / Operation / rule:
– Move (object, Source, Destination)
– Object = T/C/G/none
– Source = Bank A / Bank B
– Destination = Bank A / Bank B
Meaning: Man transports the object in the boat from
source to destination .
Man –Tiger –Cow - Grass Problem [MTCG]

• Knowledge Base (KB)


– The Tiger eats the cow if man is not with
them.
– The Cow eats the grass if man is not with
them.
– The Tiger does not eat the Grass
– The Tiger does not eat the man. (assumed)
– Boat carry only two objects (Man & one of his
pets)
– Man has to ride the boat.
Man –Tiger –Cow - Grass Problem [MTCG]

Actions and Conditions

Rule No Action Conditions

1 Move(T, Bank-A, Bank-B) T is on Bank-A with C or G

2 Move(C, Bank-A, Bank-B) C is on Bank-A with T/G/ both / ø

3 Move(G, Bank-A, Bank-B) G is on Bank-A with T/C

4 Move(T, Bank-B, Bank-A) T is on Bank-B with C/G

5 Move(C, Bank-B, Bank-A) C is on Bank-B with T/G

6 Move(G, Bank-B, Bank-A) G is on Bank-B with T/C


Man –Tiger –Cow - Grass Problem [MTCG]
One Possible Solution for MTCG problem
Production Systems
• Since search forms the core of many intelligent process,
it is useful to structure AI programs in a way that
facilitates describing the search process.
• Production systems provide the structure for AI
programs that makes searching process easy.
• Production System Consists of
– A set of rules of the form x y
– LHS = Patterns and LHS determines applicability of the rule.
– RHS = Action and RHS specifies operation to be performed.
– Database OR knowledge base of the domain which is
appropriate for the particular task.
– Control Strategy: That specifies the order in which rules are
applied on the knowledge base and derive the new knowledge.
– A rule applier
Control strategies
• Specifies which rule to be applied next and in what
order / sequence during the search process.
• There are many control strategies such as
– uniformed search strategies like DFS, BFS and
– informed / heuristic Strategies like Hill climbing,
Backtracking, Branch and Bound, Best first search
etc.,.
• Two requirements for good control strategies are:
– They should cause motion, so that it lead to a
solution
– They should be systematic, so that it leads to a
solution
– Examples: BFS and DFS strategies
Breadth First Search
1. Create a variable called NODE-LIST and set it
to the initial state.
2. Until a goal state is found or NODE-LIST is
empty:
a. Remove the first element from NODE-LIST and call
it E. If NODE-LIST was empty, quit.
b. For each way that each rule can match the state
described in E do.
i. Apply the rule to generate a new state,
ii. If the new state is a goal state, quit and return this state.
iii. Otherwise, add the new state to the end of NODE-LIST.
Breadth First Search
Depth First Search
1. If the initial state is a goal state, quit and return
success.
2. Otherwise, do the following until success or
failure is signaled:
i. Generate a successor, E, of the initial state. If there
are no more successors, signal failure.
ii. Call Depth-First Search with E as the initial state.
iii. If success is returned, signal success. Otherwise
continue in this loop.
The data structure used in this algorithm is
STACK
Depth First Search
Advantages o BFS and DFS
• Advantages of DFS
– DFS requires less memory. (This contrasts with
BFS)
– DFS may find a solution without examining much of
the search space at all. (This contrasts with BFS)
• Advantages of BFS
– BFS will not get trapped exploring a blind alley (path).
– If there is a solution, then breadth-first search is
guaranteed to find it, if there ae multiple solutions
then it will find minimal solution
Heuristic Search
• Heuristic
– It is a "rule of thumb" used to help guide search
– It is a technique that improves the efficiency of search
process, possibly by sacrificing claims of completeness.
– It is involving or serving as an aid to learning, discovery,
or problem-solving by experimental and especially trial-
and-error methods.
• Heuristic function
– It is a function applied to a state in a search space to
indicate a likelihood of success if that state is selected
– It is a function that maps from problem state descriptions
to measures of desirability usually represented by
numbers
– Heuristic function is problem specific.
Heuristic Search
• The purpose of heuristic function is to guide the
search process in the most profitable direction by
suggesting which path to follow first when more
than one is available.
E.g. Travelling Salesman Problem
i. Select a Arbitrary City as a starting city
ii. To select the next city, look at all cities not yet visited,
and select one closest to the current city
iii. Repeat steps until all cities have been visited
• Heuristic search methods is often known as
"weak methods" because of their generality and
because they do not apply a great deal of
knowledge.
AI Problem Characteristics
To choose an appropriate method for a particular problem:
▪ Is the problem decomposable?
▪ Can solution steps be ignored or undone?
▪ Is the universe predictable?
▪ Is a good solution absolute or relative?
▪ Is the solution a state or a path?
▪ What is the role of knowledge?
▪ Does the task require human-interaction? 46
Is the problem decomposable?
• Can the problem be broken down to smaller
problems to be solved independently?
• Decomposable problem can be solved easily.

47
Is the problem decomposable?

48
Is the problem decomposable?
Start Goal
A
C B
A B C
Blocks World

CLEAR(x) → ON(x, Table)


CLEAR(x) and CLEAR(y) → ON(x, y)

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?

We have to try all paths to find the shortest one. 59


Is the solution a state or a path?
What is the consistent interpretation of the following
statement
The bank president ate a dish of pasta salad with the fork
• Different components of the sentence have multiple
interpretation in isolation.
• But the components must form a coherent whole
e.g.
• Bank ? Financial institution or river bank?
• Pasta salad contain pasta:: dog food ?
• With the fork :: with the vegetables :: with her friends

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?

• Solitary problem, in which there is no intermediate


communication and no demand for an explanation of
the reasoning process.

• Conversational problem, in which intermediate


communication is to provide either additional
assistance to the computer or additional information
to the user.

63
Problem Classification

• There is a variety of problem-solving methods, but


there is no one single way of solving all problems.

• Not all new problems should be considered as totally


new. Solutions of similar problems can be exploited.

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?”

• Objects: 2 Water Jugs (4 & 3 gallon), Tap

• 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.

• Goal State: pair {2, y}

• To represent the possible actions – set of Rules


Jug actions - Rules

1. Fill 4-gallon jug. {X, Y} → {4, Y}


2. Fill 3-gallon jug. {X, Y} → {X, 3}
3. Empty 4 gallon jug on to ground.
{X, Y} and X>0 → {0, Y}
4. Empty 3 gallon jug on to ground.
{X, Y} and Y>0 → {X, 0}
5. Pour some water out of 4 gallon jug
{X, Y} and X>0 → {X-D, Y}
6. Pour some water out of 3 gallon jug
{X, Y} and Y>0 → {X, Y-D} etc.,,
. . . . . ..
Search Tree / State Space for
Jugs
{0, 0}
Fill 4 gallon Fill 3 gallon

{4, 0} {0, 3}

Fill 3 gallon Fill 3 gallon from 4 gallon

{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

Problem solving = Searching for a goal state

71
State Space Search: Playing Chess

• Each position can be described by an 8-by-8 array.


• Initial position is the game opening position.

• Goal position is any position in which the opponent


does not have a legal move and his or her king is
under attack.
• Legal moves can be described by a set of rules:
− Left sides are matched against the current state.
− Right sides describe the new resulting state.

72
State Space Search: Playing Chess

• State space is a set of legal positions.


• Starting at the initial state.

• Using the set of rules to move from one state to


another.
• Attempting to end up in a goal state.

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).

• Goal state: (2, n) for any n.


• Attempting to end up in a goal state.

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)

12. (2, y) → (0, y)

77
State Space Search: Water Jug Problem

1. current state = (0, 0)


2. Loop until reaching the goal state (2, 0)
− Apply a rule whose left side matches the current state
− Set the new current state to be the resulting state
(0, 0)
(0, 3)
(3, 0)
(3, 3)
(4, 2)
(0, 2)
(2, 0)
78
State Space Search: Water Jug Problem

The role of the condition in the left side of a rule


⇒ restrict the application of the rule
⇒ more efficient

1. (x, y) → (4, y)
if x < 4
2. (x, y) → (x, 3)
if y < 3

79
State Space Search: Water Jug Problem

Special-purpose rules to capture special-case knowledge


that can be used at some stage in solving a problem

11. (0, 2) → (2, 0)

12. (2, y) → (0, y)

80
One Solution to the
Water Jug Problem

2
State Space Search: Summary

1. Define a state space that contains all the possible


configurations of the relevant objects.
2. Specify the initial states.
3. Specify the goal states.
4. Specify a set of rules:
− What are unstated assumptions?
− How general should the rules be?
− How much knowledge for solutions should be in the
rules?

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

• Mathematically, an agent’s behavior is described by the


agent function that maps from percept histories to actions:
[f: P* A]
• The agent program, that implements agent function, runs
on the physical architecture to produce f
thus, Agent = architecture + program
Example Agent: Vacuum-cleaner world

• Percepts: location and state of the environment, e.g.,


[A,Dirty], [B,Clean]

• Actions: Left, Right, Suck, NoOp

• What makes an agent Good or Bad ? Intelligent or


Stupid ? → The Concept of Rationality
Good Behavior: Concept of Rationality
• A rational agent is one that does the right thing

• Rationality depends on four things:


– The performance measure that defines the criterion of
success
– The agent’s prior knowledge of the environment
– The actions that the agent can perform
– The agent’s percept sequence to date
Task Environments
• Before we design an intelligent agent, we must
specify its “task environment”:

PEAS:

Performance measure
Environment
Actuators
Sensors
PEAS
• Example: Agent = Taxi driver

– Performance measure: Safe, fast, legal, comfortable


trip, maximize profits

– Environment: Roads, other traffic, pedestrians,


customers, signal zones, road works, pot holes etc.,

– Actuators: Steering wheel, accelerator, brake, signal,


horn

– Sensors: Cameras, sonar, speedometer, GPS,


odometer, engine sensors, keyboard
PEAS
• Example: Agent = Medical diagnosis system

Performance measure: Healthy patient, minimize costs,


lawsuits

Environment: Patient, hospital, staff, laboratory, OT

Actuators: Screen display (questions, tests, diagnoses,


treatments, referrals)

Sensors: Keyboard (entry of symptoms, findings,


patient's answers)

You might also like