Introduction To AI
Introduction To AI
Artificial Intelligence
Course Overview
• Submission
• Electronic Submission on LMS
• Timely submission is important
• Collaborations
• No collaborations on homework assignments, unless group projects
• Spam filtering
• Information retrieval:
• rank web pages based on relevance to query
• Machine translation:
• Google Translate handles more than 100 languages
Users who
Automated
bought ‘A’ ,
Email
also Recommendation Responses
baught ‘B’
Systems
AND
Customer
Service
“You May Representatives Suggested
Also Like” Friends
Similar
Products
• Technological Improvement
• Self driving cars
• Automated Traffic Signals
• Break assist/ collision avoidance, ABS
• in almost all states across the USA, and you can use the updated
Google Assistant
• to make reservations at a restaurant,
• an appointment at a salon,
• and also buy movie tickets.
• Resource optimization
• Robotics
• Firefighting
• Search and rescue
• Disaster management
• Robotic surgery
Sumaira Saeed 22
Spring' 2024
• Synthesia:
• a web-based platform for creating videos with AI avatars
Sumaira Saeed 23
What is artificial intelligence
Strong Vs Weak AI
Artificial intelligence is the study of systems that act in a way that to any
observer would appear to be intelligent.
• Proving Equations
• Playing complex games such as checkers and chess
“Yet we are about to witness the birth of such a machine – a machine capable of
perceiving, recognizing and identifying its surroundings without any human training
or control.”
• End of fundings
• Hardware built for AI also suffered a lost of interest
• Desktop computers from Apple and IBM had been steadily gaining speed and power
• In 1987 they became more powerful than the more expensive Lisp machines made
by Symbolics and others.
• Avoiding the dead ends and selecting the best solution is the result
of the chosen search strategy
• http://www.coolmath-games.com/0-tower-of-hanoi
Sumaira Saeed Spring' 2020 77
The Towers of Hanoi (Partial Search Tree)
• BFS checks each node nearest the root before descending to the
next level
• All the nodes are expanded at a given depth in the search tree
before any nodes at the next level are expanded
d e p
Search
b c e h r q
Tiers
a a h r p q f
p q f q c G
q c G a
3/7/2024 Spring' 2024 96
a
BFS - Comments
d is the
• Complete? depth
• Yes
• Optimal?
• Yes, in a non-weighted graph
• Time Complexity
• O(bd)
• Space Complexity
• O(bd), d is depth of the solution, not the depth of the tree
Implementation: Fringe e
d f
is a LIFO stack S h
p q r
d e p
b c e h r q
a a h r p q f
p q f q c G
q c G a
3/7/2024 Spring' 2024 100
a
DFS – Comments
• Complete?
• No, in case of loops the algorithm cycles indefinitely
• Optimal?
• No
• Space Complexity
• O(bd)
• Time Complexity d is the
• O(bd) depth
• Performs DLS search with increased depth till the goal is found
• Depth begins at one, and keep increasing till either goal is found or no
further nodes can be expanded
• UCS can be applied to find the least-cost path through a graph by maintaining
an ordered list / priority list of nodes in order of descending cost.
• The algorithm measures the actual cost of the path without attempting to
estimate it.
• Is it complete?
• Assuming best solution has a finite cost and minimum arc
cost is positive, yes!
• Is it optimal?
3/7/2024
• Yes! Spring' 2024 134
Romania, use UCS
• The more informed a search method is, the more efficiently it will
search.
Goal State
• A heuristic is a rule of thumb that may help solve a given problem. Heuristics
take problem knowledge into consideration to help guide the search within
the domain.
• For two nodes m and n, and a heuristic function f, if f(m) < f(n), then it should
be the case that m is more likely to be on an optimal path to the goal node
than n.
• Expand next node, n, having the smallest value of f(n). Resolve ties
arbitrarily.
Goal State
e h=1
1
1 3 2
S a d G
h=6 1 h=5 h=2 h=0
1
c b
h=7 h=6
• Example:
X X
X X
X X
X X