Introduction To Artificial Intelligence: The Ability To Solve Problems
Introduction To Artificial Intelligence: The Ability To Solve Problems
Artificial Intelligence
• Represent facts about the world via logic • Rational behavior: doing the right thing
• Decision theory
• Use logical inference as a basis for reasoning about these – Set of states of the world
facts – Set of possible actions an agent can take
- “Amit is IITian; all IITians are intelligent; therefore Amit is – Utility = gain to an agent for each action/state pair
intelligent” – An agent acts rationally if it selects the action that maximizes its “utility”
• Can be a very useful approach to AI • The right thing: that is expected to maximize goal achievement, given
– E.g., theorem-provers the available information
1
12/16/2018
Act
Act like humans Act rationally
• Properties: – robot
– Operating under autonomous control • camera, infrared, etc. for sensors
– Interacts with other agents plus the environment • grippers, wheels, lights, speakers, etc. for actuators
– Persisting over a prolonged time period
– Goal oriented
A B
2
12/16/2018
• What is correct?
function Reflex-Vacuum-Agent([ location,status]) returns an action • The actions that cause the agent to be most
if status = Dirty then return Suck successful
else if location = A then return Right
else if location = B then return Left • So we need ways to measure success.
• An agent, based on its percepts • Rather than how one thinks the agent should behave
action sequence :
– if desirable, it is said to be performing well. • In vacuum-cleaner world
• No universal performance measure for all agents • We want the floor clean, no matter how the agent
behave
• We don’t restrict how the agent behaves
3
12/16/2018
• Percept sequences
• Prior knowledge about the environment • Where is the agent?
• The geography of the environment • Whether the location contains dirt?
• Only two squares
• The effect of the actions • Under this circumstance, the agent is rational.
4
12/16/2018
Medical diagnosis
system
Symptoms,
findings,
Questions, tests,
treatments
Healthy patients,
minimize costs Patient, hospital
1. Table-driven agent
patient's answers
More
2. Simple reflex agent
Satellite image Pixels of varying Print a categorization of Correct Images from sophisticated 3. Reflex agent with internal state
analysis system intensity, color scene categorization orbiting satellite
4. Agent with explicit goals
Part-picking robot Pixels of varying
intensity
Pick up parts and sort
into bins
Place parts in
correct bins
Conveyor belts
with parts
5. Utility-based agent
6. Learning Agent
Temperature,
Refinery controller pressure Open, close valves; Maximize purity, Refinery
readings adjust temperature yield, safety
5
12/16/2018
6
12/16/2018
7
12/16/2018
8
12/16/2018
• Goal: Transport the missionaries and cannibals to • A state description that allows us to describe our
the right bank of the river. state and goal:
• Constrains: (ML,CL,B)
• Whenever cannibals outnumber missionaries, ML : number of missionaries on left bank
the missionaries get eaten CL : number of cannibals on left bank
B: location of boat (L,R)
• Initial State: (3,3,L) Goal: (0,0,R)
Actions (operators):
CCR – transport two cannibals to the right bank
MCL – transport a missionary and a cannibal to the left bank
9
12/16/2018
1 1 Initial
Visited
Fringe
2 3 2 3 Current
Visible
Goal
4 5 6 7 4 5 6 7
Note:
The goal test is
8 9 10 11 12 13 14 15 8 9 10 11 12 13 14 15 positive for this
node, and a
solution is
found in 24
steps.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Fringe: [25,26,27,28,29,30,31]
10
12/16/2018
Breadth-First Depth-First
• continues exploring newly generated nodes
• all the nodes reachable from the current node
– achieved by the TREE-SEARCH method by appending
are explored first
newly generated nodes at the beginning of the search
– achieved by the TREE-SEARCH method by queue
appending newly generated nodes at the end • utilizes a Last-In, First-Out (LIFO) queue, or stack
of the search queue
function BREADTH-FIRST-SEARCH(problem) returns solution function DEPTH-FIRST-SEARCH(problem) returns solution
1 Initial • depth-first goes off into one branch until it reaches a leaf
Visited node
Fringe – not good if the goal is on another branch
2 3 Current – Neither is optimal
Visible – uses much less space than breadth-first
Goal • much fewer visited nodes to keep track of
4 5 6 7 • smaller fringe
• breadth-first is more careful by checking all alternatives
– complete and optimal
8 9 10 11 12 13 14 15
• under most circumstances
– very memory-intensive
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
Thank You
65
11