Introduction to Artificial Intelligence V22.0472 ‐ 001 Midterm exam Fall 2009 Name: _______Solutions_______________ Time: 1 hour Please fill in your name in the space above. Please write all answers in this booklet. The number by each question part show the number of marks This exam is CLOSED book. No collaboration is allowed. Dilip Krishnan will be administering the exam. At the end, please turn in the booklet to him. If you have a query about a question, please quietly ask Dilip Krishnan about it. If you get stuck on a question, don’t spend too long on it. Move onto the other questions and come back to it later.
Question 1: Uninformed Search Consider the following three search techniques: depth ‐ first (with cycle checking), breath ‐ first, uniform ‐ cost. (a) [9]. For each of the three methods, state if they are optimal or not and under what conditions. DFS – not optimal BFS – optimal only if all paths have the same cost UCS ‐ optimal (b) [9]. For each of the three methods, state if they are complete or not and under what conditions. DFS – complete only if we have cycle checking (otherwise not) BFS – complete UCS ‐‐ complete (c) [15]. If the search tree has constant branching factor of b and maximum depth m, with a shallowest solution being at depth s, what will the time and space complexity be for depth ‐ first (with cycle checking) and breadth first search? DFS: space = O(bm), time = O(b^m) BFS: space = O(b^(s+1)), time = O(b^(s+1)) (d) [15] If b is large and no heuristic is available, which search method would you use and why? It need not be one of the 3 methods listed above. Iterative deepening. It is complete, optimal for fixed path costs and has low space requirements O(bs), and time complexity of O(b^s), which may not be too bad if s is small. These cost requirements are better than UCS/DFS/BFS.
Question 2: Heuristic search An standard A* search, the objective function at each node n is f(n), where f(n) = g(n) + h(n). g(n) is the cost from the start to n and h(n) is an admissible heuristic of the remaining distance from n to the goal. Now consider a modified form of f(n), where f(n) = a*g(n) + b*h(n) (a) [3]. If a = 0, name the resulting search algorithm. Greedy best ‐ first search (b) [3]. If b = 0, name the resulting search algorithm. UCS (c) [3]. If a=0.25, b=0.25 name the resulting search algorithm. A* (d) [10]. Define what is meant by an admissible heuristic. h(n) must never overestimate cost to goal. (e) [15]. Another admissible heuristic j(n) is now available. For certain n, j(n) is closer to the true remaining distance than h(n). Give the form of f(n) that implements an A* search that uses both admissible heuristics, as well as g(n). f(n) = g(n) + max(h(n),j(n)) (or some multiple thereof).
Question 3. Game playing Consider the game tree below. The root is a max node and nodes are visited from left to right. The numbers show the value of the evaluation function for each of the states in the bottom row. (a) [15]. Compute the minimax values of nodes A,B,C,D. A = 3, B = 3 , C = 2, D = 2 (b) [15]. List the nodes that are not visited when alpha ‐ beta pruning is used. I,J.
Question 4. Constraint satisfaction problems Consider the problem of assigning two colors (White and Purple) to the game board below. No two squares which are vertically or horizontally adjacent are permitted to have the same color. Initially each square can take on either of the two colors. (a) [15]. If square A is assigned to White and forward checking is performed, what are the domains of the remaining squares? Please show the intermediary steps. Forward checking propagates constraints from A to all adjacent unassigned variables (B and C). This gives the following domains for the variables: A = {W}, B = {P}, C = {P}, D = {W,P}, E = {W,P}. (b) [15]. If square D is assigned to White and arc consistency is performed, what are the domains of the remaining squares? This is separate from part (a). Please show the intermediary steps. A= {W}, B = {P}, C = {P}, D = {W}, E = {W}
Question 5. MDPs In some environment, let the reward at each state s be R(s). Assume that a set of actions A exist for each state. Let the stochastic transition model for moving from state s to state s’ when taking action a be T(s,a,s’). Let the discount factor be g. Define V*(s) to be expected utility starting in state s and the acting optimally. Assume both T(s,a,s’) and R(s) are known. (a) [10]. Write down the Bellman equation for V*(s). (b) [20]. Describe an iterative method for determining the optimal policy p*(s). Two options here: (i) Value iteration: (II) Policy iteration
Question 6: Probability Consider the following joint distribution of three random variables, Season, Temperature, Weather: S T W P(S,T,W) Summer Hot Sun 0.30 Summer Hot Rain 0.05 Summer Cold Sun 0.10 Summer Cold Rain 0.05 Winter Hot Sun 0.10 Winter Hot Rain 0.05 Winter Cold Sun 0.15 Winter Cold Rain 0.20 (a) [1]. What is P(S=Summer, T=Cold,W=Sun)? Look up value in table: 0.1 (b) [2]. What is P(S=Winter)? 0.1+0.05+0.15+0.2 = 0.5 (Marginalize over T and W) (c) [2]. What is P(S=Summer, T = Cold)? 0.1 + 0.05 = 0.15 (Marginalize over W) (d) [5]. What is P(S = Summer | T = Cold)? P(S|T) = P(S,T)/P(T) P(T=Cold) = 0.5 P(S=Summer,T=Cold) = 0.15 (from above) = 0.15 / 0.5 = 0.3 (e) [10]. What is P(W = Rain | T = Cold, S = Winter)? P(W|T,S) = P(W,T,S) / P(T,S). P(T=Cold,S=Winter) = 0.35 P(W=rain,T=cold, S=winter) = 0.2. P(W|T,S) = 0.2/0.35 (f) [15]. Write down the distribution P(S) P(T) P(W) and compare it to the joint distribution above. Why are they not the same? P(T) = [0.5 0.5], P(S) = [ 0.5 0.5], P(W) = [0.65 0.35]. P(S)P(T)P(W) = [0.65 0.35 0.65 0.35 0.65 0.35 0.65 0.35]/4. Not same because variables aren’t independent. T & S are but not W.
Question 7: Bayes’s rule (a) [4]. Apply Bayes’ rule to the conditional distribution P(A|B), P(A|B) = P(B|A ) P(A) / P(B) (b) [8]. Name the four terms in the expression you have written down for (a). P(A|B) = posterior, P(B|A) = Likelihood, P(A) = Prior, P(B) = Evidence (c) [10]. Let P(A=1) = 0.2, P(A=2) = 0.7, P(A=3) = 0.1. P(B|A) is given below: A B P(B|A) 1 1 0.6 2 1 0.9 3 1 0.7 1 2 0.4 2 2 0.1 3 2 0.3 Compute P(A=2|B=1) and P(A=1|B=2). Recall that P(B) = sum_A p(A,B) = sum_A p(B|A) p(A). Thus if B=1, then evidence term P(B=1) is sum_A p(B=1|A)p(A) = 0.82 (0.6*0.2 + 0.9*0.7 + 0.7*0.1 = 0.82) and if B=2, evidence is P(B=2) is 1 ‐ 0.82 = 0.18. Now use Bayes rule, so P(A=2|B=1) = P(B=1|A=2)P(A=2)/P(B=1) = 0.9 * 0.7 / 0.82. Similarly, P(A=1|B=2) = 0.4 * 0.2 / 0.18 (d) [8]. Apply Bayes’ rule to the conditional distribution P(A,B|C). P(A,B|C) = P(C|A,B) P(A,B) / P(C)
Recommend
More recommend