



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!




Write your answers on these pages and show your work. If you feel that a question is not fully specified, state any assumptions you need to make in order to solve the problem. You may usethe backs of these sheets for scratch work.
Write your name on this and all other pages of this exam. Make sure your exam contains sixproblems on seven pages.
Name ________________________________________________ Student ID ________________________________________________
Problem Score Max Score 1 _____ 25 2 _____ 20 3 _____ 7 4 _____ 15 5 _____ 18 6 _____ 15 Total _____ 100
Consider the state-space graph drawn below; the start and goal states are labeled. Note that arcs are directed. (if any) and list, in order, the states expanded. (A state is For each of the search strategies listed below, indicate which goal state is reached expanded when it is removed from the OPEN list.) Assume that all search strategies use an OPEN and a CLOSED list, and that best-first search checks for shorter paths to nodes. When all else is equal, nodes should be expanded in alphabetical order.
Start A
B C
D E Goal
Goal
KEY cost oftraversing this arc is X estimated costto nearest goal is Y
0
0 Y
X
F
0
2
25
10
3^60 75
5 (^3540)
30 45
35
(^1515)
5
(^1) 10^35
10
Goal state reached: _____ States expanded: ____________________________________
Goal state reached: _____ States expanded: ____________________________________
Goal state reached: _____ States expanded: ____________________________________
Part B. (continued) Propose and justify a combination of function, is guaranteed to lead to the expansion of no more nodes than the smallest h1, h2, and h3 that, when used by A* as its h number expanded by A* if it individually used each of h1, h2, and h.
Apply theReport the estimated values of the intermediate nodes and indicate the proper move of the minimax algorithm to the game tree below, where it is the minimizer’s turn to play. minimizer.
minimizer maximizer minimizer 5 2 −3^9 4 0 −2^ −
Indicate, by crossing out,this call to the board evaluator is unnecessary. one (1) unnecessary call to the static board evaluator. Explain why
Part A. Use a truth table to show the following sentence in propositional logic is valid. [ (P ⇒ Q) ∧ (P ⇒ R) ] ⇔ [ P ⇒ (Q ∧ R) ]
Part B. Let the following propositional symbols have the following meaning: A John was in a car accident. S John is sick. I John is injured. D John needs to see a doctor. Express each of the following English sentences in propositional logic. hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh John was in a car accident, but he isn’t injured.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh John needs to see a doctor if he is sick or injured.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh If John wasn’t in an accident and isn’t sick, then he doesn’t need a doctor.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Part A. Consider the following recursive function definition. It is supposed to replace all the numbers, located anywhere in an s-expression, with the atom XXX.buggy. However, it is (defun X-out-numbers (sexpr) "Replace all numbers in this sexpr with the atom XXX." (if (numberp sexpr) ’XXX (list (if (numberp (first sexpr)) XXX (first sexpr)) (X-out-numbers (rest sexpr)) )))
Describe below the errors in this function, and write a correct version of the function to the of the code above (you need not rewrite the first two lines). right
Part B. Assume the following is typed to a newly started LISP: (setf a ’(* 1 3 9)) (setf b ’(+ 3 (first (rest a)))) What does each of the following return (write ‘‘error’’ if an error condition develops): i) b returned value = ii) (first returned value = (rest a)) iii) (cons returned value = ’a a)
(the end)