UMBC 671 Midterm Exam 19 October 2009

Similar documents
UMBC CMSC 671 Midterm Exam 22 October 2012

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

Games and Adversarial Search II

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

Practice Session 2. HW 1 Review

Midterm. CS440, Fall 2003

CS510 \ Lecture Ariel Stolerman

Midterm Examination. CSCI 561: Artificial Intelligence

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

CS188 Spring 2010 Section 3: Game Trees

CS 188 Introduction to Fall 2014 Artificial Intelligence Midterm

CSE 473 Midterm Exam Feb 8, 2018

CS188 Spring 2010 Section 3: Game Trees

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

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

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

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

ARTIFICIAL INTELLIGENCE (CS 370D)

2 person perfect information

Adversarial Search 1

Spring 06 Assignment 2: Constraint Satisfaction Problems

CS 188: Artificial Intelligence Spring 2007

AIMA 3.5. Smarter Search. David Cline

Q1. [11 pts] Foodie Pacman

Game-Playing & Adversarial Search

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

Outline for today s lecture Informed Search Optimal informed search: A* (AIMA 3.5.2) Creating good heuristic functions Hill Climbing

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

: Principles of Automated Reasoning and Decision Making Midterm

Game-playing AIs: Games and Adversarial Search I AIMA

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

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

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

Artificial Intelligence Search III

Artificial Intelligence Lecture 3

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

COMP5211 Lecture 3: Agents that Search

Artificial Intelligence. Minimax and alpha-beta pruning

CSE 573: Artificial Intelligence Autumn 2010

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

CS 4700: Artificial Intelligence

Adversary Search. Ref: Chapter 5

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

Homework Assignment #1

CS 771 Artificial Intelligence. Adversarial Search

Multiple Agents. Why can t we all just get along? (Rodney King)

Game-playing AIs: Games and Adversarial Search FINAL SET (w/ pruning study examples) AIMA

6.034 Quiz 1 October 13, 2005

Adversarial Search (Game Playing)

Heuristics & Pattern Databases for Search Dan Weld

Game Playing AI Class 8 Ch , 5.4.1, 5.5

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

5.4 Imperfect, Real-Time Decisions

CS 188 Fall Introduction to Artificial Intelligence Midterm 1

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game

Artificial Intelligence Adversarial Search

Adversarial Search and Game Theory. CS 510 Lecture 5 October 26, 2017

Adversarial Search. CS 486/686: Introduction to Artificial Intelligence

COMP9414: Artificial Intelligence Adversarial Search

More on games (Ch )

Checkpoint Questions Due Monday, October 7 at 2:15 PM Remaining Questions Due Friday, October 11 at 2:15 PM

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

CS188 Spring 2014 Section 3: Games

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Spring 06 Assignment 2: Constraint Satisfaction Problems

Heuristics, and what to do if you don t know what to do. Carl Hultquist

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

Written examination TIN175/DIT411, Introduction to Artificial Intelligence

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

Games we will consider. CS 331: Artificial Intelligence Adversarial Search. What makes games hard? Formal Definition of a Game.

CS 331: Artificial Intelligence Adversarial Search II. Outline

Adversarial Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

More on games (Ch )

CS 188: Artificial Intelligence

Set 4: Game-Playing. ICS 271 Fall 2017 Kalev Kask

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

CS 188: Artificial Intelligence Spring Announcements

Adversarial Search. CS 486/686: Introduction to Artificial Intelligence

COMP219: Artificial Intelligence. Lecture 13: Game Playing

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing

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

Game Engineering CS F-24 Board / Strategy Games

Adversarial Search Aka Games

22c:145 Artificial Intelligence

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

Ar#ficial)Intelligence!!

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

mywbut.com Two agent games : alpha beta pruning

5.4 Imperfect, Real-Time Decisions

Game Playing. Why do AI researchers study game playing? 1. It s a good reasoning problem, formal and nontrivial.

CMPUT 396 Tic-Tac-Toe Game

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

CS 331: Artificial Intelligence Adversarial Search. Games we will consider

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

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

Name: Your EdX Login: SID: Name of person to left: Exam Room: Name of person to right: Primary TA:

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

CS103 Handout 25 Spring 2017 May 5, 2017 Problem Set 5

CS 540: Introduction to Artificial Intelligence

Games CSE 473. Kasparov Vs. Deep Junior August 2, 2003 Match ends in a 3 / 3 tie!

Transcription:

Name: 0 1 2 3 4 5 6 total 0 20 25 30 30 25 20 150 UMBC 671 Midterm Exam 19 October 2009 Write all of your answers on this exam, which is closed book and consists of six problems, summing to 160 points. You have the entire class period, seventy five minutes, to work on this exam. Good luck. 0. Warm Up Exercise (0) There are three labeled boxes containing fruit. One is labeled "apples", another "oranges" and the third "mixed". You know that each is labeled incorrectly. You may ask for a piece of fruit from one box, which you choose. Is there a way to correctly label the boxes? (Hint: Save this one for last) Pick from the one labeled "mixed". This box must contain either only apples or only oranges. If you get an orange, label the box "oranges", then change the "oranges" box to "apples", and the "apples" box to "mixed". If you get an apple, label the box "apples", then change the "apples" box to "oranges", and the "oranges" box to "mixed". 1. True/False [20 points] Circle either T or an F in the space before each statement to indicate whether the statement is true or false. If you think the answer is simultaneously true and false, quit while you are ahead. There is no penalty for incorrect answers but then, there are no points for incorrect answers either. T F A stochastic environment is one in which the next state is completely determined by the agent s action. FALSE T F A nominally fully observable environment can be rendered partially observable due to errors and noise in an agent's sensors. TRUE T F Depth-first search always expands at least as many nodes as A* search with an admissible heuristic. FALSE T F The major drawback of Hillclimbing is that it is only guaranteed to work for two-dimensional search spaces. FALSE T F It is possible for Algorithm A* to expand a non-optimal solution node when using an admissible heuristic. FALSE T F Algorithm A will perform a breadth-first search if F(n) = G(n). TRUE T F The main advantage of the Iterative Deepening A* algorithm over the standard A* algorithm is that its memory requirement is only linear in the depth of the search. FALSE T F A simple breadth-first search will always find an optimal solution if one exists and it is of finite length and all nodes have a finite number of successors. TRUE T F Iterative Deepening search is a practical way to add heuristics to algorithm A. FALSE T F Algorithm A will perform a depth-first search if f(n) = - g(n). TRUE T F An advantage of Hill Climbing search is that it requires minimal memory. TRUE T F Bi-directional search is always more efficient than uni-directional search. FALSE T F Arc consistency is a more powerful constraint propagation algorithm than forward checking. TRUE T F Deciding if a CSP is consistent is, in general, NP-hard. TRUE T F The alpha-beta algorithm is preferred to minimax because it provides a better estimation of which move is best for a given lookahead distance. FALSE

T F A drawback of game playing strategies using the minimax and alpha-beta algorithms is that one can t make sacrifices where an immediate loss is permitted in order to obtain a subsequent advantage. FALSE T F The minimax and alpha-beta procedures will always back up identical values to the root node of a game tree for any possible static evaluation function. TRUE T F A perfectly rational backgammon agent never loses. FALSE T F The prisoner s dilemma shows that game theory is not sound. FALSE T F Game theory applies only to zero-sum games. FALSE

2. Search I [25] The graph below represents the search space of a problem. Nodes are labeled with a letter and the value of a heuristic function h for the node. Edges are labeled with the cost of traversing the edge. Suppose we want to use the A* algorithm on the graph to find the shortest path from node S to node G. (a) [15] Simulate running the A* algorithm on the graph, filling in lines in the table, showing the f, g, and h values of each node on the queue. We've done the first two lines as an example. If you find a new path to a node already on the queue, update its cost (using the lower f value) instead of adding another copy of that node to the queue. Keep the queue sorted. (b) [10] For the solution found by A*, give the cost and sequence of nodes comprising the path. Cost=8, path= S,B,C,D,F,G Iteration Node expanded Priority Queue (aka fringe, open list) Notation for a node is NAME(F value, G value, H value) 0 -- S(6,0,6) 1 S A(6,2,4), B(7,3,4) 2 A B(7,3,4), C(9,5,4) 3 B C(8,4,4), D(9.5,6,3.5) 4 C E(8,7,1), D(8.5,5,3.5) 5 E D(8.5,5,3.5), G(9,10,0) 6 D F(8,7,1), G(9,10,0) 7 F G(8,8,0) 8 G 9 10 11

3. Linear tile puzzle [30] Consider a sliding tile puzzle with six tiles (three black and three white) in a linear tray which can hold seven tiles. The following depicts the initial configuration: [B][B][B][W][W][W][E] where [B] represents a black tile, [W] a white one and [E] the 'empty' cell. The puzzle has the following two moves: (1) A tile may move into an adjacent empty cell with unit cost; and (2) A tile may hop over one or two tiles into the empty cell with cost equal to the number of tiles hopped over. Thus, the initial configuration has the following three immediate successors: [B][B][B][W][W][E][W] (cost = 1) [B][B][B][W][E][W][W] (cost = 1) [B][B][B][E][W][W][W] (cost = 2) The goal is to have all of the white tiles to the left of all of the black ones. It is unimportant where the empty cell is. Your task is to set this problem up for solution by algorithm A. (a) [3] Give a loose upper bound on the size of the search space in terms of the number of states by ignoring the fact that identity of the three tiles of each color is unimportant. A loose upper bound is just the number of ways we can arrange the seven tiles, or 7 factorial or 5040. (b) [3] Give a tighter upper bound on the number of states that does reflect the fact that the tiles of a given color are interchangeable. There are 3! ways of arranging the three black tiles or white tiles, so a tighter upper bound is 7! / (3! * 3!) or 140. (c) [4] What is the maximum number of successors that a state can have? What's the minimum? Estimate the average number of successors. (c1) six; (c2) three; (c3) (3+4+5+6+5+4+3)/7 or ~ 4.3 (d) [4] How many states are goal states There are seven goal states, namely: [W][W][W][B][B][B][E] [W][W][W][B][B][E][B] [W][W][W][B][E][B][B] [W][W][W][E][B][B][B] [W][W][E][W][B][B][B] [W][E][W][W][B][B][B] [E][W][W][W][B][B][B] (e) [4] Is every action in this puzzle reversible?

Yes. (f) [4] Suggest a reasonable representation for this puzzle in Python or Java so that it can be used with the AIMA searching package. Represent a state by a seven-character string composed of three Ws, three Bs and one E character, e.g., 'WWWEBBB' (g) [4] Describe a heuristic function (h) appropriate for this problem. Here are some possible h(n) functions: the number of W characters to the the right of a B character in the string the sum of the distance between the position of each W tile and the rightmost B tile. (h) [4] Does your heuristic function lead to an A* type algorithm? Justify your answer in a sentence or two. Both of the examples above are admissible. For both, the fact that a tile can move n spaces with cost <= n means that they underestimate the minimum possible cost to reach a goal state.

4. Constraint Satisfaction Problems [30 points] There are five MWF graduate CS classes and three instructors who will be teaching these classes. An instructor can only teach one class at a time. The classes are: Class 1 - Algorithms: meets from 8:00-9:00am Class 2 - Intro to AI: meets from 8:30-9:30am Class 3 - Databases: meets from 9:00-10:00am Class 4 - Operating Systems: meets from 9:00-10:00am Class 5 - Machine Learning: meets from 9:30-10:30am and the instructors are: Professor A, who is available to teach Classes 3 and 4. Professor B, who is available to teach Classes 2, 3, 4, and 5. Professor C, who is available to teach Classes 1, 2, 3, 4, 5. (a) [8] Formulate this as a CSP problem in which there is one variable per class. State the variables and their domains, and the constraints. Constraints should be unary or binary and specified formally and precisely, but may be implicit rather than explicit. C1: {C}, C2: {B,C}, C3: {A,B,C}, C4: {A,B,C}, C5: {B,C} C1 C2, C2 C3, C3 C4, C4 C5, C2 C4, C3 C5 (b) [7] Draw the constraint graph associated with your CSP. (c) [8] Show the domains of the variables after running arc-consistency on this initial graph (after having already enforced any unary constraints). C1: {C}, C2: {B}, C3: {A,C}, C4: {A,C}, C5: {B,C} Note that while C5 can t be C, arc consistency doesn t rule it out. (d) [7] Give one solution to this CSP. Two solutions are possible: C1 = C, C2 = B, C3 = C, C4 = A, C5 = B C1 = C, C2 = B, C3 = A, C4 = C, C5 = B

5. NimChop [25] NimChop is a two-person game played with a pile of stones. To play this game, at each move, the player must divide one of the remaining piles of stones into two nonempty piles of different sizes. Thus, six stones may be divided into piles of 5/1, 4/2 but not 3/3. The player who can no longer make a move loses the game. (a) [5] Is this a zero sum game? Is this a game where each player has perfect information? This is a zero-sum game since one player wins and the other loses. This is a perfect information game since both players always have all of the relevant knowledge of the game's state. (b) [15] Draw the complete game tree or graph when the initial pile has seven stones and using it, determine what the outcome is (e.g., win for player one, win for player two, draw, unknown) if both players play optimally. Player one can make three moves (6,1), (5,2), and (4,3). From each, player two can get to a state (4,2,1). Player one can now only make one move, to (3,2,2,1). From here, player two goes to (2,2,2,1,1), leaving no moves for player one. (c) [5] What is the outcome if the initial pile has nine stones? (d) If there are nine stones in the initial pile, player one can always win. Player one makes an initial split of (7,2), which reduces the problem to the one analyzed above.

6. Game Trees [20] Consider this game tree where the root is a maximizing node, and children are visited left to right. (a) Compute the minimax game value of nodes A, B, C, and D using the standard minimax algorithm. A = 7 ; B = 1 ; C = 7 ; D = 4 (b) What move will be selected by player one using minimax. C (c) List the nodes (leaves or interior nodes) that alph-beta algorithm prunes, i.e., decides need not be examined. Nodes L and M are not visited. (c) The number of nodes that alpha-beta prunes depends on how each node's children are ordered in the tree. Draw a new game tree by re-ordering the children of each internal node, such that the new game tree is equivalent to the tree above, but alpha-beta pruning will prune as many nodes as possible. List the nodes that would be pruned. Here is one possible solution, obtained by arranging the tree so that the leaf values are strictly ordered high to low from left to righ:. Level 2: left to right: C, D, B. Level 3: J,I,H,L,M,K,E,F,G. Prunes M, K, F, G