: Principles of Automated Reasoning and Decision Making Midterm

Similar documents
CS 171, Intro to A.I. Midterm Exam Fall Quarter, 2016

UNIVERSITY of PENNSYLVANIA CIS 391/521: Fundamentals of AI Midterm 1, Spring 2010

UMBC CMSC 671 Midterm Exam 22 October 2012

6.034 Quiz 1 26 September 2012

6.034 Quiz 1 October 13, 2005

Adversary Search. Ref: Chapter 5

UMBC 671 Midterm Exam 19 October 2009

6.034 Quiz September 2018

Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games?

6.034 Quiz September Jake Barnwell Michaela Ennis Rebecca Kekelishvili. Vinny Chakradhar Phil Ferguson Nathan Landman

CS61B Lecture #33. Today: Backtracking searches, game trees (DSIJ, Section 6.5)

CSE 573 Problem Set 1. Answers on 10/17/08

CS61B Lecture #22. Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55: CS61B: Lecture #22 1

Conversion Masters in IT (MIT) AI as Representation and Search. (Representation and Search Strategies) Lecture 002. Sandro Spina

6.034 Quiz 1 25 September 2013

Written examination TIN175/DIT411, Introduction to Artificial Intelligence

6.034 Quiz 1 September 30, 2009

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

10/5/2015. Constraint Satisfaction Problems. Example: Cryptarithmetic. Example: Map-coloring. Example: Map-coloring. Constraint Satisfaction Problems

Games and Adversarial Search II

CSE 473 Midterm Exam Feb 8, 2018

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

Spring 06 Assignment 2: Constraint Satisfaction Problems

2 person perfect information

CSC 396 : Introduction to Artificial Intelligence

More on games (Ch )

Homework Assignment #1

Midterm Examination. CSCI 561: Artificial Intelligence

More on games (Ch )

CS 188: Artificial Intelligence Spring 2007

ENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat

Solving Problems by Searching

CS 188 Introduction to Fall 2014 Artificial Intelligence Midterm

6.034 Quiz 2 20 October 2010

Section Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46

Heuristics & Pattern Databases for Search Dan Weld

UNIT 13A AI: Games & Search Strategies. Announcements

mywbut.com Two agent games : alpha beta pruning

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

CS188 Spring 2010 Section 3: Game Trees

Spring 06 Assignment 2: Constraint Satisfaction Problems

Practice Session 2. HW 1 Review

CS 188 Fall Introduction to Artificial Intelligence Midterm 1

Problem 1. (15 points) Consider the so-called Cryptarithmetic problem shown below.

AIMA 3.5. Smarter Search. David Cline

CS188 Spring 2010 Section 3: Game Trees

CMPUT 657: Heuristic Search

Artificial Intelligence Search III

COMP5211 Lecture 3: Agents that Search

Foundations of AI. 6. Board Games. Search Strategies for Games, Games with Chance, State of the Art

Solving Problems by Searching

CS 540: Introduction to Artificial Intelligence

UNIT 13A AI: Games & Search Strategies

Chess Puzzle Mate in N-Moves Solver with Branch and Bound Algorithm

Adversarial Search. Human-aware Robotics. 2018/01/25 Chapter 5 in R&N 3rd Ø Announcement: Slides for this lecture are here:

Game-Playing & Adversarial Search

Adversarial Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA CS188 UC Berkeley

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

Constraint Satisfaction Problems: Formulation

1. Compare between monotonic and commutative production system. 2. What is uninformed (or blind) search and how does it differ from informed (or

Foundations of Artificial Intelligence

Foundations of AI. 6. Adversarial Search. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard & Bernhard Nebel

Programming Project 1: Pacman (Due )

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1

Senior Math Circles February 10, 2010 Game Theory II

Search then involves moving from state-to-state in the problem space to find a goal (or to terminate without finding a goal).

COMP9414: Artificial Intelligence Adversarial Search

EXAMINATIONS 2002 END-YEAR COMP 307 ARTIFICIAL INTELLIGENCE. (corrected)

5.4 Imperfect, Real-Time Decisions

Heuristics & Pattern Databases for Search Dan Weld

Announcements. CS 188: Artificial Intelligence Fall Today. Tree-Structured CSPs. Nearly Tree-Structured CSPs. Tree Decompositions*

Game Playing Beyond Minimax. Game Playing Summary So Far. Game Playing Improving Efficiency. Game Playing Minimax using DFS.

CPS331 Lecture: Search in Games last revised 2/16/10

Foundations of Artificial Intelligence

game tree complete all possible moves

Q1. [11 pts] Foodie Pacman

ARTIFICIAL INTELLIGENCE (CS 370D)

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

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

5.4 Imperfect, Real-Time Decisions

6.034 Quiz October Ryan Alexander Nick Flamel Ben Greenberg. Neil Gurram Eeway Hsu Brittney Johnson. Veronica Lane Robert Luo Jessica Noss

Lecture 20: Combinatorial Search (1997) Steven Skiena. skiena

Informatics 2D: Tutorial 1 (Solutions)

Computing Science (CMPUT) 496

Artificial Intelligence

CS 229 Final Project: Using Reinforcement Learning to Play Othello

Midterm. CS440, Fall 2003

Game Theory and Randomized Algorithms

Monte Carlo tree search techniques in the game of Kriegspiel

Complete and Incomplete Algorithms for the Queen Graph Coloring Problem

Adversarial Search Aka Games

Question Score Max Cover Total 149

Artificial Intelligence Adversarial Search

Foundations of AI. 3. Solving Problems by Searching. Problem-Solving Agents, Formulating Problems, Search Strategies

arxiv: v1 [math.co] 24 Nov 2018

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:


CS 771 Artificial Intelligence. Adversarial Search

Compressing Pattern Databases

CMPT 310 Assignment 1

Transcription:

16.410-13: Principles of Automated Reasoning and Decision Making Midterm October 20 th, 2003 Name E-mail Note: Budget your time wisely. Some parts of this quiz could take you much longer than others. Move on if you are stuck and return to the problem later. Problem Number Max Score Grader Problem 1 28 Problem 2 26 Problem 3 22 Problem 4 24 Total 100 1

Problem 1 Rules for Pawns and Knights (28 points) Be careful not to get bogged down with any part of this problem. If you do, move on and go back to it at the end of the exam. Consider the lowly pawn in chess. It normally moves by advancing one square forward. Consider the pawn shown on the following chess board. 8 Gp 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 It can reach its goal square in a minimum of 5 moves. The goal square, marked by GP, is at (8, 2), where 8 denotes the row, and 2 denotes the column. Part A-1 Pawn to Goal Sequence (2 points) Suppose that the assertions database can contain assertions of the form: (pawn-pos num-moves? row? col?) which means that the position (row?, col?) is reachable from the initial position (3, 2) in num-moves? moves. Num-moves? indicates the number of moves taken from the start position. 3

What are the assertions that represent the pawn moving to its goal square (8, 2), starting from the initial position (3, 2), as depicted in the diagram above?. Assume that the pawn advances each move. An example of such an assertion would be (pawn-pos 0 3 2). (pawn-pos ) (pawn-pos ) (pawn-pos ) (pawn-pos ) (pawn-pos ) Part A-2 Pawn Advancement Rule (5 points) Suppose that, in addition to the rule syntax that we introduced in class, we allow the +, -, and < operators to appear in antecedent and consequent expressions. For example, expressions like or (< num-moves? 5) (pawn-pos (+ num-moves? 1) ) are allowed. Suppose that, initially, the only assertion in the database is: (pawn-pos 0 3 2). Write a rule that adds to the database, assertions specifying the position of the pawn for each move. Each assertion should be of the form (pawn-pos num-moves? row? col?), as was specified in part A. The set of assertions should represent the succession of moves from the initial square (3, 2) to the goal square (8, 2). Thus, the num-moves? value should go from 1 up to 5. 4

Hints: Think recursively. You will want to use the expression (< num-moves? 6) to make sure that assertions are not added that assign more than 5 to num-moves?. You will want to use (+ num-moves? 1) to increment the num-moves? part of assertions that appear in a rule consequent. You will want to use arithmetic expressions like (+ 1 row?) to update the position specified in a rule consequent. 5

Part B-1 Knight to Goal Sequence (2 points) A knight can move two squares forward in any direction and then one square to either side, as shown in the following diagram. 6

Now, consider the knight shown on the following chess board. 8 Gk 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 To warm you up, suppose this knight is trying to get to a goal square (8, 1). What is the minimum number of moves in which the knight can achieve this goal? Show your moves on the board. 7

Part B-2 Knight Move Rule (5 points) Suppose that the assertion database can contain assertions of the form: (knight-pos num-moves? row? col?) which, similar to the pawn, means that the position (row?, col?) is reachable from the initial position (1, 6) in num-moves? moves. Write a rule that adds to the database, assertions about the possible position of the knight for each move. Each assertion should be of the form specified above. The num-moves? value should go from 1 to no higher than 8. Hints: Think recursively. You will want to use the expression (< num-moves? 9) to make sure that assertions are not added that assign more than 8 to num-moves?. You will want to use (+ num-moves? 1) to increment the num-moves? part of assertions that appear in a rule consequent. You will want to use arithmetic expressions like (+ 2 row?) to update the position specified in a rule consequent. Your rule can include more than one assertion in its consequent. It is okay for your rule to make assertions about board positions that are outside the edges of the chess board. 8

Part C Backward Chaining (4 points) Suppose that, initially, the only assertion in the database is: (knight-pos 0 1 6) Assume that the rule interpreter for backward chaining is similar to the one presented in class, with the modification that it does not ask questions to the user. Suppose that the backward chaining rule interpreter has been given the rule you created in Part B-2 (implemented correctly!), with the additional antecedent expression (> num-moves? 0). Will backward chaining be able to determine if the assertion: (knight-pos 4 8 1) is true from this rule? Please justify your answer. 9

Part D-1 Knight and Pawn (2 points) To warm up, suppose that the pawn is initially at (3, 2), and the knight is initially at (1, 6), as shown in the previous diagrams, and below. 8 Gk Gp 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8 Suppose also that the goal square for the pawn is (8, 2), and the goal square for the knight is (8, 1), as before. Suppose, further, that a white king is now added to the board at (8, 4). The king can take any piece that moves into a square adjacent to it, so the pawn and knight must avoid moving to such an adjacent square. Let s assume that the king does not move; it stays at square (8, 4). If the pawn and knight take turns moving, with the pawn moving first, which will get to its goal square first? Note that the pieces cannot occupy the same square at the same time. 10

Part D-2 Knight and Pawn Model (8 points) Design an assertion format and rules that simulate the behavior of the knight and pawn. 11

Problem 2 Uninformed Search (26 points) You are searching for a path from S to G in the following graph using depth-first, breadth first and iterative deepening search: S A B C F D E G H I J Make the following assumptions: Each search algorithm explores a node s children in alphabetical order. Unless otherwise stated, the search algorithms use a visited list to prune nodes. The search stops as soon as the goal is expanded. Write the sequence of nodes expanded by the specified search methods. A node is expanded when the search algorithm takes it off the queue, and attempts to create its children. Part A Depth-first Search (4 points) Show the depth-first expansion sequence (we have started it for you): S-A- Part B Breadth-first Search (4 points) Show the breadth-first expansion sequence (we have started it for you): S-A- 12

Graph repeated for your convenience: S A B C F D E G H I J Part C Iterative Deepening (4 points) Show the iterative-deepening expansion sequence (we have started it for you): S- Part D Visited List (4 points) Now assume that the depth first search algorithm does not use a visited list. Show the search expansion, terminating either when the goal is reached or after the sequence reaches length 15. Show the depth-first expansion sequence (we have started it for you): S-A- 13

Part E Analysis Lower Bounds on Breadth First Search (10 points) Assume you have a tree with branching factor b and depth d. Furthermore, assume that the goal node appears on level m, where m < d. Specify the exact cost of the search algorithm as a function of m, d and b. What is the minimum number of nodes that might be generated by breadth-first search in order to reach the goal? For full credit you must show your derivation below, including the solution to any recurrence: 14

Problem 3 Planning (22 points) The Smith residence is a small house consisting of two rooms, A and B, connected by a door, as shown below: R1 Box1 A B Dr. Smith is away, but he has left a robot, R1, in charge of the house. Dr. Smith has asked R1 to move the box in room B to room A, then to stay in room B with the door closed. Let s help R1 figure out how to do this (R1, not developed at MIT, is lacking in many basic cognitive abilities, and needs help with such things). Suppose the problem is represented in the STRIPS language in the following way: Operators: (operator move-box-to-a (preconditions in-b box-in-b door-open) (effects (not in-b) (not box-in-b) in-a box-in-a)) (operator close-door (preconditions door-open) (effects (not door-open) door-closed)) (operator go-to-b (preconditions in-a door-open) (effects (not in-a) in-b)) 15

Initial state facts: in-b box-in-b door-open Goal state facts: in-b box-in-a door-closed Part A First Level Plan Graph Without Mutexes (5 points) Fill in the following plan graph for the first level. Show level 1 operators and level 2 facts. Do not show mutex relations. Level 1 Facts Level 1 Actions Level 2 Facts in-b box-in-b door-open 16

Part B Mutexes for First Level Plan Graph (5 points) In the following table, give all pairs of mutex actions for the Level 1 actions in Part A. For each, specify the type of mutex relation ( deletes precondition, deletes effect, or inconsistent preconditions ). Note that you may not need all the entries shown in this table. Action Mutex Pair Mutex Type Give all pairs of mutex facts for Level 2 Fact Mutex Pair 17

Part C Second Level Plan Graph Without Mutexes (5 points) Fill in the following plan graph for the second level. Show level 2 operators and level 2 and 3 facts (you should use the level 2 facts from part A). Do not show mutex relations. Level 2 Facts Level 2 Actions Level 3 Facts 18

Part D Mutexes for Second Level Plan Graph (7 points) In the following table, give all pairs of mutex actions for the Level 2 actions in Part C. For each, specify the type of mutex relation ( deletes precondition, deletes effect, or inconsistent preconditions ). Action Mutex Pair Mutex Type Give all pairs of mutex facts for Level 3 Fact Mutex Pair Does the plan graph need to be expanded further beyond this level? Justify your answer. 19

Problem 4 Constraints (24 points) Consider a map-coloring problem consisting of five regions, A, B, C, D and E. Your task is the standard map-coloring problem. You are to assign each region a color such that no two adjacent regions have the same color. The legal colors are a subset of R, G and B, standing for Red, Green and Blue, respectively. The set of regions are depicted in the following constraint graph as ovals. The legal colors for each region is specified within its corresponding oval, and each pair of adjacent regions is denoted by a line between the two ovals corresponding to the two regions. A: R, G, B B: R, G, B C: G, B D: B E: R, G, B Part A Pruned Domains (6 points) First, consider what domain elements can be eliminated using constraint propagation. Show your results on the copy of the constraint graph shown in the box below. On the graph, cross out each domain element that is eliminated by constraint propagation. For example, to start you off, we have eliminated B(lue) from region B, which is eliminated using constraint B-D: A: R, G, B B: R, G, B C: G, B D: B E: R, G, B Part B Backtrack Search with Forward Checking (15 points) 20

In this part you will use three CSP search methods to search for the first consistent solution to the map coloring problem described above. The three search methods you will use are backtrack search, backtrack search with forward checking, and backtrack search with dynamic variable ordering. The constraint graph is repeated here: A: R, G, B B: R, G, B C: G, B D: B E: R, G, B Your task is to draw the search tree resulting from the application of each method, stopping when you reach the first solution, or the end of the search tree if no solution exists. In your tree you will label each node (except the root) with the variable/value assignment made at that point in the search (e.g., A = R). In addition, indicate the order in which assignments are made by writing a number under each assignment in your search tree. To get you going we have started your first search tree below by indicating the root, and the first child expanded (labeled with assignment A=R and step number 1). Part B.1 Simple Backtrack Search (6 points) Draw the search tree for simple backtrack search (no forward checking) in the box below. In your search, variables, denoting regions, are to be ordered alphabetically, and colors are to be ordered R, then G, and finally B. Note that the full constraint propagation from part A is not to be performed here. A=R 1 () 21

Part B.2 Backtrack Search with Forward Checking (6 points) The constraint graph is repeated here for your convenience: A: R, G, B B: R, G, B C: G, B D: B E: R, G, B Draw the search tree for backtrack search with forward checking in the box below. In your search, variables, denoting regions, are to be ordered alphabetically, and colors are to be ordered R, then G, and finally B. Note once again that the full constraint propagation from part A is not to be performed here. A=R 1 () 22

Part B.3 Backtrack Search with Dynamic Variable Ordering (6 points) The constraint graph is repeated here for your convenience: A: R, G, B B: R, G, B C: G, B D: B E: R, G, B Draw the search tree for backtrack search with dynamic variable ordering in the box below. DO NOT perform forward checking or full constraint propagation. Select the variable to assign at each step based on the most constrained variable heuristic. Select the value of the variable to be assigned based on the least constrained value heuristic. We have not specified the assignment for the first step in this tree. = 1 () 23

24

25