here is a presentation showing how problems are representated in Artificial intelligence.must watch my youtube videos on my channel techiseasy.
Size: 1.42 MB
Language: en
Added: Aug 07, 2020
Slides: 17 pages
Slide Content
AI Problem Representation ARTIFIC I AL INTELLIGENCE PART #6
Water Jug Problem A Water Jug Problem: You are given two jugs, a 4-gallon one and a 3-gallon one, a pump which has unlimited water which you can use to fill the jug, and the ground on which water may be poured. Neither jug has any measuring markings on it. How can you get exactly 2 gallons of water in the 4-gallon jug?
State Representation We will represent a state of the problem as a tuple (x, y) where x represents the amount of water in the 4- gallon jug and y represents the amount of water in the 3-gallon jug. Initial state as (0,0). Goal state as (2,y).
Production Rules ( x,y ) If x<4 -> (4,y ) ( x,y ) If y<3 ->( x,3 ) ( x,y ) If x>0 ->( x- d,y ) ( x,y ) If y>0 ->( x,y-d) ( x,y ) If x>0 ->( 0,y) ( x,y ) If y>0 ->( x,0) ( x,y ) If ( x+y >=4 and y>0) ->( 4,y-(4-x)) ( x,y ) If (x+y>=3 and x>0 ) ->( x-(3-y),3 ) ( x,y ) If( x+y <=4 and y>0) ->( x+y,0) ( x,y ) If (x+y<=3 and x>0) ->( 0,x+y) ( 0,2 ) ->( 2,0)
WATER JUG: one of the S olu t i o n 4 Gallon Jug 3 Gallon Jug Rule applied 4 1 1 3 8 1 6 1 10 4 1 1 2 3 8 4 Ga l lon jug 3 Gallon jug pu m p
Search Tree : Water Jug Problem (0,0) (4,0) (4,3) (0,0) (1,3) (0,3) (4,3) (0,0) (3,0)
8 Queen Problem Problem: Place 8 queens on a chess board so that none of them attack each other . Formulation- I A state is an arrangement of 0 to 8 queens on the board Operators add a queen to any square. This formulation is not a systematic way to find the solution, it takes a long time to get the solution.
Formulation – II A state is an arrangement of 0-8 queen with no one attacked. Operators place a queen in the left most empty column. More systematic than formulation-I 8 Queen Problem
Formulation –III - A state is an arrangement of 8 queens on in each column. -Operators move an attacked queen to another square in the same column. -Keep on shuffling the queen until the goal is reached. - This formulation is more systematic hence , it is also called as Iterative Formulation . 8 Queen Problem
8 Queen Problem: one solution
8 Puzzle Problem Start State Goal State
State space (S) Location of each of the 8 tiles(and the blank tile) Start State (s) Starting configuration Operators(O) Four Operators : Right, Left, Up, Down Goals(G) one of the goal configuration 8 Puzzle Problem
8 Puzzle Tree
Missionaries and Cannibals Three missionaries and three cannibals find themselves on a side of river. They agreed to get to the other side of river. But missionaries are afraid of being eaten by cannibals so, the missionaries want to manage the trip in such a way that no. of missionaries on either side of the river is never less than the no. of cannibals on the same side . The boat is able to hold only 2 people at a time.
Missionaries and Cannibals : State representation State(#m,#c,1/0) #m – number of missionaries on first bank #c – number of cannibals on first bank The last bit indicate whether the boat is in the first bank. Operators Boat carries (1,0) or (0,1) or (1,1) or (2,0) or (0,2)