18CS71-Artificial Intelligence Question Bank
18CS71-Artificial Intelligence Question Bank
18CS71-Artificial Intelligence Question Bank
Answer:
4.The water jug problem states :You are provided with two jugs, first one with 4- gallons of
capacity And second one with 3 gallons of capacity. Neither have any measuring markers
on it. How can we get exactly two gallons of water in a 4 gallon jug?
Answer:
Solution:
First we will decide state space for this problem.
State Space - set of ordered pair of integer (x, y) where:-
x = (0, 1, 2, 3, 4) number of gallons of water in 4 Gallon jug
y = (0, 1, 2, 3) number of jug of water in 3 Gallon jug
According to final condition given in the problem,
Start state = (0, 0)
End state = (2, n)
Now we should form a set of production rules which will be used to go from one state
to another.
There are 12 production rules:
start state end state remark
1. (x,y) -> (4,y) (if x<4.) Fill 4 gallon jug
2. (x,y) -> (x,3) (if y<3) Fill 3 gallon jug
3. (x,y) -> (x-d,y) (x>0), pour some water out of 4 gallon jug
4. (x,y) -> (x,y-d) (y>0), pour some water out of 3 gallon jug
5. (x,y) -> (0,y) (if x>0). Empty 4 gallon jug
6. (x,y) -> (x,0) (if y>0). Empty 3 gallon jug
7. (x,y) -> (4,y-(4-x)) (x+y >= 4 && y>0.) pour water from 3 gallon jug to
4 gallon jug until 4 gallon jug is full
8. (x,y) -> (x-(3-y),3) (x+y >= 3 && x>0) Pour water from 4 gallon jug to
3 gallon jug until 3 gallon jug is full
9. (x,y) -> (x+y,0) (x+y <= 4 && y>0) pour all the water from 3 gallon
jug to 4 gallon jug
10. (x,y) -> (0,x+y) (x+y <= 3 && x>0) pour all the water from 4 gallon
jug to 3 gallon jug
11. (0,2) -> (2,0) pour 2 gallon water from 3 gallon jug to 4gallon
jug
12. (2,y) -> (0,y) Empty 2 gallons from 4 gallon jug on ground
Now find one possible solution for above problem, i.e., apply above production rules to
reach end state from start state
One possible rule is:
Start state: (0, 0)
End state: (2, n)
Water in 4 gallon jug water in 3 gallon jug rule applied
0 0
0 3 2
3 0 9
3 3 2
4 2 7
0 2 5 or 12
2 0 9 or 11
5. Explain production systems with components and characteristics. List the requirements of
Answer:
Characteristics of Production System
Control Strategies: These are also called search strategies. Control strategies
are adopted for applying the rules and searching the problem solution in
search space. The control strategy is responsible for obtaining the solution of
the problem. Hence, if the wrong control strategy is applied, it may be possible
that a solution is never obtained, even if it exists.
Requirement of good control strategies:
6. List and explain the problem characteristics which must be analysed before deciding on
Answer:
Algorithm:
Example:
8. Explain control satisfaction and solve the below crypt arithmetic problems:
9. Explain steepest Hill Climbing technique with an algorithm. Comment on its drawbacks