AI Module 1 Lecture 3
AI Module 1 Lecture 3
(CSE)
Artificial Intelligence CSE401
Module 1
Scope of AI & Problem Solving
LEARNING OUTCOMES
Problem solving
Problem Characteristics
Theorem Proving
A lemma that has been proved can be ignored for next
steps.
Ignorable!
Amity School of Engineering and Technology
The 8-Puzzle
Recoverable!
Amity School of Engineering and Technology
Playing Chess
Moves cannot be retracted.
Irrecoverable!
Amity School of Engineering and Technology
The 8-Puzzle
Every time we make a move, we know exactly what will
happen.
Certain outcome!
Amity School of Engineering and Technology
Playing Bridge
Uncertain outcome!
Amity School of Engineering and Technology
Is Marcus alive?
Amity School of Engineering and Technology
Is Marcus alive?
Different reasoning paths lead to the answer. It does not
matter which path we follow.
Amity School of Engineering and Technology
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.
Amity School of Engineering and Technology
•A set of all possible states for a given problem is known as the state
space of the problem.
8-puzzle problem
8-puzzle problem
Amity School of Engineering and Technology
Amity School of Engineering and Technology
Amity School of Engineering and Technology
Puzzle-solving as Search
7. (x, y) ----->(4, y -(4 - x)) pour water from the 3- gallon jug into the 4-gallon
if x + y >= 4, y > 0 jug until the 4-gallon jug is full
8. (x, y) ----->(x - (3 - y), 3) pour water from the 4- gallon jug into the 3-gallon
if x + y >= 3, x > 0 jug until the 3-gallon jug is full
9. (x, y) ----->(x + y, 0) pour all the water from the 3-gallon jug into the 4-
if x + y <= 4, y > 0 gallon jug
10. (x, y) ----->(0, x + y) pour all the water from the 4-gallon jug into the 3-
if x + y <= 3, x > 0 gallon jug
11. (0, 2) ----->(2, 0) pour the 2 gallons from the 3-gallon jug into the 4-
gallon jug
12. (2, y) ----->(0, y) empty the 2 gallons in the 4 gallon jug on the
ground
Amity School of Engineering and Technology
Gallons in the 4-Gallon Jug Gallons in the 3-Gallon Jug Rule Applied
0 0 ?
0 3 ?
3 0 ?
3 3 ?
4 2 ?
0 2 ?
2
Amity School of Engineering and Technology
Gallons in the 4-Gallon Jug Gallons in the 3-Gallon Jug Rule Applied
0 0 2
0 3 9
3 0 2
3 3 7
4 2 5
0 2 9
2
Amity School of Engineering and Technology
States
•A state can be represented by the number of missionaries and
cannibals on each side of the river
Bank of river -----> indicates whether the boat in the left bank or
right bank 0 -----> left bank, 1 -----> right bank
•Initial state (3,3,0)
•Goal state: (0,0,0)
Amity School of Engineering and Technology
Operations
Solution
1.(3, 3,0) ----> (0,0,1) Initial state
2.(3, 1,0) ----> (0,2,1) two cannibal will go
3.(3,2,0) ----> (0,1,1) one cannibal will return
4.(3,0,0) ---->(0,3,1) two cannibal will go
5.(3,1,0) ---->(0,2,1) one cannibal will return
6.(1,1,0) ---->(2,2,1) two Missionaries will go
7.(2,2,0) ---->(1,1,1) one cannibal and one Missionaries will return
8.(0,2,0) ---->(3,1,1) two Missionaries will go
9.(0,3,0) ----> (3,0,1) one cannibal will return
10.(0,1,0) ---->(3,2,1) two cannibal will go
11.(0,2,0) ---->(3,1,1) one cannibal will return
12.(0,0,0) ---->(3,3,1) two cannibal will go
Amity School of Engineering and Technology
n-queens
•States: 4 queens in 4 columns (44 = 256 states)
•Actions: move queen in column
•Goal test: no attacks
•Evaluation: h(n) = number of attacks
Thank You