Artificial intelligence (AI) is the study of how to make computers perform tasks that typically require human intelligence, such as visual perception, decision-making, and problem solving. The document provides examples of problems that can be solved using state space search techniques in AI, including the water jug problem of getting a specific amount of water into a jug, and traversing a maze to reach the goal. State space search formulates the problem as an initial state, goal state, and rules to move between states. Blind and heuristic search methods like breadth-first and depth-first are then used to systematically explore the state space to find a solution.
3. WHAT IS AI?
AI is the study of how to make
computers make things which at the
moment people do better.
4. DEFINING THE PROBLEM
Defining the problem as State Space Search
Initial state
Goal state
Rules: Matching ----- forward ----> Action
5. EXAMPLE (1): WATER JUG PROBLEM
If you have 2 jugs (4 gallon - 3 gallon), how can you get
exactly 2 gallons into the 4 gallon jug?
The state space for this problem can be described as the
set of ordered pairs of integers (x,y) such that
x = 0, 1,2, 3 or 4 and y = 0,1,2 or 3; x represents the
number of gallons of water in the 4-gallon jug and y
represents the quantity of water in 3-gallon jug
The start state is (0,0)
The goal state is (2,n)
6. PRODUCTION RULES FOR WATER JUG PROBLEM
No Current state Next State Description
1 (x,y) if x < 4 (4,y) Fill the 4 gallon jug
2 (x,y) if y <3 (x,3) Fill the 3 gallon jug
3 (x,y) if x > 0 (x-d, y) Pour some water out of the 4 gallon jug
4 (x,y) if y > 0 (x, y-d) Pour some water out of the 3-gallon jug
5 (x,y) if x>0 (0, y) Empty the 4 gallon jug
6 (x,y) if y >0 (x,0) Empty the 3 gallon jug on the ground
7 (x,y) if x+y >= 4 and y >0 (4, y-(4-x)) Pour water from the 3 gallon jug into the 4 gallon
jug until the 4-gallon jug is full
8 (x, y) if x+y >= 3 and x>0 (x-(3-y), 3) Pour water from the 4-gallon jug into the 3-gallon
jug until the 3-gallon jug is full
9 (x, y) if x+y <=4 and y>0 (x+y, 0) Pour all the water from the 3-gallon jug into the 4-
gallon jug
10 (x, y) if x+y <= 3 and x>0 (0, x+y) Pour all the water from the 4-gallon jug into the 3-
gallon jug
7. TO SOLVE THE WATER JUG PROBLEM
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 0
14. EXAMPLE (2): WATER JUG PROBLEM
You are given three jugs, a 10-gallon one,
7-gallon one, and 3-gallon one.
Neither have any measuring markers on it.
There is a pump that can used to fill the jugs
with water.
Use Breadth First and Depth First search to get
exactly 5-gallons of water into 7-gallon jug.
The start state is (0,0,0)
The goal state is (n,5,n)
15. EXAMPLE (3): TRAVERSING A MAZE
The wall follower, the best-known rule for
traversing mazes, is also known as either the
left-hand rule or the right-hand rule.