









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Last Name
First Name
Login
All the work on this exam is my own. (please sign)
For staff use only
For the following question parts, all edges in the graphs discussed have cost 1.
(f ) (3 pt) Suppose that you are designing a heuristic h for the graph on the right. You are told that h(F ) = 0.5, but given no other information. What ranges of values are possible for h(D) if the following conditions must hold? Your answer should be a range, e.g. 2 ≤ h(D) < 10. You may assume that h is nonnegative.
i. h must be admissible
ii. h must be admissible and consistent
S
A D
B
C
E
F
G
h=0.
(g) (3 pt) Now suppose that h(F) = 0.5, h(E) = 1.1, and all other heuris- tic values except h(B) are fixed to zero (as shown on the right). For each of the following parts, indicate the range of values for h(B) that yield an admissible heuristic AND result in the given expansion order- ing when using A* graph search. If the given ordering is impossible with an admissible heuristic, write none. Break ties alphabetically. Again, you may assume that h is nonnegative.
i. B expanded before E expanded before F
ii. E expanded before B expanded before F
S h=
D h=
A h=
B h=?
C h=
E
F
G h=
h=1.
h=0.
(a) (1 pt) How large is the state space in terms of the quantities defined above?
(b) (4 pt) For each of the following heuristics, which apply to states (s, u), circle whether it is admissible, consistent, neither, or both. Assume that the minimum of an empty set is zero.
(neither / admissible / consistent / both) The shortest time from the current location to any other store: mins′ 6 =s t(s, s′)
(neither / admissible / consistent / both) The time to get home from the current location: t(s, s 1 )
(neither / admissible / consistent / both) The shortest time to get to any store selling any unpurchased gift: ming∈u(mins′:g∈s′^ t(s, s′))
(neither / admissible / consistent / both) The shortest time to get home from any store selling any unpurchased gift: ming∈u(mins′:g∈s′ t(s′, s 1 ))
(neither / admissible / consistent / both) The total time to get each unpurchased gift individually:∑ g∈u(mins′:g∈s′^ t(s, s
(neither / admissible / consistent / both) The number of unpurchased gifts times the shortest store-to-store time: |u|(minsi,sj 6 =si t(si, sj ))
W
S
Pacman models this problem using variables Xi for each corridor i and domains P, G, and E.
(a) (3 pt) State the binary and/or unary constraints for this CSP (either implicitly or explicitly).
(b) (4 pt) Cross out the values from the domains of the variables that will be deleted in enforcing arc consistency. X 1 P G E X 2 P G E X 3 P G E X 4 P G E X 5 P G E X 6 P G E
(c) (1 pt) According to MRV, which variable or variables could the solver assign first?
(d) (1 pt) Assume that Pacman knows that X 6 = G. List all the solutions of this CSP or write none if no solutions exist.
The CSP described above has a circular structure with 6 variables. Now consider a CSP forming a circular structure that has n variables (n > 2), as shown below. Also assume that the domain of each variable has cardinality d.
1
2
3
n
(e) (2 pt) Explain precisely how to solve this general class of circle-structured CSPs efficiently (i.e. in time linear in the number of variables), using methods covered in class. Your answer should be at most two sentences.
(f ) (2 pt) If standard backtracking search were run on a circle-structured graph, enforcing arc consistency at every step, what, if anything, can be said about the worst-case backtracking behavior (e.g. number of times the search could backtrack)?
(^1 2 3 4 )
Pacman is in a bonus level! With no ghosts around, he can eat as many dots as he wants. He is in the 5 × 1 grid shown. The cells are numbered from left to right as 1,... , 5. In cells 1 through 4, the actions available to him are to move Right (R) or to Fly (F) out of the bonus level. The action Right deterministically lands Pacman in the cell to the right (and he eats the dot there), while the Fly action deterministically lands him in a terminal state and ends the game. From cell 5, Fly is the only action. Eating a dot gives a reward of 10, while flying out gives a reward of 20. Pacman starts in the leftmost cell (cell 1). We write this as an MDP where the state is the cell that Pacman is in. The discount is γ. Consider the following 3 policies: π 0 (s) = F for all s π 1 (s) = R if s ≤ 3 , F otherwise π 2 (s) = R if s ≤ 4 , F otherwise (a) (4 pt) Assume γ = 1.0. What is:
i. V π^0 (1)?
ii. V π^1 (1)?
iii. V π^2 (1)?
iv. V ∗(1)?
(b) (3 pt) Now consider an arbitrary value for γ. i. Does there exist a value for γ such that π 0 is strictly better than both π 1 and π 2? If yes, give a value for γ. If no, write none.
ii. Does there exist a value for γ such that π 1 is strictly better than both π 0 and π 2? If yes, give a value for γ. If no, write none.
iii. Does there exist a value for γ such that π 2 is strictly better than both π 0 and π 1? If yes, give a value for γ. If no, write none.
(a) (3 pt) Suppose you have performed k iterations of value iteration. Compute Vk+1(12) given the partial table below for Vk(s). Give your answer in terms of the discount γ as a variable. Note: do not worry about whether the listed Vk values could actually result from this MDP!
s Vk(s) 13 2 14 10 15 10 16 10 17 10 18 10 19 10 20 10 21 10 bust − 10 end 0
Vk+1(12) =
You suspect that the cards do not actually appear with equal probability and decide to use Q-learning instead of value iteration.
(b) (4 pt) Given the partial table of initial Q-values below, fill in the partial table of Q-values on the right after the following episode occurred. Assume a learning rate of 0.5 and a discount factor of 1. The initial portion of the episode has been omitted. Leave blank any values which Q-learning does not update.
Initial values s a Q(s, a) 19 hit − 2 19 stay 5 20 hit − 4 20 stay 7 21 hit − 6 21 stay 8 bust stay − 8
Episode s a r s a r s a r 19 hit 0 21 hit 0 bust stay − 10
Updated values
s a Q(s, a)
19 hit
19 stay
20 hit
20 stay
21 hit
21 stay
bust stay
Denote these random variables by I and R. Let the random variable M take the value +m if you have the mumps, and −m if you do not. You write down the following Bayes net to describe your chances of being sick:
I P(I)
R P(R)
I R M P(M|I,R) +i +r +m 0 +i +r ˗m 1. +i ˗r +m 0 +i ˗r ˗m 1. ˗i +r +m 0. ˗i +r ˗m 0. ˗i ˗r +m 0. ˗i ˗r ˗m 0.
I
M
R
(a) (2 pt) Fill in the following table with the joint distribution over I, M , and R, P (I, M, R).
+i +r +m 0
+i +r −m
+i −r +m 0
+i −r −m
−i +r +m 0.
−i +r −m 0.
−i −r +m 0.
−i −r −m 0.
(b) (2 pt) What is the marginal probability P (+m) that you have the mumps?
(c) (3 pt) Assuming you do have the mumps, you’re concerned that your roommate may have the disease as well. What is the probability P (+r | + m) that your roommate has the mumps given that you have the mumps? Note that you still don’t know whether or not you have immunity.
You’re still not sure if you have enough information about your chances of having the mumps, so you decide to include two new variables in the Bayes net. Your roommate went to a frat party over the weekend, and there’s some chance another person at the party had the mumps (+f ). Furthermore, both you and your roommate were vaccinated at a clinic that reported a vaccine mix-up. Whether or not you got the right vaccine (+v or −v) has ramifications for both your immunity (I) and the probability that your roommate has since contracted the disease (R). Accounting for these, you draw the modified Bayes net shown on the right.
I
M
R
V F
(d) (5 pt) Circle all of the following statements which are guaranteed to be true for this Bayes net:
(i) V ⊥⊥ M | I, R
(ii) V ⊥⊥ M | R
(iii) M ⊥⊥ F | R
(iv) V ⊥⊥ F
(v) V ⊥⊥ F | M
(vi) V ⊥⊥ F | I
While your sampling method has worked fairly well in many cases, for rare cases (like species that can’t sense sound) your results are less accurate as rejection sampling rejects almost all of the data. You decide to use likelihood weighting instead. The conditional probabilities of the Bayes net are listed below.
+c +m +n +d 0. +c +m +n −d 0. +c +m −n +d 0. +c +m −n −d 0. +c −m +n +d 0. +c −m +n −d 0. +c −m −n +d 0. +c −m −n −d 0. −c +m +n +d 0. −c +m +n −d 0. −c +m −n +d 0. −c +m −n −d 0. −c −m +n +d 0. −c −m +n −d 0. −c −m −n +d 0. −c −m −n −d 0.
+s +m 0. +s −m 0. −s +m 0. −s −m 0.
+s +n 0. +s −n 0. −s +n 0. −s −n 0.
+s 0. −s 0.
+c 0. −c 0.
You now wish to compute the probability that a species that has no sound-sensing (−s) or dancing (−d) nonetheless has music (+m), using likelihood weighting. I.e., you want P (+m | −s, −d).
(b) (2 pt) You draw the samples below, using likelihood weighting. For each of these samples, indicate its weight.
S C M N D weight
−s +c +m +n −d box filler
−s +c −m −n −d
−s −c −m +n −d
−s +c +m +n −d
(c) (2 pt) Compute the answer to your query, P (+m | −s, −d), using likelihood weighting with these samples.