SlideShare a Scribd company logo
1 of 44
19CS308T: Artificial Intelligence
UNIT-I Introduction
Faculty:Mr.K.Sundar
Syllabus
ā€¢ Introductionā€“Definition ā€“ Future of
Artificial Intelligence ā€“ Characteristics of
Intelligent Agentsā€“ Typical Intelligent
Agents ā€“ Problem Solving Approach to
Typical AI problems - Problem solving
Methods ā€“ Search Strategies ā€“
Uninformed search.
ā€¢ Case study : Water Jug Problem,
Travelling Salesman Problem, etc.
What is artificial intelligence?
ā€¢ Popular conception driven by science ficition
ā€“ Robots good at everything except emotions, empathy,
appreciation of art, culture, ā€¦
ā€¢ ā€¦ until later in the movie.
ā€“ Perhaps more representative of human autism than of
(current) real robotics/AI
ā€¢ ā€œIt is my belief that the existence of autism has
contributed to [the theme of the intelligent but soulless
automaton] in no small way.ā€ [Uta Frith, ā€œAutismā€]
ā€¢ Current AI is also bad at lots of simpler stuff!
ā€¢ There is a lot of AI work on thinking about what other
agents are thinking
Real AI
ā€¢ A serious science.
ā€¢ General-purpose AI like the robots of science
fiction is incredibly hard
ā€“ Human brain appears to have lots of special and
general functions, integrated in some amazing way
that we really do not understand at all (yet)
ā€¢ Special-purpose AI is more doable (nontrivial)
ā€“ E.g., chess/poker playing programs, logistics
planning, automated translation, voice recognition,
web search, data mining, medical diagnosis,
keeping a car on the road, ā€¦ ā€¦ ā€¦ ā€¦
Definitions of AI
Systems that think
like humans
Systems that think
rationally
Systems that act
like humans
Systems that act
rationally
focus on action avoids
philosophical issues
such as ā€œis the system
consciousā€ etc.
if our system can be
more rational than
humans in some
cases, why not?
ā€¢ We will follow ā€œact rationallyā€ approach
ā€“ Distinction may not be that important
ā€¢ acting rationally/like a human presumably requires (some
sort of) thinking rationally/like a human,
ā€¢ humans much more rational anyway in complex domains
ā€œChinese roomā€
argument [Searle 1980]
ā€¢ Person who knows English but not Chinese sits in room
ā€¢ Receives notes in Chinese
ā€¢ Has systematic English rule book for how to write new Chinese
characters based on input Chinese characters, returns his notes
ā€“ Person=CPU, rule book=AI program, really also need lots of paper (storage)
ā€“ Has no understanding of what they mean
ā€“ But from the outside, the room gives perfectly reasonable answers in
Chinese!
ā€¢ Searleā€™s argument: the room has no intelligence in it!
image from http://www.unc.edu/~prinz/pictures/c-room.gif
Turing Test
ā€¢ (Human) judge communicates with a human and a
machine over text-only channel,
ā€¢ Both human and machine try to act like a human,
ā€¢ Judge tries to tell which is which.
ā€¢ Numerous variants
ā€¢ Loebner prize
ā€¢ Current programs nowhere close to passing this
ā€“ http://www.jabberwacky.com/
ā€“ http://turingtrade.org/
image from http://en.wikipedia.org/wiki/Turing_test
Turing Test on unsuspecting judges
ā€¢ It is possible to (temporarily) fool humans who do
not realize they may be talking to a bot
ā€¢ ELIZA program [Weizenbaum 66] rephrases
partnerā€™s statements and questions
(~psychotherapist)
Modern variant: AOLiza
[fragment from http://archives.cnn.com/2000/TECH/computing/08/29/aoliza.idg/]
five: just asking if richard can tell me about some good lobster diving spots thats
it if this is a problem then forget iot i dont know whats going on here
AOLiza: that is interesting. please continue.
five: continue what just ask richard when he gets home about some lobster
diving up hat way thats all if you got a problem with it then forget it,this isnt worht
it i dont know whats been going on or what bev has told you but i havent done
anything to anybody iam the one that got used and dumped
AOLiza: tell me more about that.
five: about what
AOLiza: what do you think?
five: therers nothing to tell she us3ed me then got tired of me said i wasnt her
type anymore i was possesive and controlling
AOLiza: perhaps i already know you were possesive and controlling.
five: i was huh you nuts i gave her all the room she wanted never told nhewre
what to do or where to go
Is Turing Test the right goal?
ā€¢ ā€œAeronautical engineering texts do not define
the goal of their field as making ā€˜machines that
fly so exactly like pigeons that they can fool
even other pigeons.ā€™ā€ [Russell and Norvig]
Lessons from AI research
ā€¢ Clearly-defined tasks that we think require intelligence and education
from humans tend to be doable for AI techniques
ā€“ Playing chess, drawing logical inferences from clearly-stated facts, performing
probability calculations in well-defined environments, ā€¦
ā€“ Although, scalability can be a significant issue
ā€¢ Complex, messy, ambiguous tasks that come natural to humans (in
some cases other animals) are much harder
ā€“ Recognizing your grandmother in a crowd, drawing the right conclusion from an
ungrammatical or ambiguous sentence, driving around the city, ā€¦
ā€¢ Humans better at coming up with reasonably good solutions
in complex environments
ā€¢ Humans better at adapting/self-evaluation/creativity (ā€œMy
usual strategy for chess is getting me into trouble against
this personā€¦ Why? What else can I do?ā€)
Early history of AI
ā€¢ 50s/60s: Early successes! AI can draw logical conclusions,
prove some theorems, create simple plansā€¦ Some initial
work on neural networksā€¦
ā€¢ Led to overhyping: researchers promised funding agencies
spectacular progress, but started running into difficulties:
ā€“ Ambiguity: highly funded translation programs (Russian to English)
were good at syntactic manipulation but bad at disambiguation
ā€¢ ā€œThe spirit is willing but the flesh is weakā€ becomes ā€œThe vodka is good but the
meat is rottenā€
ā€“ Scalability/complexity: early examples were very small, programs could
not scale to bigger instances
ā€“ Limitations of representations used
History of AIā€¦
ā€¢ 70s, 80s: Creation of expert systems (systems
specialized for one particular task based on
expertsā€™ knowledge), wide industry adoption
ā€¢ Again, overpromisingā€¦
ā€¢ ā€¦ led to AI winter(s)
ā€“ Funding cutbacks, bad reputation
Modern AI
ā€¢ More rigorous, scientific, formal/mathematical
ā€¢ Fewer grandiose promises
ā€¢ Divided into many subareas interested in particular
aspects
ā€¢ More directly connected to ā€œneighboringā€ disciplines
ā€“ Theoretical computer science, statistics, economics,
operations research, biology, psychology/neuroscience, ā€¦
ā€“ Often leads to question ā€œIs this really AIā€?
ā€¢ Some senior AI researchers are calling for re-
integration of all these topics, return to more
grandiose goals of AI
ā€“ Somewhat risky proposition for graduate students and
junior facultyā€¦
Intelligent Agent
15
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators shown in Figure[1]
Environm
ent Agent
Sensor
input
percep
ts
actio
n
Figure: Agent interaction with environment
ā€¢ Agent action is decided upon any
input perceived by any agent.
ā€¢ Agent program is the action taken
against that percept sequence
16
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
Agent Function and Agent Program
Good behaviour
1. Rationality: Agent selects action which
maximizes the performance
2. Learn: Agent should learn from perceive
sequences
3. Omniscient: Agent should know the
outcome of its actions
4. Autonomous: Agent should compensate
for half/inaccurate knowledge
17
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
ā€¢ Specifying the task
environment
ā€¢ task environment specification
includes the performance
measure, the external
environment, the actuators,
and the sensors 18
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
Nature of environments
ā€¢ Task performance can be
measured by following
parameters
1. PEAS (Performance,
Environment, Actuators,
Sensors) description
19
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
Nature of environments
ā€¢ Task performance can be
measured by following
parameters
1. PEAS (Performance,
Environnent, actuator,
sensors) description
20
Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park,
Hinjawadi, Pune - 411 057
Nature of environments
Search
ā€¢ We have some actions that can change the state
of the world
ā€“ Change induced by an action perfectly predictable
ā€¢ Try to come up with a sequence of actions that will
lead us to a goal state
ā€“ May want to minimize number of actions
ā€“ More generally, may want to minimize total cost of actions
ā€¢ Do not need to execute actions in real life while
searching for solution!
ā€“ Everything perfectly predictable anyway
A simple example:
traveling on a graph
A
B
C
F
D E
3 4
4
3
9
2
2
start state
goal state
Searching for a solution
A
B
C
F
D
3
3
9
2
2
start state
goal state
Search tree
state = A,
cost = 0
state = B,
cost = 3
state = D,
cost = 3
state = C,
cost = 5
state = F,
cost = 12
state = A,
cost = 7
goal state!
search tree nodes and states are not the same thing!
Full search tree
state = A,
cost = 0
state = B,
cost = 3
state = D,
cost = 3
state = C,
cost = 5
state = F,
cost = 12
state = A,
cost = 7
goal state!
state = E,
cost = 7
state = F,
cost = 11
goal state!
state = B,
cost = 10
state = D,
cost = 10
.
.
.
.
.
.
Changing the goal:
want to visit all vertices on the graph
A
B
C
F
D E
3 4
4
3
9
2
2
need a different definition of a state
ā€œcurrently at A, also visited B, C alreadyā€
large number of states: n*2n-1
could turn these into a graph, butā€¦
Full search tree
state = A, {}
cost = 0
state = B, {A}
cost = 3
state = D, {A}
cost = 3
state = C, {A, B}
cost = 5
state = F, {A, B}
cost = 12
state = A, {B, C}
cost = 7
state = E, {A, D}
cost = 7
state = F, {A, D, E}
cost = 11
state = B, {A, C}
cost = 10
state = D, {A, B, C}
cost = 10
.
.
.
.
.
.
What would happen if the
goal were to visit every
location twice?
Key concepts in search
ā€¢ Set of states that we can be in
ā€“ Including an initial stateā€¦
ā€“ ā€¦ and goal states (equivalently, a goal test)
ā€¢ For every state, a set of actions that we can take
ā€“ Each action results in a new state
ā€“ Typically defined by successor function
ā€¢ Given a state, produces all states that can be reached from it
ā€¢ Cost function that determines the cost of each
action (or path = sequence of actions)
ā€¢ Solution: path from initial state to a goal state
ā€“ Optimal solution: solution with minimal cost
8-puzzle
1 2 3
4 5 6
7 8
1 2
4 5 3
7 8 6
goal state
8-puzzle
1 2
4 5 3
7 8 6
1 5 2
4 3
7 8 6
1 2
4 5 3
7 8 6
1 2
4 5 3
7 8 6
.
.
.
.
.
.
Generic search algorithm
ā€¢ Fringe = set of nodes generated but not expanded
ā€¢ fringe := {initial state}
ā€¢ loop:
ā€“ if fringe empty, declare failure
ā€“ choose and remove a node v from fringe
ā€“ check if vā€™s state s is a goal state; if so, declare success
ā€“ if not, expand v, insert resulting nodes into fringe
ā€¢ Key question in search: Which of the generated
nodes do we expand next?
Uninformed search
ā€¢ Given a state, we only know whether it is a goal
state or not
ā€¢ Cannot say one nongoal state looks better than
another nongoal state
ā€¢ Can only traverse state space blindly in hope of
somehow hitting a goal state at some point
ā€“ Also called blind search
ā€“ Blind does not imply unsystematic!
Breadth-first search
Properties of breadth-first search
ā€¢ Nodes are expanded in the same order in which they are
generated
ā€“ Fringe can be maintained as a First-In-First-Out (FIFO) queue
ā€¢ BFS is complete: if a solution exists, one will be found
ā€¢ BFS finds a shallowest solution
ā€“ Not necessarily an optimal solution
ā€¢ If every node has b successors (the branching factor),
first solution is at depth d, then fringe size will be at least
bd at some point
ā€“ This much space (and time) required ļŒ
Depth-first search
Implementing depth-first search
ā€¢ Fringe can be maintained as a Last-In-First-Out (LIFO)
queue (aka. a stack)
ā€¢ Also easy to implement recursively:
ā€¢ DFS(node)
ā€“ If goal(node) return solution(node);
ā€“ For each successor of node
ā€¢ Return DFS(successor) unless it is failure;
ā€“ Return failure;
Properties of depth-first search
ā€¢ Not complete (might cycle through nongoal states)
ā€¢ If solution found, generally not optimal/shallowest
ā€¢ If every node has b successors (the branching
factor), and we search to at most depth m, fringe
is at most bm
ā€“ Much better space requirement ļŠ
ā€“ Actually, generally donā€™t even need to store all of fringe
ā€¢ Time: still need to look at every node
ā€“ bm + bm-1 + ā€¦ + 1 (for b>1, O(bm))
ā€“ Inevitable for uninformed search methodsā€¦
Combining good properties of BFS and DFS
ā€¢ Limited depth DFS: just like DFS, except never go deeper
than some depth d
ā€¢ Iterative deepening DFS:
ā€“ Call limited depth DFS with depth 0;
ā€“ If unsuccessful, call with depth 1;
ā€“ If unsuccessful, call with depth 2;
ā€“ Etc.
ā€¢ Complete, finds shallowest solution
ā€¢ Space requirements of DFS
ā€¢ May seem wasteful timewise because replicating effort
ā€“ Really not that wasteful because almost all effort at deepest level
ā€“ db + (d-1)b2 + (d-2)b3 + ... + 1bd is O(bd) for b > 1
Letā€™s start thinking about cost
ā€¢ BFS finds shallowest solution because always works on
shallowest nodes first
ā€¢ Similar idea: always work on the lowest-cost node first
(uniform-cost search)
ā€¢ Will find optimal solution (assuming costs increase by at
least constant amount along path)
ā€¢ Will often pursue lots of short steps first
ā€¢ If optimal cost is C, and cost increases by at least L each
step, we can go to depth C/L
ā€¢ Similar memory problems as BFS
ā€“ Iterative lengthening DFS does DFS up to increasing costs
Searching backwards from the goal
ā€¢ Sometimes can search backwards from the goal
ā€“ Maze puzzles
ā€“ Eights puzzle
ā€“ Reaching location F
ā€“ What about the goal of ā€œhaving visited all locationsā€?
ā€¢ Need to be able to compute predecessors instead
of successors
ā€¢ Whatā€™s the point?
Predecessor branching factor can be
smaller than successor branching factor
ā€¢ Stacking blocks:
ā€“ only action is to add something to the stack
A
B
C
In hand: nothing
In hand: A, B, C
Start state Goal state
Weā€™ll see more of thisā€¦
Bidirectional search
ā€¢ Even better: search from both the start and the
goal, in parallel!
ā€¢ If the shallowest solution has depth d and
branching factor is b on both sides, requires only
O(bd/2) nodes to be explored!
image from cs-alb-pc3.massey.ac.nz/notes/59302/fig03.17.gif
Making bidirectional search work
ā€¢ Need to be able to figure out whether the fringes
intersect
ā€“ Need to keep at least one fringe in memoryā€¦
ā€¢ Other than that, can do various kinds of search on
either tree, and get the corresponding optimality
etc. guarantees
ā€¢ Not possible (feasible) if backwards search not
possible (feasible)
ā€“ Hard to compute predecessors
ā€“ High predecessor branching factor
ā€“ Too many goal states
Repeated states
ā€¢ Repeated states can cause incompleteness or enormous
runtimes
ā€¢ Can maintain list of previously visited states to avoid this
ā€“ If new path to the same state has greater cost, donā€™t pursue it further
ā€“ Leads to time/space tradeoff
ā€¢ ā€œAlgorithms that forget their history are doomed to repeat
itā€ [Russell and Norvig]
A
B
C
3
2
2
cycles exponentially large search trees (try it!)

More Related Content

What's hot

Lecture 1
Lecture 1Lecture 1
Lecture 1Bilal Riaz
Ā 
Artificial intelligence(02)
Artificial intelligence(02)Artificial intelligence(02)
Artificial intelligence(02)Nazir Ahmed
Ā 
HPAI Class 2 - human aspects and computing systems in ai - 012920
HPAI  Class 2 - human aspects and computing systems in ai - 012920HPAI  Class 2 - human aspects and computing systems in ai - 012920
HPAI Class 2 - human aspects and computing systems in ai - 012920melendez321
Ā 
Turing Test : From A.I. to Beyond !
Turing Test : From A.I. to Beyond !Turing Test : From A.I. to Beyond !
Turing Test : From A.I. to Beyond !Abhishek Singh
Ā 
Hpai class 14 - brain cells and memory - 031620
Hpai   class 14 - brain cells and memory - 031620Hpai   class 14 - brain cells and memory - 031620
Hpai class 14 - brain cells and memory - 031620melendez321
Ā 
Hpai class 4 - text classification w colab - 020520 and in class demo
Hpai   class 4 - text classification w colab - 020520 and in class demoHpai   class 4 - text classification w colab - 020520 and in class demo
Hpai class 4 - text classification w colab - 020520 and in class demomelendez321
Ā 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligenceInbavalli Valli
Ā 
Intro artificial intelligence
Intro artificial intelligenceIntro artificial intelligence
Intro artificial intelligenceFraz Ali
Ā 
Hpai class 3 - modeling, decision making, and agi - 020320
Hpai   class 3 - modeling, decision making, and agi - 020320Hpai   class 3 - modeling, decision making, and agi - 020320
Hpai class 3 - modeling, decision making, and agi - 020320melendez321
Ā 
Dialogare con agenti artificiali
Dialogare con agenti artificiali  Dialogare con agenti artificiali
Dialogare con agenti artificiali Agnese Augello
Ā 
Artificial general intelligence research project at Keen Software House (3/2015)
Artificial general intelligence research project at Keen Software House (3/2015)Artificial general intelligence research project at Keen Software House (3/2015)
Artificial general intelligence research project at Keen Software House (3/2015)Marek Rosa
Ā 
Human and Artificial Intelligence
Human and Artificial IntelligenceHuman and Artificial Intelligence
Human and Artificial Intelligenceorengomoises
Ā 
Hpai class 13 - perception ii - 033020
Hpai   class 13 - perception ii - 033020Hpai   class 13 - perception ii - 033020
Hpai class 13 - perception ii - 033020melendez321
Ā 
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...Drew Miller
Ā 
Lecture01. introduction
Lecture01. introductionLecture01. introduction
Lecture01. introductionNguyen Ngo Dinh
Ā 
M1 intro
M1 introM1 intro
M1 introYasir Khan
Ā 

What's hot (20)

Lecture 1
Lecture 1Lecture 1
Lecture 1
Ā 
Artificial intelligence(02)
Artificial intelligence(02)Artificial intelligence(02)
Artificial intelligence(02)
Ā 
HPAI Class 2 - human aspects and computing systems in ai - 012920
HPAI  Class 2 - human aspects and computing systems in ai - 012920HPAI  Class 2 - human aspects and computing systems in ai - 012920
HPAI Class 2 - human aspects and computing systems in ai - 012920
Ā 
Turing Test : From A.I. to Beyond !
Turing Test : From A.I. to Beyond !Turing Test : From A.I. to Beyond !
Turing Test : From A.I. to Beyond !
Ā 
Hpai class 14 - brain cells and memory - 031620
Hpai   class 14 - brain cells and memory - 031620Hpai   class 14 - brain cells and memory - 031620
Hpai class 14 - brain cells and memory - 031620
Ā 
Hpai class 4 - text classification w colab - 020520 and in class demo
Hpai   class 4 - text classification w colab - 020520 and in class demoHpai   class 4 - text classification w colab - 020520 and in class demo
Hpai class 4 - text classification w colab - 020520 and in class demo
Ā 
14 phil of A I
14 phil of A I14 phil of A I
14 phil of A I
Ā 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
Ā 
Intro artificial intelligence
Intro artificial intelligenceIntro artificial intelligence
Intro artificial intelligence
Ā 
Hpai class 3 - modeling, decision making, and agi - 020320
Hpai   class 3 - modeling, decision making, and agi - 020320Hpai   class 3 - modeling, decision making, and agi - 020320
Hpai class 3 - modeling, decision making, and agi - 020320
Ā 
Dialogare con agenti artificiali
Dialogare con agenti artificiali  Dialogare con agenti artificiali
Dialogare con agenti artificiali
Ā 
Lecture 01
Lecture 01Lecture 01
Lecture 01
Ā 
Artificial general intelligence research project at Keen Software House (3/2015)
Artificial general intelligence research project at Keen Software House (3/2015)Artificial general intelligence research project at Keen Software House (3/2015)
Artificial general intelligence research project at Keen Software House (3/2015)
Ā 
Human and Artificial Intelligence
Human and Artificial IntelligenceHuman and Artificial Intelligence
Human and Artificial Intelligence
Ā 
01 introduction
01 introduction01 introduction
01 introduction
Ā 
Ai intro
Ai introAi intro
Ai intro
Ā 
Hpai class 13 - perception ii - 033020
Hpai   class 13 - perception ii - 033020Hpai   class 13 - perception ii - 033020
Hpai class 13 - perception ii - 033020
Ā 
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...
November 15th 2018 denver cu seminar (drew miller) ai robotics cryptocurrency...
Ā 
Lecture01. introduction
Lecture01. introductionLecture01. introduction
Lecture01. introduction
Ā 
M1 intro
M1 introM1 intro
M1 intro
Ā 

Similar to Unit I Introduction to AI K.Sundar,AP/CSE,VEC

intro (1).ppt
intro (1).pptintro (1).ppt
intro (1).pptburakkrk6
Ā 
01_Artificial_Intelligence-Introduction.ppt
01_Artificial_Intelligence-Introduction.ppt01_Artificial_Intelligence-Introduction.ppt
01_Artificial_Intelligence-Introduction.pptMemMem25
Ā 
AI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxAI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxnireekshan1
Ā 
Artificail Intelligent lec-1
Artificail Intelligent lec-1Artificail Intelligent lec-1
Artificail Intelligent lec-1tjunicornfx
Ā 
Artificial intellegence
Artificial intellegenceArtificial intellegence
Artificial intellegencegeetinsaa
Ā 
AI Introduction
AI Introduction AI Introduction
AI Introduction Nashrah Habib
Ā 
l1.pptx
l1.pptxl1.pptx
l1.pptxoluobes
Ā 
AI.ppt
AI.pptAI.ppt
AI.pptMard Geer
Ā 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introductionRujalShrestha2
Ā 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligenceConestoga Collage
Ā 
LEC_2_AI_INTRODUCTION - Copy.pptx
LEC_2_AI_INTRODUCTION - Copy.pptxLEC_2_AI_INTRODUCTION - Copy.pptx
LEC_2_AI_INTRODUCTION - Copy.pptxAjaykumar967485
Ā 
Artificial intelligence(01)
Artificial intelligence(01)Artificial intelligence(01)
Artificial intelligence(01)Nazir Ahmed
Ā 
Lecture 1. Introduction to AI and it's applications.ppt
Lecture 1. Introduction to AI and it's applications.pptLecture 1. Introduction to AI and it's applications.ppt
Lecture 1. Introduction to AI and it's applications.pptDebabrataPain1
Ā 
Module-1.1.pdf of aiml engineering mod 1
Module-1.1.pdf of aiml engineering mod 1Module-1.1.pdf of aiml engineering mod 1
Module-1.1.pdf of aiml engineering mod 1fariyaPatel
Ā 
AI Slides till 27-Mar.pptx
AI Slides till 27-Mar.pptxAI Slides till 27-Mar.pptx
AI Slides till 27-Mar.pptxMuhammadRiaz237
Ā 

Similar to Unit I Introduction to AI K.Sundar,AP/CSE,VEC (20)

chatcptkk.ppt
chatcptkk.pptchatcptkk.ppt
chatcptkk.ppt
Ā 
intro (1).ppt
intro (1).pptintro (1).ppt
intro (1).ppt
Ā 
01_Artificial_Intelligence-Introduction.ppt
01_Artificial_Intelligence-Introduction.ppt01_Artificial_Intelligence-Introduction.ppt
01_Artificial_Intelligence-Introduction.ppt
Ā 
AI ROUGH NOTES.pptx
AI ROUGH NOTES.pptxAI ROUGH NOTES.pptx
AI ROUGH NOTES.pptx
Ā 
Artificail Intelligent lec-1
Artificail Intelligent lec-1Artificail Intelligent lec-1
Artificail Intelligent lec-1
Ā 
Artificial intellegence
Artificial intellegenceArtificial intellegence
Artificial intellegence
Ā 
AI Introduction
AI Introduction AI Introduction
AI Introduction
Ā 
l1.pptx
l1.pptxl1.pptx
l1.pptx
Ā 
l1.pptx
l1.pptxl1.pptx
l1.pptx
Ā 
l1.pptx
l1.pptxl1.pptx
l1.pptx
Ā 
AI.ppt
AI.pptAI.ppt
AI.ppt
Ā 
Artificial intelligence introduction
Artificial intelligence introductionArtificial intelligence introduction
Artificial intelligence introduction
Ā 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
Ā 
l1.pptx
l1.pptxl1.pptx
l1.pptx
Ā 
LEC_2_AI_INTRODUCTION - Copy.pptx
LEC_2_AI_INTRODUCTION - Copy.pptxLEC_2_AI_INTRODUCTION - Copy.pptx
LEC_2_AI_INTRODUCTION - Copy.pptx
Ā 
Artificial intelligence(01)
Artificial intelligence(01)Artificial intelligence(01)
Artificial intelligence(01)
Ā 
Lecture 1. Introduction to AI and it's applications.ppt
Lecture 1. Introduction to AI and it's applications.pptLecture 1. Introduction to AI and it's applications.ppt
Lecture 1. Introduction to AI and it's applications.ppt
Ā 
Module-1.1.pdf of aiml engineering mod 1
Module-1.1.pdf of aiml engineering mod 1Module-1.1.pdf of aiml engineering mod 1
Module-1.1.pdf of aiml engineering mod 1
Ā 
AI Slides till 27-Mar.pptx
AI Slides till 27-Mar.pptxAI Slides till 27-Mar.pptx
AI Slides till 27-Mar.pptx
Ā 
Unit 2 ai
Unit 2 aiUnit 2 ai
Unit 2 ai
Ā 

Recently uploaded

Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
Ā 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
Ā 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadhamedmustafa094
Ā 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
Ā 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
Ā 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
Ā 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
Ā 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
Ā 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
Ā 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
Ā 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
Ā 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
Ā 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
Ā 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
Ā 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
Ā 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
Ā 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
Ā 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
Ā 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
Ā 

Recently uploaded (20)

Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
Ā 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
Ā 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
Ā 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Ā 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
Ā 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
Ā 
Call Girls in South Ex (delhi) call me [šŸ”9953056974šŸ”] escort service 24X7
Call Girls in South Ex (delhi) call me [šŸ”9953056974šŸ”] escort service 24X7Call Girls in South Ex (delhi) call me [šŸ”9953056974šŸ”] escort service 24X7
Call Girls in South Ex (delhi) call me [šŸ”9953056974šŸ”] escort service 24X7
Ā 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
Ā 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Ā 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
Ā 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
Ā 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
Ā 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
Ā 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
Ā 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Ā 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
Ā 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
Ā 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
Ā 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
Ā 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
Ā 

Unit I Introduction to AI K.Sundar,AP/CSE,VEC

  • 1. 19CS308T: Artificial Intelligence UNIT-I Introduction Faculty:Mr.K.Sundar
  • 2. Syllabus ā€¢ Introductionā€“Definition ā€“ Future of Artificial Intelligence ā€“ Characteristics of Intelligent Agentsā€“ Typical Intelligent Agents ā€“ Problem Solving Approach to Typical AI problems - Problem solving Methods ā€“ Search Strategies ā€“ Uninformed search. ā€¢ Case study : Water Jug Problem, Travelling Salesman Problem, etc.
  • 3. What is artificial intelligence? ā€¢ Popular conception driven by science ficition ā€“ Robots good at everything except emotions, empathy, appreciation of art, culture, ā€¦ ā€¢ ā€¦ until later in the movie. ā€“ Perhaps more representative of human autism than of (current) real robotics/AI ā€¢ ā€œIt is my belief that the existence of autism has contributed to [the theme of the intelligent but soulless automaton] in no small way.ā€ [Uta Frith, ā€œAutismā€] ā€¢ Current AI is also bad at lots of simpler stuff! ā€¢ There is a lot of AI work on thinking about what other agents are thinking
  • 4. Real AI ā€¢ A serious science. ā€¢ General-purpose AI like the robots of science fiction is incredibly hard ā€“ Human brain appears to have lots of special and general functions, integrated in some amazing way that we really do not understand at all (yet) ā€¢ Special-purpose AI is more doable (nontrivial) ā€“ E.g., chess/poker playing programs, logistics planning, automated translation, voice recognition, web search, data mining, medical diagnosis, keeping a car on the road, ā€¦ ā€¦ ā€¦ ā€¦
  • 5. Definitions of AI Systems that think like humans Systems that think rationally Systems that act like humans Systems that act rationally focus on action avoids philosophical issues such as ā€œis the system consciousā€ etc. if our system can be more rational than humans in some cases, why not? ā€¢ We will follow ā€œact rationallyā€ approach ā€“ Distinction may not be that important ā€¢ acting rationally/like a human presumably requires (some sort of) thinking rationally/like a human, ā€¢ humans much more rational anyway in complex domains
  • 6. ā€œChinese roomā€ argument [Searle 1980] ā€¢ Person who knows English but not Chinese sits in room ā€¢ Receives notes in Chinese ā€¢ Has systematic English rule book for how to write new Chinese characters based on input Chinese characters, returns his notes ā€“ Person=CPU, rule book=AI program, really also need lots of paper (storage) ā€“ Has no understanding of what they mean ā€“ But from the outside, the room gives perfectly reasonable answers in Chinese! ā€¢ Searleā€™s argument: the room has no intelligence in it! image from http://www.unc.edu/~prinz/pictures/c-room.gif
  • 7. Turing Test ā€¢ (Human) judge communicates with a human and a machine over text-only channel, ā€¢ Both human and machine try to act like a human, ā€¢ Judge tries to tell which is which. ā€¢ Numerous variants ā€¢ Loebner prize ā€¢ Current programs nowhere close to passing this ā€“ http://www.jabberwacky.com/ ā€“ http://turingtrade.org/ image from http://en.wikipedia.org/wiki/Turing_test
  • 8. Turing Test on unsuspecting judges ā€¢ It is possible to (temporarily) fool humans who do not realize they may be talking to a bot ā€¢ ELIZA program [Weizenbaum 66] rephrases partnerā€™s statements and questions (~psychotherapist)
  • 9. Modern variant: AOLiza [fragment from http://archives.cnn.com/2000/TECH/computing/08/29/aoliza.idg/] five: just asking if richard can tell me about some good lobster diving spots thats it if this is a problem then forget iot i dont know whats going on here AOLiza: that is interesting. please continue. five: continue what just ask richard when he gets home about some lobster diving up hat way thats all if you got a problem with it then forget it,this isnt worht it i dont know whats been going on or what bev has told you but i havent done anything to anybody iam the one that got used and dumped AOLiza: tell me more about that. five: about what AOLiza: what do you think? five: therers nothing to tell she us3ed me then got tired of me said i wasnt her type anymore i was possesive and controlling AOLiza: perhaps i already know you were possesive and controlling. five: i was huh you nuts i gave her all the room she wanted never told nhewre what to do or where to go
  • 10. Is Turing Test the right goal? ā€¢ ā€œAeronautical engineering texts do not define the goal of their field as making ā€˜machines that fly so exactly like pigeons that they can fool even other pigeons.ā€™ā€ [Russell and Norvig]
  • 11. Lessons from AI research ā€¢ Clearly-defined tasks that we think require intelligence and education from humans tend to be doable for AI techniques ā€“ Playing chess, drawing logical inferences from clearly-stated facts, performing probability calculations in well-defined environments, ā€¦ ā€“ Although, scalability can be a significant issue ā€¢ Complex, messy, ambiguous tasks that come natural to humans (in some cases other animals) are much harder ā€“ Recognizing your grandmother in a crowd, drawing the right conclusion from an ungrammatical or ambiguous sentence, driving around the city, ā€¦ ā€¢ Humans better at coming up with reasonably good solutions in complex environments ā€¢ Humans better at adapting/self-evaluation/creativity (ā€œMy usual strategy for chess is getting me into trouble against this personā€¦ Why? What else can I do?ā€)
  • 12. Early history of AI ā€¢ 50s/60s: Early successes! AI can draw logical conclusions, prove some theorems, create simple plansā€¦ Some initial work on neural networksā€¦ ā€¢ Led to overhyping: researchers promised funding agencies spectacular progress, but started running into difficulties: ā€“ Ambiguity: highly funded translation programs (Russian to English) were good at syntactic manipulation but bad at disambiguation ā€¢ ā€œThe spirit is willing but the flesh is weakā€ becomes ā€œThe vodka is good but the meat is rottenā€ ā€“ Scalability/complexity: early examples were very small, programs could not scale to bigger instances ā€“ Limitations of representations used
  • 13. History of AIā€¦ ā€¢ 70s, 80s: Creation of expert systems (systems specialized for one particular task based on expertsā€™ knowledge), wide industry adoption ā€¢ Again, overpromisingā€¦ ā€¢ ā€¦ led to AI winter(s) ā€“ Funding cutbacks, bad reputation
  • 14. Modern AI ā€¢ More rigorous, scientific, formal/mathematical ā€¢ Fewer grandiose promises ā€¢ Divided into many subareas interested in particular aspects ā€¢ More directly connected to ā€œneighboringā€ disciplines ā€“ Theoretical computer science, statistics, economics, operations research, biology, psychology/neuroscience, ā€¦ ā€“ Often leads to question ā€œIs this really AIā€? ā€¢ Some senior AI researchers are calling for re- integration of all these topics, return to more grandiose goals of AI ā€“ Somewhat risky proposition for graduate students and junior facultyā€¦
  • 15. Intelligent Agent 15 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators shown in Figure[1] Environm ent Agent Sensor input percep ts actio n Figure: Agent interaction with environment
  • 16. ā€¢ Agent action is decided upon any input perceived by any agent. ā€¢ Agent program is the action taken against that percept sequence 16 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Agent Function and Agent Program
  • 17. Good behaviour 1. Rationality: Agent selects action which maximizes the performance 2. Learn: Agent should learn from perceive sequences 3. Omniscient: Agent should know the outcome of its actions 4. Autonomous: Agent should compensate for half/inaccurate knowledge 17 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057
  • 18. ā€¢ Specifying the task environment ā€¢ task environment specification includes the performance measure, the external environment, the actuators, and the sensors 18 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Nature of environments
  • 19. ā€¢ Task performance can be measured by following parameters 1. PEAS (Performance, Environment, Actuators, Sensors) description 19 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Nature of environments
  • 20. ā€¢ Task performance can be measured by following parameters 1. PEAS (Performance, Environnent, actuator, sensors) description 20 Hope Foundationā€™s International Institute of Information Technology, IĀ²IT, P-14 Rajiv Gandhi Infotech Park, Hinjawadi, Pune - 411 057 Nature of environments
  • 21. Search ā€¢ We have some actions that can change the state of the world ā€“ Change induced by an action perfectly predictable ā€¢ Try to come up with a sequence of actions that will lead us to a goal state ā€“ May want to minimize number of actions ā€“ More generally, may want to minimize total cost of actions ā€¢ Do not need to execute actions in real life while searching for solution! ā€“ Everything perfectly predictable anyway
  • 22. A simple example: traveling on a graph A B C F D E 3 4 4 3 9 2 2 start state goal state
  • 23. Searching for a solution A B C F D 3 3 9 2 2 start state goal state
  • 24. Search tree state = A, cost = 0 state = B, cost = 3 state = D, cost = 3 state = C, cost = 5 state = F, cost = 12 state = A, cost = 7 goal state! search tree nodes and states are not the same thing!
  • 25. Full search tree state = A, cost = 0 state = B, cost = 3 state = D, cost = 3 state = C, cost = 5 state = F, cost = 12 state = A, cost = 7 goal state! state = E, cost = 7 state = F, cost = 11 goal state! state = B, cost = 10 state = D, cost = 10 . . . . . .
  • 26. Changing the goal: want to visit all vertices on the graph A B C F D E 3 4 4 3 9 2 2 need a different definition of a state ā€œcurrently at A, also visited B, C alreadyā€ large number of states: n*2n-1 could turn these into a graph, butā€¦
  • 27. Full search tree state = A, {} cost = 0 state = B, {A} cost = 3 state = D, {A} cost = 3 state = C, {A, B} cost = 5 state = F, {A, B} cost = 12 state = A, {B, C} cost = 7 state = E, {A, D} cost = 7 state = F, {A, D, E} cost = 11 state = B, {A, C} cost = 10 state = D, {A, B, C} cost = 10 . . . . . . What would happen if the goal were to visit every location twice?
  • 28. Key concepts in search ā€¢ Set of states that we can be in ā€“ Including an initial stateā€¦ ā€“ ā€¦ and goal states (equivalently, a goal test) ā€¢ For every state, a set of actions that we can take ā€“ Each action results in a new state ā€“ Typically defined by successor function ā€¢ Given a state, produces all states that can be reached from it ā€¢ Cost function that determines the cost of each action (or path = sequence of actions) ā€¢ Solution: path from initial state to a goal state ā€“ Optimal solution: solution with minimal cost
  • 29. 8-puzzle 1 2 3 4 5 6 7 8 1 2 4 5 3 7 8 6 goal state
  • 30. 8-puzzle 1 2 4 5 3 7 8 6 1 5 2 4 3 7 8 6 1 2 4 5 3 7 8 6 1 2 4 5 3 7 8 6 . . . . . .
  • 31. Generic search algorithm ā€¢ Fringe = set of nodes generated but not expanded ā€¢ fringe := {initial state} ā€¢ loop: ā€“ if fringe empty, declare failure ā€“ choose and remove a node v from fringe ā€“ check if vā€™s state s is a goal state; if so, declare success ā€“ if not, expand v, insert resulting nodes into fringe ā€¢ Key question in search: Which of the generated nodes do we expand next?
  • 32. Uninformed search ā€¢ Given a state, we only know whether it is a goal state or not ā€¢ Cannot say one nongoal state looks better than another nongoal state ā€¢ Can only traverse state space blindly in hope of somehow hitting a goal state at some point ā€“ Also called blind search ā€“ Blind does not imply unsystematic!
  • 34. Properties of breadth-first search ā€¢ Nodes are expanded in the same order in which they are generated ā€“ Fringe can be maintained as a First-In-First-Out (FIFO) queue ā€¢ BFS is complete: if a solution exists, one will be found ā€¢ BFS finds a shallowest solution ā€“ Not necessarily an optimal solution ā€¢ If every node has b successors (the branching factor), first solution is at depth d, then fringe size will be at least bd at some point ā€“ This much space (and time) required ļŒ
  • 36. Implementing depth-first search ā€¢ Fringe can be maintained as a Last-In-First-Out (LIFO) queue (aka. a stack) ā€¢ Also easy to implement recursively: ā€¢ DFS(node) ā€“ If goal(node) return solution(node); ā€“ For each successor of node ā€¢ Return DFS(successor) unless it is failure; ā€“ Return failure;
  • 37. Properties of depth-first search ā€¢ Not complete (might cycle through nongoal states) ā€¢ If solution found, generally not optimal/shallowest ā€¢ If every node has b successors (the branching factor), and we search to at most depth m, fringe is at most bm ā€“ Much better space requirement ļŠ ā€“ Actually, generally donā€™t even need to store all of fringe ā€¢ Time: still need to look at every node ā€“ bm + bm-1 + ā€¦ + 1 (for b>1, O(bm)) ā€“ Inevitable for uninformed search methodsā€¦
  • 38. Combining good properties of BFS and DFS ā€¢ Limited depth DFS: just like DFS, except never go deeper than some depth d ā€¢ Iterative deepening DFS: ā€“ Call limited depth DFS with depth 0; ā€“ If unsuccessful, call with depth 1; ā€“ If unsuccessful, call with depth 2; ā€“ Etc. ā€¢ Complete, finds shallowest solution ā€¢ Space requirements of DFS ā€¢ May seem wasteful timewise because replicating effort ā€“ Really not that wasteful because almost all effort at deepest level ā€“ db + (d-1)b2 + (d-2)b3 + ... + 1bd is O(bd) for b > 1
  • 39. Letā€™s start thinking about cost ā€¢ BFS finds shallowest solution because always works on shallowest nodes first ā€¢ Similar idea: always work on the lowest-cost node first (uniform-cost search) ā€¢ Will find optimal solution (assuming costs increase by at least constant amount along path) ā€¢ Will often pursue lots of short steps first ā€¢ If optimal cost is C, and cost increases by at least L each step, we can go to depth C/L ā€¢ Similar memory problems as BFS ā€“ Iterative lengthening DFS does DFS up to increasing costs
  • 40. Searching backwards from the goal ā€¢ Sometimes can search backwards from the goal ā€“ Maze puzzles ā€“ Eights puzzle ā€“ Reaching location F ā€“ What about the goal of ā€œhaving visited all locationsā€? ā€¢ Need to be able to compute predecessors instead of successors ā€¢ Whatā€™s the point?
  • 41. Predecessor branching factor can be smaller than successor branching factor ā€¢ Stacking blocks: ā€“ only action is to add something to the stack A B C In hand: nothing In hand: A, B, C Start state Goal state Weā€™ll see more of thisā€¦
  • 42. Bidirectional search ā€¢ Even better: search from both the start and the goal, in parallel! ā€¢ If the shallowest solution has depth d and branching factor is b on both sides, requires only O(bd/2) nodes to be explored! image from cs-alb-pc3.massey.ac.nz/notes/59302/fig03.17.gif
  • 43. Making bidirectional search work ā€¢ Need to be able to figure out whether the fringes intersect ā€“ Need to keep at least one fringe in memoryā€¦ ā€¢ Other than that, can do various kinds of search on either tree, and get the corresponding optimality etc. guarantees ā€¢ Not possible (feasible) if backwards search not possible (feasible) ā€“ Hard to compute predecessors ā€“ High predecessor branching factor ā€“ Too many goal states
  • 44. Repeated states ā€¢ Repeated states can cause incompleteness or enormous runtimes ā€¢ Can maintain list of previously visited states to avoid this ā€“ If new path to the same state has greater cost, donā€™t pursue it further ā€“ Leads to time/space tradeoff ā€¢ ā€œAlgorithms that forget their history are doomed to repeat itā€ [Russell and Norvig] A B C 3 2 2 cycles exponentially large search trees (try it!)