You are on page 1of 12

Name:

CS 182:Intelligent Machines
Midterm I – Fall 2009
Prof. Radhika Nagpal
October 14, 2009

Time: 2:37PM - 4:00PM (83 Minutes)

Directions: Answer all the questions below in the space provided. Write your name on each
page! If you need more space, write on the back or on the scratch pages provided. Make sure to
note if your answer continues somewhere else.
If you finish early, you may check your work and hand in your test. If you get stuck, consider
moving on to the next problem and then coming back if you have time.
We have provides approximate times to help you gauge when to do this. Note that these times are
only approximate, and difficulty will vary for each of you.

Aids: This exam is closed book and has no aids.

Score Sheet:

1: / 10 (approx. 5 min.)

2: / 30 (approx. 20 min.)

3: / 15 (approx. 5 min.)

4: / 25 (approx. 15 min.)

5: / 15 (approx. 10 min.)

6: / 25 (approx. 20 min.)

Total: / 120 (approx. 75 min.)

1
Name:

1) (10 points) Consider the following game tree. Leaf nodes are labeled using a static-evaluation
function. The triangles are max nodes and the circles are min nodes. Perform a minimax search
with alpha-beta pruning on this tree. Children should be expanded left-to-right. Show the α and β
values as they are updated at each node, and indicate which parts of the tree are pruned by drawing
a double line through the edge above a pruned node. You may write directly on the diagram.

10 2 5 3 4 15 4 6 1 2 7

1 3

2
Name:

2) (30 points) Consider the search tree below that includes three goal nodes. The labels on the
arcs give the action costs, and the nodes are annotated with the value of an admissible heuristic
function h(n) evaluated at that node. You want the minimal-cost solution.

a) (10 points) List, in order, the nodes expanded by A* search, starting with node A and ending
with the goal node that terminates the search. List the value of f, g, and h at each node. Break
any ties alphabetically. You many not need all the space provided.

f (n)

g(n)

h(n)

3
Name:

(Question 2 continued.)

b) (5 points) Describe in words what it means for a heuristic to be admissible. What property
of A* does an admissible heuristic guarantee?

c) (10 points) Let {h1 , h2 , . . . , hn } be a set of admissible heuristics for a minimization problem.
Let hmax (n) = max{hi (n)}. Prove that hmax is admissible and that hmax dominates each hi .

d) (5 points) True or false: adding a constant value to the heuristic function (except at goal
nodes, where the heuristic function must be 0) will not change the behavior of A* search.
Explain your answer in a couple sentences.

4
Name:

3) (15 points) Consider the following local search algorithms.

Algorithm A: Algorithm B:
(defun search-a (N M) (defun search-b (M)
(let ((x (random-state))) (let ((x (random-state)))
(dotimes (i N)
(let ((y (random-state)))
(if (< (state-value x)
(state-value y))
(setf x y))))
(dotimes (i M) (dotimes (i M)
(let ((y (random-neighbor x))) (let ((y (random-neighbor x)))
(if (< (state-value x) (if (< (state-value x)
(state-value y)) (state-value y))
(setf x y)))) (setf x y))))
x)) x))

Illustrate with graphs:

a) A search space on which both Algorithms A and B would perform poorly.

b) A search space on which Algorithm A would outperform Algorithm B.

Justify your choices (1-2 sentences).

5
Name:

4) (25 points) You have been asked to schedule a project involving six tasks (A, B, C, D, E, F ),
each of which must be assigned to one of four time slots (1, 2, 3, 4). More than one task can be
assigned to a slot. A schedule is considered acceptable if it assigns a slot to each task and satisfies
the following constraints:
A D
1. Task A must precede task D.
2. Task B must occur simultaneously with task A.
3. Task E must follow within two time slots of task A.
i.e., if A is in slot i, then E ∈ [i + 1, i + 2]. B E
4. Task B must precede task C.
5. Task F must follow task E.
6. Task C must precede task F .
C F

The problem has been formulated as a CSP in which the variables are the six tasks, each with initial
domain {1, 2, 3, 4}. The constraint graph is provided above.

a) (10 points) Translate each of the first three constraints into constraint notation such as,
“(X, Y ) : (x1 , y1 ), (x2 , y2), . . .” where X and Y are variable names and (x1 , y1) ∈ (X, Y )
means this is a valid assignment.

6
Name:

(Question 4 continued.)

b) (5 points) Without performing either forward checking or arc consistency, explain which
variable should be assigned to first and provide a justification for your heuristic.

c) (10 points) Now assume that we have made the assignment A = 2, F = 4. All other
variables retain as their domain {1, 2, 3, 4}. Apply the arc-consistency algorithm to this CSP,
with the arc queue initially containing only the arcs (C, F ) and (B, A) (from C to F , etc).
Show the order in which you consider arcs and eliminate values. Is this partial assignment
valid?

7
Name:

5) (15 points)

a) (5 points) Find the Nash Equalibrium of the payoff matrix below, recalling that the first entry
in each cell is the payoff for the row player, and the second entry is the payoff for the column
player:
A B
C −1, −1 −10, 0
D 0, −10 −5, −5

b) (5 points) An outcome Pareto Dominates another outcome if it is at least as good for every
player and strictly better for at least one player. An outcome is Pareto Optimal if no other
outcome Pareto Dominates it. Find the Pareto Optimal outcome(s) of the payoff matrix
above, if any exist. What does this tell us about Nash equilibria?

c) (5 points) Suppose that a certain game for two players is deterministic and has a zero-sum.
Suppose further that each player has perfect information. True or false: if both players play
perfectly (always maximizing their payoff in the full minimax tree), then the outcome of the
game will always be the same (either a win or a loss for the first player, or a draw.) Explain
in a few sentences.

8
Name:

6) (25 points) Consider an iterative-broadening search (IBS), with a branch-ordering heuristic


used to perform successive depth-first searches. First, only the child ranked first by the heuristic
is considered, resulting in a depth-first search (DFS) with an effective branching factor of 1. Next,
the top two children of each node are considered, giving a DFS with a branching factor of 2. IBS
continues until the branching limit is greater than the maximum number of children for any node
or a goal is found.
IBS considers the same node multiple times. For example, in the tree below, with the assumption
that nodes are ordered from left-to-right by the branch-ordering heuristic, IBS would examine the
nodes in the following order: A, B1, C1, A, B1, C1, C2, B2, C4, C5, A, B1, etc.

B1 B2 B3

C1 C2 C3 C4 C5 C6 C7 C8 C9

a) (5 points) Explain briefly whether IBS is complete.

b) (5 points) Explain briefly whether IBS is optimal when actions have a uniform cost of one.

9
Name:

(Question 5 continued.)

c) (5 points) Now assume a tree with a finite branching factor b and a finite depth d. Compare
the asymptotic time and space complexity of IBS and iterative-deepending search (IDS).

d) (5 points) State and justify a condition on both the depth of typical goal nodes and the
frequency of goal nodes for which IBS might outperform IDS.

e) (5 points) Explain why IBS may discover nodes in a different order than DFS.

10
Name:

(Scratch page.)

11
Name:

(Scratch page.)

12

You might also like