






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
For each heuristic function, circle whether it is admissible and whether it is consistent with respect to the search problem given above.
Typology: Study notes
1 / 12
This page cannot be seen from the preview
Don't miss anything!
For the following questions, consider the search problem shown on the left. It has only three states, and three directed edges. A is the start node and G is the goal node. To the right, four di↵erent heuristic functions are defined, numbered I through IV.
(a) [4 pts] 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.
Admissible? Consistent?
I (^) Yes No Yes No
II (^) Yes No Yes No
III (^) Yes No Yes No
IV (^) Yes No Yes No
II is the only inadmissible heuristic, as it overestimates the cost from B: h(B) = 4, when the actual cost to G is 3.
To check whether a heuristic is consistent, ensure that for all paths, h(N ) h(L) path(N! L), where N and L stand in for the actual nodes. In this problem, h(G) is always 0, so making sure that the direct paths to the goal (A! G and B! G) are consistent is the same as making sure that the heuristic is admissible. The path from A to B is a di↵erent story.
Heuristic I is not consistent: h(A) h(B) = 4 1 = 3 (^) @ path(A! B) = 2. Heuristic III is consistent: h(A) h(B) = 4 3 = 1 2 Heuristic IV is not consistent: h(A) h(B) = 5 2 = 3 (^) @ 2
(b) [2 pts] Function Domination Recall that domination has a specific meaning when talking about heuristic functions. Circle all true statements among the following.
For one heuristic to dominate another, all of its values must be greater than or equal to the corresponding values of the other heuristic. Simply make sure that this is the case. If it is not, the two heuristics have no dominance relationship.
It is training day for Pacbabies, also known as Hungry Running Maze Games day. Each of k Pacbabies starts in its own assigned start location s (^) i in a large maze of size M xN and must return to its own Pacdad who is waiting patiently but proudly at g (^) i ; along the way, the Pacbabies must, between them, eat all the dots in the maze.
At each step, all k Pacbabies move one unit to any open adjacent square. The only legal actions are Up, Down, Left, or Right. It is illegal for a Pacbaby to wait in a square, attempt to move into a wall, or attempt to occupy the same square as another Pacbaby. To set a record, the Pacbabies must find an optimal collective solution.
(a) [5 pts] Define a minimal state space representation for this problem.
The state space is defined by the current locations of k Pacbabies and, for each square, a Boolean variable indicating the presence of food.
(b) [2 pts] How large is the state space?
(M N ) k^ · 2 M N
(c) [3 pts] What is the maximum branching factor for this problem?
(A) 4 k^ (B) 8 k^ (C) 4 k^2 M N^ (D) 4 k^2
Each of k Pacbabies has a choice of 4 actions.
(d) [6 pts] Let M H(p, q) be the Manhattan distance between positions p and q and F be the set of all positions of remaining food pellets and p (^) i be the current position of Pacbaby i. Which of the following are admissible heuristics?
h (^) A :
P (^) k i=1 M H(p^ i^ ,g^ i^ ) k h (^) B : max (^1) ik M H(p (^) i , g (^) i )
(h) [2 pts] How many possible environmental configurations are there in the initial belief state, before the Pacbabies receive any wetness percepts?
(i) [4 pts] Given the current belief state, how many di↵erent belief states can be reached in a single step?
(A) 4 k^ (B) 8 k^ (C) 4 k^2 M N^ (D) 4 k^2 After each of 4 k^ joint movements of Pacbabies, there are 2k^ possible joint percepts, each leading to a distinct belief state.
Your little brother Timmy has a birthday and he was promised a toy. However, Timmy has been misbehaving lately and Dad thinks he deserves the least expensive present. Timmy, of course, wants the most expensive toy. Dad will pick the city from which to buy the toy, Timmy will pick the store and you get to pick the toy itself. You don’t want to take sides so you decide to pick a toy at random. All prices (including X and Y) are assumed to be nonnegative.
Five Little Monkeys
Games of Berkeley
Emeryville Berkeley
The Ark Toys R Us
(a) [1 pt] Fill in the values of all the nodes that don’t depend on X or Y.
(b) [3 pts] What values of X will make Dad pick Emeryville regardless of the price of Y?
Dad will pick Emeryville if the value of the Berkeley node is more than the value of the Emeryville node ($40), that is if: x + y + 36 3
40 , x > 84 y , x > 84 .
(c) [3 pts] We know that Y is at most $30. What values of X will result in a toy from Games of Berkeley regardless of the exact price of Y?
Games of Berkeley will be chosen if the value of the “Five Little Monkeys” node is less than the value of the “Games of Berkeley” node ($30):
x + y + 36 3
< 30 , x < 54 y , x < 24
(d) [2 pts] Normally, alpha-beta pruning is not used with expectimax. However, with some additional information,
(a) Pacman’s new house After years of struggling through mazes, Pacman has finally made peace with the ghosts, Blinky, Pinky, Inky, and Clyde, and invited them to live with him and Ms. Pacman. The move has forced Pacman to change the rooming assignments in his house, which has 6 rooms. He has decided to figure out the new assignments with a CSP in which the variables are Pacman (P), Ms. Pacman (M), Blinky (B), Pinky (K), Inky (I), and Clyde (C), the values are which room they will stay in, from 1-6, and the constraints are:
i) No two agents can stay in the same room ii) P > 3 vi) B is even iii) K is less than P vii) I is not 1 or 6 iv) M is either 5 or 6 viii) |I-C| = 1 v) P > M ix) |P-B| = 2
(i) [1 pt] Unary constraints On the grid below cross out the values from each domain that are eliminated by enforcing unary constraints. P 1 2 3 4 5 6 B 1 2 3 4 5 6 C 1 2 3 4 5 6 K 1 2 3 4 5 6 I 1 2 3 4 5 6 M 1 2 3 4 5 6 The unary constraints are ii, iv, vi, and vii. ii crosses out 1,2, and 3 for P. iv crosses out 1,2,3,4 for M. vi crosses out 1,3, and 5 for B. vii crosses out 1 and 6 for I. K and C have no unary constraints, so their domains remain the same. (ii) [1 pt] MRV According to the Minimum Remaining Value (MRV) heuristic, which variable should be assigned to first?
M has the fewest value remaining in its domain (2), so it should be selected first for assignment. (iii) [2 pts] Forward Checking For the purposes of decoupling this problem from your solution to the previous problem, assume we choose to assign P first, and assign it the value 6. What are the resulting domains after enforcing unary constraints (from part i) and running forward checking for this assignment? P 6 B 1 2 3 4 5 6 C 1 2 3 4 5 6 K 1 2 3 4 5 6 I 1 2 3 4 5 6 M 1 2 3 4 5 6 In addition to enforcing the unary constraints from part i, the domains are further constrained by all constraints involving P. This includes constraints i, iii, v, and ix. i removes 6 from the domains of all variables. iii removes 6 from the domain of K (already removed by constraint i). v removes 6 from the domain of M (also already removed by i). ix removes 2 and 6 from the domain of B. (iv) [3 pts] Iterative Improvement Instead of running backtracking search, you decide to start over and run iterative improvement with the min-conflicts heuristic for value selection. Starting with the following assignment:
P:6, B:4, C:3, K:2, I:1, M:
First, for each variable write down how many constraints it violates in the table below. Then, in the table on the right, for all variables that could be selected for assignment, put an x in any box that corresponds to a possible value that could be assigned to that variable according to min-conflicts. When marking next values a variable could take on, only mark values di↵erent from the current one.
Variable # violated P 0 B 0 C 1 K 0 I 2 M 0
C x K I x x M
Both I and C violate constraint viii, because |I-C|=2. I also violates constraint vii. No other variables violate any constraints. According to iterative improvement, any conflicted variable could be selected for assignment, in this case I and C. According to min-conflicts, the values that those variables can take on are the values that minimize the number of constraints violated by the variable. Assigning 2 or 4 to I causes it to violate constraint i, because other variables already have the values 2 and 4. Assigning 2 to C also only causes C to violate 1 constraint.
Only MRV can have an e↵ect.
(a) [6 pts] Consider a vocabulary with only four symbols, A, B, C, and D. For each of the following sentences, how many possible worlds make it true?
(b) [8 pts] A certain procedure to convert a sentence to CNF contains four steps (1-4 below); each step is based on a logical equivalence. Circle ALL of the valid equivalences for each step.
a) (↵ ) ) ⌘ (↵ _ ¬ ) b) (↵ ) ) ⌘ (¬↵ _ ) c) (↵ ) ) ⌘ (¬↵ ^ )