Professional Documents
Culture Documents
Student ID:
Section No.:
Instructions:
1. Answer all questions; there are 4 questions in 5 pages.
2. Write your name on each page of the exam paper.
3. Write your answers directly on the question sheets. Use the ends of the question pages
for rough work or if you need extra space for your answer.
4. If information appears to be missing from a question, make a reasonable assumption,
state your assumption, and proceed.
5. No questions will be answered by the invigilator(s) during the exam period.
Page 1 of 5
1 2 3 4 5 6
Page 2 of 5
I. For an agent that is designed to play the Tower of Hanoi game which is a
stack of disks of varying sizes are moved from one peg to another. The
diagram below shows the start and goal states for 3 disk/3 peg version.
The rules of the game are that a disk may only be moved if it is on the top
of a stack, and it can only be placed on an empty peg or a larger disk. [3]
For the problem above, when formulated as a state space, what are the
following?
1. Initial state: S1:{D1, D2, D3}, S1:{ }, S3:{ } --> (given state a )
2. Action:
Disk Di can be moved from Si to Sj if:
- Di is the topmost disk on Si
- Si is either empty, or the size of the topmost disk of Sj , Dj, is greater than
Di
3. Goal state: S1:{ }, S1:{ }, S3:{ D1, D2, D3 } --> (given state b)
4. Cost: 1 per move
II. What is the difference between the cost function g(n) and heuristic
function h(n) as the main parts of the A* evaluation function? [1]
g(n) returns the actual cost from start node to current node, h(n) returns the
estimated cost from current node to goal.
III. Consider the following state space; S is the initial state and G is the goal
state and each arc is labeled by the cost of traversing it. [3]
S A B G
Heuristic h1 3 1 5 0
Heuristic h2 3 2 2 0
Page 3 of 5
Consider the following game tree in which the heuristic scores at the leaf
nodes are all from MAX player.
2. What other algorithm you can suggest to reduce the time taken by the
Minimax algorithm?
[1]
Alpha-beta
3. Which nodes won't be explored with the new algorithm when MAX
attempt his first move? Show the cuts on the tree. [2]
Page 4 of 5
Choice 1
54 = 625
2. Perform the arc-consistency algorithm on the CSP, draw your conclusion.
[3]
Page 5 of 5