Assignment No 1-2010
Assignment No 1-2010
Assignment No 1-2010
NOTE: All questions are compulsory. Please return the solved assignments
within a week’s time.
3) Write Program using Depth First Search to solve the 15-Puzzle Problem.
4) Write Program using Breadth First Search to solve the 15-Puzzle Problem.
7) Explain the terms bottom-up and top-down reasoning and explain the differences that
exist between them.
1
8) For the following sentences:
9) Using MYCIN’s rules for inexact reasoning, compute CF, MB and MD of h1 given
three observations where
CF(h1 , o1) = 0.5
CF(h1 , o2) = 0.3
CF(h1 , o3) = -0.2
10) A farmer has a goat, a wolf and a cabbage on the west side of a river. He wants to get
all of his animals and his cabbage across the river onto the east side. The farmer has a
row boat but he only has enough room for himself and one other thing. The wolf will eat
the goat if they are left together alone. The goat will eat the cabbage if they are left
together alone. How can the farmer get everything on the east side?
a. Formulate this puzzle as search: i.e. give a state space representation, start
state, goal state and operators.
b. Solve this problem-using search (any method of your choice). Draw the
Search tree and show the final solution.
11) Give a suitable goal test, search state representation (all information that is relevant
for choosing the next search step, etc.) the initial state, operators, and path cost
function for the following problem. Note, there are several possible formulations
which may have an impact on search time.
You want to find your way through a maze, which has only one entrance (on the left
side) and a number of exits (all on the right side). See the maze below for an example.
2
12) Given below is a graph representing a map navigation problem.
7
2
S 4
5 4
1 A B 1
2
1
E 4 5
C 3
3 D
0
G
The number on the links shows the path cost: the number in the box shows the
heuristic evaluation. Assume that during search
a) What is the order that breadth first search will expand the notes?
b) What is the order that iterative deepening search will expand the nodes?
a) What is the order that hill climbing search will expand the nodes?
3
13) The following table shows the distances between various cities labelled A thru S (the
distances between two given towns are symmetric).
A B C D E F G H I J K L M N O P Q R S
A 45 42 63
B 45 48 67
C 48 32 46
D 32 23 49
E 23 41
F 42 44 41
G 46 30 28
H 49 30 35
I 41 35 117
J 63 44 22 38
K 41 22 26 33
L 67 26 28
M 28 21 35
N 28 21
O 38 33 44 38
P 35 44 23
Q 23 73
R 38 109
S 117 73 109
This table shows the straight line distance, SLD, between city n and city S
City SLD to City SLD to City SLD to
S S S
A 184.39 G 107.70 M 100.00
B 161.25 H 101.98 N 89.44
C 145.60 I 100.00 O 111.80
D 141.42 J 144.22 P 78.10
E 140.00 K 128.06 Q 67.08
F 148.66 L 113.14 R 101.98
S 0.00
Using the A* algorithm find the optimal route between A and S. Present your results in a
table with the following headings (as shown in the lectures).
4
Expansion Node being Expanded Cost so far Cost for this Total Cost - SLD g(n) + SLD Expanded at
No. Expanded Nodes move g(n) Level?
14 a) Describe the terms complete and optimal with regards to evaluating search
strategies?
b) Given the following 8-puzzle, define the problem as a search problem in terms of
states, operators, a goal test and a path cost.
5 4 1 2 3
6 1 8 8 4
7 3 2 7 6 5
Initial State Goal State
A
1
1 0
5 B 5
S G
1 5
5
C
Show how uniform cost search would find the optimal route from S to G
5
15) The tower of Hanoi
Somewhere near Hanoi there is a monastery whose monks devote their lives to
a very important task. In their courtyard are three tall posts. On these posts is a set of
sixty-four disks, each with a hole in the center and each of a different radius. When the
monastery was established, all of the disks were on one of the posts, each disk resting on
the one just larger than it. The monks’ task is to move all of the disks to one of the other
pegs. Only one disk may be moved at a time, and all the other disks must be on one of the
pegs. In addition, at no time during the process may a disk be placed on top of a smaller
disk. The third peg can, ofcourse, be used as a temporary resting place for the disks. What
is the quickest way for the monks to accomplish their mission?
Even the best solution to this problem will take the monks a very long time.
This is fortunate, since legend has it that the world will end when they have finished.
Fig.1
18) Nim is fairly simple game. It begins with 23 objects. Each player takes turns
removing 1, 2, or 3 objects. The goal is to force the other player to take the last object.
Assume an evaluation function as follows, where N is the number of objects remaining.
6
a) Assume you go first. Draw the search tree for the first 3 moves (2 of yours and 1
of your opponents) of the game. Use the evaluation function and the MinMax
algorithm to fill in the evaluation value of each node in the tree.
b) After you have filled in the evaluation values, circle any branches that would not
need to be evaluated if Alpha-Beta pruning was used.
19) A sliding-tile puzzle consist of three black tiles, three white tiles an and an empty
space, thus:
B1 B2 B3 W1 W2 W3
There are three legal ways of moving a tile, each with an associated cost:
Slide into the adjacent empty location-cost1
Jump over one tile into the empty location-cost1
Jump over one tile into the empty location-cost2
The goal is to have all the white tiles to the left of all the black tiles and to achieve this at
minimum cost. The final position of the empty space is not important.
Represent the problem using production system rules
20) A problem solving search can proceed either forward (from a known start state to a
desired goal state) or backward (from a goal state to a start state). What factors determine
the choice of direction for a particular problem?
21) Program the interpreter for a production system. You will need to build a table that
holds the rules and a matcher that compares the current state to the left sides of the rules.
You will also need to provide an appropriate control strategy to select among competing
rules. Use your interpreter as the basis of a program that solves water jug problem.