AI - AI417DE01 Lab - MidTerm Exam Review 23.2A
AI - AI417DE01 Lab - MidTerm Exam Review 23.2A
Questions:
A. Search:
Answer the following questions about the search problem shown above. Assume that ties are broken
alphabetically. (For example, a partial plan S " X " A would be expanded before S " X " B; similarly, S " A
" Z would be expanded before S " B " A.) For the questions that ask for a path, please give your answers
in the form “S – A – D – G.”
1. What path would breadth-first graph search return for this search problem?
2. What path would uniform cost graph search return for this search problem?
3. What path would depth-first graph search return for this search problem?
4. What path would A* graph search, using a consistent heuristic, return for this search problem?
5. Consider the heuristics for this problem shown in the table below.
hI 4 1 0
hII 5 4 0
hIII 4 3 0
hIV 5 2 0
1. Admissibility and Consistency
For each heuristic function, circle whether it is admissible and whether it is consistent with respect
to the search problem given above.
a. Is hI admissible? (i) Yes (ii) No
b. Is hI consistent? (i) Yes (ii) No
c. Is hII admissible? (i) Yes (ii) No
d. Is hII consistent? (i) Yes (ii) No
e. Is hIII admissible? (i) Yes (ii) No
f. Is hIII consistent? (i) Yes (ii) No
g. Is hIV admissible? (i) Yes (ii) No
h. Is hIV consistent? (i) Yes (ii) No
2. Function Domination
Recall that domination has a speci c meaning when talking about heuristic functions.
Circle all true statements among the following.
a. Heuristic function III dominates IV.
(i) True (ii) False
b. Heuristic function IV dominates III.
(i) True (ii) False
c. Heuristic functions III and IV have no dominance relationship.
(i) True (ii) False
d. Heuristic function I dominates IV.
(i) True (ii) False
e. Heuristic function IV dominates I.
(i) True (ii) False
f. Heuristic functions I and IV have no dominance relationship.
(i) True (ii) False
C. Game:
Alice is playing a ball game with Bob. There are 3 boxes in front of them, each containing 3 balls, and
each ball has a score. Alice first selects a box from the 3 boxes, and then Bob takes a ball from the box
selected by Alice. In Figure 1, nodes B1, B2 or B3 are boxes, and nodes labeled C through K represent
individual balls and their scores. Unless otherwise specified, Alice’s objective is to maximize the score
of the ball that is eventually chosen, and Bob’s objective is to minimize Alice’s score. Assume both
players always act optimally for their goals.
1. In the blanks below, fill in the labels (not the numerical values) of the balls selected for nodes A, B1,
B2 and B3. For example, if Alice’s optimal move is to select the box B1, and Bob selects the ball C,
then A=C, B1=C.
A=? B1 = ? B2 = ? B3 = ?
2. Let’s apply alpha-beta pruning for the tree. Please choose all the child nodes of the branches that
could be pruned in the search tree.
(a) B1 (b) B2 (c) B3 (d) C (e) D (f) E
(g) F (h) G (i) H (j) I (k) J (l) K
3. Assume that you can re-allocate all the balls to different boxes as long as in the end, each box has
exactly 3 balls in it. Could you find a way to re-allocate the balls so that when we apply alpha-beta
pruning, the right branch of B2 as well as the middle and the right branch of B3 will be pruned?
Please list all balls in the order of their new positions in your solution. For example, if your solution
is not to move any ball, then your answer is “C,D,E,F,G,H,I,J,K”. When multiple solutions exist, break
ties alphabetically. For example, if there are two solutions starting with “C,D, ...” and “D,C, ...”, then
your answer should be “C,D, ...”. If there is no solution, please write down “None”.
D. Zero-sum game tree:
1. Consider the following zero-sum game tree. Triangles that point up represent choices for the
maximizing player; triangles that point down represent choices for the minimizing player. Assuming
both players act optimally, fill in the minimax value of each node:
2. Using alpha beta pruning, which leaf nodes or branches can we prune? Assume that branches are
visited in left to right order.
3. If the branches of every minimizer node are reordered such that we prune the maximum number
of leaf node, which leaf nodes can be pruned? Assume that children of maximizer nodes are visited
from left to right and that we are not pruning on equality. Remember to label the order of visit for
every branch of all minimizer nodes.
4. Assume that we are not pruning on equality. In this part, we have a fixed traversal order from left
to right. We start with the tree in the previous part, and shuffle the values of all the leaf nodes
such that we check as few nodes as possible without changing the structure of the tree. The initial
ordering (as in the tree presented in the previous part) is 6 10, 8, 7, 5, 4, 5, 6, 3,7, 2, and the new
ordering is A. B,C,D,E,F,G,H,I,J,K. (Note: this question is challenging!)
a. For all possible new orderings, which of the results (root values) are possible?
b. Suppose that for new ordering, the value of root is 4. Which of the following leaf nodes are
guaranteed to have value ⩽ 5
(a) A (b) B (c) C (d) D (e) E (f) F (g) G
(h) H (i) I (j) J (k) K (l) None of the above
c. Suppose that for new ordering, the value of root is 5. Which of the following leaf nodes are
guaranteed to have value > 5
(a) A (b) B (c) C (d) D (e) E (f) F (g) G
(h) H (i) I (j) J (k) K (l) None of the above
E. Demolition Pacman
Pacman just bought a new square (S) in an M by N grid world that contains some rough terrain. He wants
to clear a path from his new home to the closest grocery store, which is another square (G) on the grid
world. However, there are R squares on the grid that are impassable because there are rocks in the way.
Fortunately, Pacman is carrying D – 1 sticks of dynamite with him. On any turn, Pacman can throw a stick
of dynamite at one of eight neighboring squares (diagonal throws are allowed) if it contains rocks,
consuming a stick and removing the rocks in that location. If he chooses not to throw dynamite, Pacman
can also drive his truck onto one of eight neighboring squares (diagonal moves are allowed) if there is
nothing blocking him. However, his truck only has F — 1 units of fuel and whenever Pacman moves to a
square, one unit of fuel is consumed. Once Pacman runs out of fuel and dynamite, he has no more actions
available. Assume R, D, and F are all greater than 3 and 2 * D < R.
1. Complete the expression below so that X evaluates to the size of the minimal state space. You can
use integers as well as any of the variables mentioned in the problem.
a b c d f u
X =M ∗N ∗R ∗D ∗F ∗2
a b c d e
X∗R ∗D ∗F ∗2 ∗3
a b c d e f
X∗R ∗D ∗F ∗2 ∗3 ∗Y
a b c d e f
X∗R ∗D ∗F ∗2 ∗3 ∗Y