Introduction to Spring 2007 Artificial Intelligence Midterm Solutions

Similar documents
CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2014

Problem 1 Zero: 11% (~20 students), Partial: 66% (~120 students), Perfect: 23% (~43 students)

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2017

Question 1: 25% of students lost more than 2 points Question 2: 50% of students lost 2-4 points; 50% got it entirely correct Question 3: 95% of

CS-171, Intro to A.I. Mid-term Exam Fall Quarter, 2013

Introduction to Fall 2008 Artificial Intelligence Midterm Exam

Final Exam. Introduction to Artificial Intelligence. CS 188 Spring 2010 INSTRUCTIONS. You have 3 hours.

Artificial Intelligence. Chapters Reviews. Readings: Chapters 3-8 of Russell & Norvig.

6.034 Quiz 1, Spring 2004 Solutions

University of Waterloo Department of Electrical and Computer Engineering ECE 457A: Cooperative and Adaptive Algorithms Midterm Examination

Introduction to AI Spring 2006 Dan Klein Midterm Solutions

CS 540: Introduction to Artificial Intelligence

4 Search Problem formulation (23 points)

CSC384 Midterm Sample Questions

Introduction to Artificial Intelligence Midterm 1. CS 188 Spring You have approximately 2 hours.

Homework #6 (Constraint Satisfaction, Non-Deterministic Uncertainty and Adversarial Search) Out: 2/21/11 Due: 2/29/11 (at noon)

Midterm Examination CS540-2: Introduction to Artificial Intelligence

(Due to rounding, values below may be only approximate estimates.) We will supply these numbers as they become available.

To earn the extra credit, one of the following has to hold true. Please circle and sign.

Midterm Examination CS 540-2: Introduction to Artificial Intelligence

You should provide the best solutions you can think of.

Introduction to Fall 2014 Artificial Intelligence Midterm Solutions

CSCI-630 Foundations of Intelligent Systems Fall 2015, Prof. Zanibbi

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2016

1 Tree Search (12 points)

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2014

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems

CS 540-1: Introduction to Artificial Intelligence

Name: UW CSE 473 Midterm, Fall 2014

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

CS 416, Artificial Intelligence Midterm Examination Fall 2004

Potential Midterm Exam Questions

Uninformed Search Methods. Informed Search Methods. Midterm Exam 3/13/18. Thursday, March 15, 7:30 9:30 p.m. room 125 Ag Hall

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

Problem Solving and Search

Section Marks Pre-Midterm / 32. Logic / 29. Total / 100

Introduction to Fall 2010 Artificial Intelligence Midterm Exam

SRI VIDYA COLLEGE OF ENGINEERING & TECHNOLOGY REPRESENTATION OF KNOWLEDGE PART A

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Informed Search Algorithms

Problem Solving & Heuristic Search

Midterm I. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

This should prevent residual sexism, racism, favoritism lurking in the unconscious of your professor & TA from biasing grading!!

Midterm I. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

CS-171, Intro to A.I. Mid-term Exam Summer Quarter, 2016

CS 188: Artificial Intelligence. Recap Search I

7 Temporal Models (20 points)

Uninformed search strategies (Section 3.4) Source: Fotolia

3 SOLVING PROBLEMS BY SEARCHING

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

Downloaded from ioenotes.edu.np

CPS 170: Artificial Intelligence Search

Monotonicity. Admissible Search: That finds the shortest path to the Goal. Monotonicity: local admissibility is called MONOTONICITY

CS 188: Artificial Intelligence Fall 2008

Announcements. CS 188: Artificial Intelligence Fall Large Scale: Problems with A* What is Search For? Example: N-Queens

Problem Solving as Search. CMPSCI 383 September 15, 2011

Non-context-Free Languages. CS215, Lecture 5 c

Artificial Intelligence

: Principles of Automated Reasoning and Decision Making Midterm

Assignment 3: Logical Agents: Solutions

Solving problems by searching

Probabilistic Belief. Adversarial Search. Heuristic Search. Planning. Probabilistic Reasoning. CSPs. Learning CS121

Artificial Intelligence

Problem solving and search

Algorithm Design Techniques (III)

Artificial Intelligence. Game trees. Two-player zero-sum game. Goals for the lecture. Blai Bonet

Spring 2007 Midterm Exam

CS 331: Artificial Intelligence Informed Search. Informed Search

Informed Search A* Algorithm

CS 188 Introduction to Artificial Intelligence Fall 2018 Note 1

Informed State Space Search B4B36ZUI, LS 2018

CS 331: Artificial Intelligence Informed Search. Informed Search

CIS 192: Artificial Intelligence. Search and Constraint Satisfaction Alex Frias Nov. 30 th

Artificial Intelligence CS 6364

EECS 492 Midterm #1. Example Questions. Note: Not a complete exam!

Informed search strategies (Section ) Source: Fotolia

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

CS 4100 // artificial intelligence

CS 5522: Artificial Intelligence II

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

AI: Week 2. Tom Henderson. Fall 2014 CS 5300

CS 8520: Artificial Intelligence

CS-171, Intro to A.I. Final Exam Winter Quarter, 2012

Informed Search. CS 486/686 University of Waterloo May 10. cs486/686 Lecture Slides 2005 (c) K. Larson and P. Poupart

CSE 40171: Artificial Intelligence. Informed Search: A* Search

Downloded from: CSITauthority.blogspot.com

Midterm I - Solution CS164, Spring 2014

Q1. [11 pts] Foodie Pacman

6.034 Quiz 1 October 13,2004

Review Adversarial (Game) Search ( ) Review Constraint Satisfaction ( ) Please review your quizzes and old CS-271 tests

CS 188: Artificial Intelligence Spring Today

Chapter 2 Classical algorithms in Search and Relaxation

Ar#ficial)Intelligence!!

Uninformed Search. Chapter 3

Search. CS 3793/5233 Artificial Intelligence Search 1

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

CSE 332 Spring 2014: Midterm Exam (closed book, closed notes, no calculators)

CSCI 4150: Intro. to Artificial Intelligence Midterm Examination

Transcription:

NAME: SID#: Login: Sec: CS 88 Introduction to Spring 2007 Artificial Intelligence Midterm Solutions You have 80 minutes. There are five questions with equal points. Look at all the five questions and answer those that you know best first. At the end of the exam there is a question for extra credit worth 0 points. Please attempt this only if you have time. Don t panic! Mark your answers ON THE EXAM ITSELF. Write your name, SID, Login, and Section number on the top of each page. For true/false, circle the True or False If you are unsure of an answer, provide a brief explanation. All questions can be successfully answered with at most a few sentences. For official use only Q. Q. 2 Q. 3 Q. 4 Q. 5 Total EC /20 /20 /20 /20 /20 /00 /0. (20 points.) Search (a) True/False (8 points). Each problem is worth 2 points. Incorrect answers are worth 0 points. Skipped questions are worth point. i. True/False. Uniform Cost Search (UCS) is an optimal uninformed search technique both for tree search and for graph search (assume positive step costs and a finite branching factor). True. Uniform Cost Search will give an optimal solution in both cases, albeit slower than A* with a good heuristic. ii. True/False. Iterative deepening search has linear space requirements (O(bd) where b is the branching factor and d is the depth of the shallowest solution) for both tree search and graph search. True. IDS needs to store O(b) nodes for each level it explores. If the shallowest solution is at depth d then O(bd) is required. iii. True/False. If h (n) and h 2 (n) are admissible and consistent heuristics then h 3 (n) = h(n)+h2(n) 2 is admissible and consistent. True. You can see this by averaging the inequality conditions for admissible and consistent. iv. True/False. Local beam search with a beam size k is equivalent to a parallel local search with k random restarts. False. Local beam search with a beam size k will use k best locations to explore further and then again keep the best k locations. Random restart will start from scratch from k different locations.

2 (b) Search Strategies (2 points) 5 d 3 S a e 2 G 2 b c Figure. A Search graph with Start State S, goal state G and integer costs on the arcs. i. Return a possible order of node expansion with the following search algorithms for the search graph in Figure. (3 points) A. Depth First Search ( point) Many solutions. Eg. S a b c e G B. Breadth First Search ( point) Many solutions. Eg. S a b d e c G. Common mistakes: expanding c before e C. Uniform Cost Search ( point) S a b c e G or S a b c e d G ii. Consider three heuristics h, h 2, h 3. The table below indicates the estimated cost to goal (h value) for each of the heuristics for each node in the search graph. node h h 2 h 3 S 6 6 6 a 5 5 6 b 5 4 5 c 4 2 3 d 2 2 e 2 G 0 0 0 Which of the three heuristics (h, h 2, h 3 ) are A. admissible (2 points) B. consistent (2 points) h, and h 2 are admissible. h is also consistent. Show the node expansion order using A* for any of the heuristics that is consistent and admissible (4 points). For h : S a e G or S a e b G If indicates that h 2 or h 3 are consistent and use it here, will get full credit too. If the answer is almost correct, you will get 2 points. Show the node expansion order using greedy best first search for the heuristic h 2 ( point). S a d e G or S a e G

NAME: SID#: Login: Sec: 3 2. (20 points.) CSP On the day of an important vote, four senators show up in the Senate: two demublicans (A and B) and two repocrats (C and D). Each chooses whether to sit on the east or west side, and whether to vote Yes, No, or Waffle. We know the following facts: No demublican will vote the same as a repocrat. A, B, and C sit together. Senator A decides where to sit and then determines his vote based on that: east means no and west means yes. Senator B votes yes if some repocrat sits on the east. Otherwise he may vote yes or no. Senator D doesn t waffle. If senator D doesn t sit to the west, senator C won t either (it is scary over there). We would like to determine where everyone sits and how they vote. (a) (7 points) This problem can be formulated as a CSP with 8 variables (votes and seats) where all the constraints are binary. Draw the constraint graph. Please use capital letters A, B, C, D for variables whose domains are vote assignments for senators A, B, C, and D respectively and lowercase letters a, b, c, d for variables whose domains are seat assignments for senators A, B, C, and D respectively. C B A D d a c b Partial credit was given for nearly correct graphs based on the number of mistakes. (b) (7 points) On any edges adjacent to d, write down the set of partial assignments the corresponding constraint permits. (Hint: here is what the answer would be for the edge between A and a: {{A = Y es, a = W est}; {A = No, a = East}}). d to B: {{d = East, B = Y es}; {d = W est, b = Y es}; {d = W est, b = No}} d to c: {{d = East, c = East}; {d = W est, c = East}; {d = W est, c = W est}} Grading: one point was taken off for each missing or incorrect option. Solutions which were wrong due to mistakes in (a) were given some extra partial credit. (c) (6 points) Give a consistent assignment for the entire CSP. Everyone sits on the west. A and B vote yes while C and D vote no. Grading: if the assignment was almost right, partial credit was awarded based on how many constraints were satisfied.

4 3. (20 points.) Games (a) (Game trees and minimax (8 points)). In the matchstick game, a state consists of some number of matchsticks. Two players alternate turns, taking away either one or two matchsticks on each turn. The player that takes the last matchstick loses (utility -), and the other player wins (utility +). Draw the entire game tree for the game starting with 3 matchsticks, using upwards-pointing triangles for MAXnodes and downwards-pointing triangles for MIN-nodes (assuming the first player is MAX). Next to each node, write the corresponding utility for MAX, assuming optimal play by both players. pictured at right Point Breakdown: Graph structure (3 pts) Terminal utilities (2 pts) Minimax (internal node) utilities (3 pts) + + - win + win + - lose - (b) (α-β pruning) (2 points). The following question refers to the figure below. Assuming nodes are evaluated in left-to-right order, annotate each interior node with the utility (for MAX) it would be assigned by minimax with alpha-beta pruning, as well as its corresponding final values of [α, β]. Again MAX plays first and upwards pointing triangles are MAX nodes and downwards pointing nodes are MIN nodes. Put a slash through links corresponding to pruned subtrees (if any), and circle the leaf that would be reached by optimal play. Assume that the initial values for α and β at the root are [, ]. pictured at right Point Breakdown: Minimax vals, optimal leaf (4 pts) [α.β] vals, pruned subtrees (8 pts) The emphasis in grading this part was on correctly identifying the pruned subtrees. If this was done correctly, the precise values of α and β were not as important. 5 [ 6, infty ] A 6 [ 5, 4 ] [ 5, 6 ] 4 B C D 6 4 7 6 [ 9, 6 ] E F G H 9 4 9 5 I J K

NAME: SID#: Login: Sec: 5 4. (20 points.) Logic (a) (Propositional Satisfiability (6 points)). For each of the sentences below, indicate whether it is satisfiable, unsatisfiable, or valid. i. P P valid ii. P P satisfiable but not valid iii. P P unsatisfiable iv. (P Q) ((P R) Q) valid (b) (Propositional Resolution (8 points)) Consider the following future scenario, where vaccum cleaner agents exhibit affective states of happiness or sadness. Here is a typical agent, Jan. If Jan is humming, then Jan is happy. If there is no dirt in the house then Jan is happy. Jan is not happy. Given the following, use propositional resolution to prove that there is dirt in the house and Jan is not humming. First create the propositions and rules from the sentences above (2.5 points), convert them to CNF (2.5 points) and then use resolution to prove the assertion that there is dirt in the house and Jan is not humming (3 points). Here are the propositions expressed by the English sentences: Hum Happy NoDirt Happy Happy The corresponding CNF sentence is ( Hum Happy) ( NoDirt Happy) Happy The first and third clauses may be resolved to yield Hum, and the second and third may be resolved to yield N odirt. Although we were looking for a proof by resolution, credit was given for most reasonable proofs.

6 (c) (Translation from Natural Language to FOL (6 points)). Use the following vocabulary to express the assertions in the sentences to follow. Male(x) means that x is male. Female (x) means that x is female. Loves (x, y) means that x loves y. Married (x, y) means that x is married to y. Respect (x, y) means that x respects y. i. If Sam loves everybody then Sam loves himself. x[love(sam, x)] Love(Sam, Sam) point for a reasonable attempt. ii. All women love the man that they are married to. x y[f emale(x) Male(y) Married(x, y) Loves(x, y)].5 points for using y. point for a reasonable attempt. iii. No woman loves a man who does not respect all women. x y z[f emale(x) Male(y) F emale(z) Loves(x, y) Respect(y, z)].5 points for almost correct solutions. point for a reasonable attempt.

NAME: SID#: Login: Sec: 7 5. (20 points.) Probability and Bayes Nets Probability Basics (7 points) (a) (4 points) Suppose we wish to calculate P (x y, z), and have no information about any independence relationships between the variables X, Y, and Z. Identify all of the following sets of values that are sufficient for the calculation. i. P (Y, Z), P (X), P (Y X), P (Z X) ii. P (Y, Z), P (X), P (Y, Z X) iii. P (X), P (Y X), P (Z X) only ii is sufficient. Without any independence assumptions, we need at least one term containing all 3 variables to compute the desired result. By Bayes Rule, P (x y, z) = P (y, z x) P (x) P (y, z) Grading: 0,, 2, or 3 correct yielded 0,, 2, or 4 points (respectively). (b) (3 points) Now suppose we know that P (Y X, Z) = P (Y X) for all values of X, Y, and Z. indicate all of the sets above which are sufficient for performing the calculation. Now i, ii, and iii are all sufficient. By Bayes Rule and Chain Rule, P (x y, z) = P (y, z x) P (x) P (y, z) = P (x) P (z x) P (y x, z) = P (x) P (z x) P (y x, z) x Grading: + for each correctly classified set. Bayes Nets (3 points) P (x) P (z x) P (y x) P (x) P (z x) P (y x) (a) (6 points) Construct a Bayes net that corresponds to the following scenario for cell phone use: Having a charged battery (B) is required for a cell phone to be operational (O). Having an operational cell phone, being in the coverage area (C), and knowing the number to call (N) are all required for the placing of a call (P). Placing a call and the recipient being near the phone (R) are required to initiate a conversation (I). Assume there are no other dependencies. Your Bayes net needs to show your model of the structure of the scenario information, no specific conditional probability values need be represented. x pictured at right Grading: - for each incorrect arc. All arcs backwards or no arrows: 2-3 / 6 points. B O C N P R I

8 (b) (3 points) Which of the following independence properties are true of your network B I no N C yes O C B yes B R I no B C I no B C I, R, O yes Grading: 0.5 points per question. blanks were counted as no s. (c) (4 points) Give an expression in terms of conditional probabilities in the network (you don t need any numbers, just the expression) to compute the following quantities. P (b, o, c, n, p, r, i) P (o, c, i) P (b, o, c, n, p, r, i) = P (b)p (c)p (n)p (r)p (o b)p (p o, c, n)p (i p, r) P (o, c, i) = P (b)p (c)p (n)p (r)p (o b)p (p o, c, n)p (i p, r) b {T,F } n {T,F } p {T,F } r {T,F }

NAME: SID#: Login: Sec: 9 6. (0 points.) Extra Credit Questions (a) (Heuristic Search (4 Points)). The heuristic function h used by the A* algorithm has the same fixed absolute error at all the nodes if for all nodes n, h (n) h(n) = c where c is some positive constant. Here h (n) is the cost of the lowest cost path from n to a goal node, so the cost of the lowest cost path from the start node through n to a goal node is f (n) = g(n) + h (n). Suppose A* uses h with the property stated above. What can you say about the nodes that A* visits. Explain your answer. With such an h, A* will only investigate nodes on some optimal solution path (e.g., the same as if it was searching with h ). Shifting the heuristic by a constant doesn t affect the behavior of the algorithm, because all f values are shifted by the same amount and only the relative ordering of f values determines the order of node expansion. If there is only a single solution path, or the A* algorithm is modified to break ties by choosing the deepest node first, A* will expand a path directly leading from the start state to the goal, solving the problem in linear time. (b) (Minimax in Loopy Games (6 Points)). x x y - y - (a) (b) Some games (e.g., those where players are allowed to pass) have loops in their game graphs. In this problem, you will apply what you know about minimax to analyze the two simple loopy game graphs provided above. Again, upwards-pointing triangles are MAX nodes, downwards-pointing triangles are MIN nodes, and all utilities are for MAX. What, if anything, can you conclude about the utilities x and y in these graphs? For each graph, if there is only one possible pair of values, specify it; otherwise, write down as many constraints (i.e. inequalities) on the values of x and y as you can. (a) x =, y =. Here the loop does not matter, because neither x nor y would have incentive to choose the branch leading to a loop (since it can only decrease their eventual utilities) (a) x, y, x y. Here the loop does matter, because both x and y may hope for a better utility by choosing the loopy option. Thus, there is no single well-defined utility for x and y (unless the game specifies that loops have a particular value, such as 0). However, using the minimax principle, we can derive the preceding constraints on the possible values of x and y.