Midterm Examination CS540: Introduction to Artificial Intelligence

Similar documents
CS MidTerm Exam 4/1/2004 Name: KEY. Page Max Score Total 139

Smart Graphics: Methoden 3 Suche, Constraints

CSE 326, Data Structures. Sample Final Exam. Problem Max Points Score 1 14 (2x7) 2 18 (3x6) Total 92.

Logic in general. Inference rules and theorem proving

CS510 Software Engineering

Satisfiability Checking

An Introduction to The A* Algorithm

Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

6.3 Conditional Probability and Independence

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

AI: A Modern Approach, Chpts. 3-4 Russell and Norvig

ALGEBRA. sequence, term, nth term, consecutive, rule, relationship, generate, predict, continue increase, decrease finite, infinite

10/13/11 Solution: Minimax with Alpha-Beta Pruning and Progressive Deepening

5. A full binary tree with n leaves contains [A] n nodes. [B] log n 2 nodes. [C] 2n 1 nodes. [D] n 2 nodes.

Math 3000 Section 003 Intro to Abstract Math Homework 2

Decision Making under Uncertainty

On the Unique Games Conjecture

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four

Mathematical Induction. Lecture 10-11

Introduction to Logic in Computer Science: Autumn 2006

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Guessing Game: NP-Complete?

Y. Xiang, Constraint Satisfaction Problems

BASIC RULES OF CHESS

Load balancing Static Load Balancing

Colored Hats and Logic Puzzles

Union-Find Algorithms. network connectivity quick find quick union improvements applications

Search methods motivation 1

Mathematics. What to expect Resources Study Strategies Helpful Preparation Tips Problem Solving Strategies and Hints Test taking strategies

Resolution. Informatics 1 School of Informatics, University of Edinburgh

Regular Expressions and Automata using Haskell

MAKING MATH MORE FUN BRINGS YOU FUN MATH GAME PRINTABLES FOR HOME OR SCHOOL

Social Media Mining. Network Measures

Accentuate the Negative: Homework Examples from ACE

Static Load Balancing

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Mathematical Induction

Math Games For Skills and Concepts

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Generating models of a matched formula with a polynomial delay

Reductions & NP-completeness as part of Foundations of Computer Science undergraduate course

Load Balancing and Termination Detection

Midterm Practice Problems

Optimizing Description Logic Subsumption

each college c i C has a capacity q i - the maximum number of students it will admit

CMPSCI611: Approximating MAX-CUT Lecture 20

Grade 7 & 8 Math Circles Circles, Circles, Circles March 19/20, 2013

Paper 1. Calculator not allowed. Mathematics test. First name. Last name. School. Remember KEY STAGE 3 TIER 5 7

Answers G53KRR

Load balancing in a heterogeneous computer system by self-organizing Kohonen network

G C.3 Construct the inscribed and circumscribed circles of a triangle, and prove properties of angles for a quadrilateral inscribed in a circle.

Load Balancing. Load Balancing 1 / 24

Cost Model: Work, Span and Parallelism. 1 The RAM model for sequential computation:

2. The Language of First-order Logic

Artificial Intelligence

Hierarchical Data Visualization

Graph Theory Problems and Solutions

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Math Used In Ice Hockey

With the Tan function, you can calculate the angle of a triangle with one corner of 90 degrees, when the smallest sides of the triangle are given:

Supplemental Worksheet Problems To Accompany: The Pre-Algebra Tutor: Volume 1 Section 1 Real Numbers

Rules for TAK Created December 30, 2014 Update Sept 9, 2015

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / October 3, 2012

International Journal of Advanced Research in Computer Science and Software Engineering

1. Write the number of the left-hand item next to the item on the right that corresponds to it.

Social Media Mining. Graph Essentials

2 SYSTEM DESCRIPTION TECHNIQUES

Answer Key for California State Standards: Algebra I

Math Board Games. For School or Home Education. by Teresa Evans. Copyright 2005 Teresa Evans. All rights reserved.

Zero-knowledge games. Christmas Lectures 2008

Practical Guide to the Simplex Method of Linear Programming

International Journal of Software and Web Sciences (IJSWS)

Set Theory Basic Concepts and Definitions

Volume of Pyramids and Cones

The Taxman Game. Robert K. Moniot September 5, 2003

Learning Agents: Introduction

(Refer Slide Time: 2:03)

Certamen 1 de Representación del Conocimiento

EFFICIENT KNOWLEDGE BASE MANAGEMENT IN DCSP

SolidWorks Implementation Guides. Sketching Concepts

FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE KNOWLEDGE REPRESENTATION AND NETWORKED SCHEMES

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Handout #1: Mathematical Reasoning

Laboratory work in AI: First steps in Poker Playing Agents and Opponent Modeling

2. If C is the midpoint of AB and B is the midpoint of AE, can you say that the measure of AC is 1/4 the measure of AE?

npsolver A SAT Based Solver for Optimization Problems

Chapter 11 Number Theory

Connectivity and cuts

A number of tasks executing serially or in parallel. Distribute tasks on processors so that minimal execution time is achieved. Optimal distribution

CSC 373: Algorithm Design and Analysis Lecture 16

Exponential time algorithms for graph coloring

The Halting Problem is Undecidable

A NOTE ON OFF-DIAGONAL SMALL ON-LINE RAMSEY NUMBERS FOR PATHS

Common Core Unit Summary Grades 6 to 8

Solutions to Math 51 First Exam January 29, 2015

Scenario: Optimization of Conference Schedule.

The positive minimum degree game on sparse graphs

LINEAR EQUATIONS IN TWO VARIABLES

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Transcription:

Midterm Examination CS540: Introduction to Artificial Intelligence October 27, 2010 LAST NAME: SOLUTION FIRST NAME: SECTION (1=Zhu, 2=Dyer): Problem Score Max Score 1 15 2 16 3 7 4 15 5 12 6 10 7 15 8 10 Total 100 1

Question 1. [15] State Space Search You have two jugs, measuring 3 gallons and 4 gallons, and a water faucet. You can fill the jugs up or empty them out from one to another or onto the ground. You need to measure out exactly 2 gallons. (a) [5] Let state (a, b) mean the amount of water in the 3 and 4 gallon jugs, respectively. Define all successors of this state. (3,b); if a<3 (a,4); if b<4 (0,b); if a>0 (a,0); if b>0 (3, b-(3-a)=a+b-3); if a<3 and a+b>3 (a+b, 0); if a<3 and b>0 and a+b<=3 The two above can be combined into (min(a+b,3), max(a+b-3,0)) (a-(4-b)=a+b-4, 4); if b<4 and a+b>4 (0, a+b); if b<4 and a>0 and a+b<=4 The two above can be combined into (max(a+b-4,0), min(a+b,4)) (b) [5] Write down a solution path from (3, 4) to a goal state. You do not need to show how you find this path. (3,4)-(3,0)-(0,3)-(3,3)-(2,4) or (3,4)-(0,4)-(3,1)-(0,1)-(1,0)-(1,4)-(3,2) (c) [5] Let the cost of every edge be 1. Consider the function h(a, b) = a - b. Is h an admissible heuristic? Justify your answer. No. On many goal states this h is not zero. On the first solution path, (0,3) has actual cost 2 (i.e. two steps away from goal) but h(0,3)=3>2. Similarly, on the 2 nd solution path, (1,4) has actual cost 1 but h(1,4)=3>1. 2

Question 2. [16] Uninformed and Informed Search Consider the following path-finding problem. One can move from one small triangle to another if they share a vertex (e.g., A can go to B and C). However, the goal G can only be accessed from F. The number after the letter is the heuristic function value for that state. The actual cost of each move is as follows: A move down one level (e.g. A C or B E) costs 1 A move sideways on the same level (e.g. C B or E F) costs 2 A move up one level (e.g. B A or C A ) costs 3 (a) [8] Perform Depth-First Search, starting from A, using path-checking to avoid repeated states if they occur on the path back to the root in the search tree. Expand successors in alphabetical order. Show your search tree, and circle states that are expanded. What is the cost of your solution path? A B C C D E F D E F E F H F H G H Cost=11 3

(b) [8] Perform A* Search, starting from A. Break ties alphabetically. Show the expanded states and the priority queue contents at each step. What is the cost of your solution path? Expanded states priority queue - A(0+2) A(0+2) B(1+2), C(1+1) C(1+1) B(1+2), D(2+3), E(2+2), F(2+1) B(1+2) D(2+3), E(2+2), F(2+1) F(2+1) D(2+3), E(2+2), G(5+0), H(3+3) E(2+2) D(2+3), G(5+0), H(3+3) D(2+3) G(5+0), H(3+3) G(5+0) H(3+3) Path: A-C-F-G, cost=5 4

Question 3. [7] Simulated Annealing Assume that simulated annealing starts from a state s at the center of a large plateau. That is, the values of all states on the plateau are exactly the same. (a) [4] Say in the first step the random neighbor we picked is t, which of course has the same value as s. What will simulated annealing do? Justify your answer. Since P(s->t) = exp(- f(s)-f(t) /T) and f(s)=f(t), we see that with probability 1 we will move to t. (b) [3] To encourage the search to escape this plateau as quickly as possible, what should we do with the temperature T? Justify your answer. Since the above probability P(s->t) does not depend on T (because it is exp(0)), there is nothing you can do about temperature T to encourage an escape. 5

Question 4. [15] Game Playing Consider the following game where A moves first. The two players take turns. Each player must move to an open adjacent space in either direction. If the opponent occupies an adjacent space, then a player may jump over the opponent to the next open space, if there is one (for example, if A is on 1 and B is on 2, then A may jump to 3). The game ends when A reaches 4 (the value of this game to A is +1), or B reaches 1 (the value of this game to A is -1). (a) [8] Draw the complete game tree, using the following conventions: Write each state as (a, b) where a and b denote the locations of A and B, respectively. Put each terminal state in a square box, and write its game value below the box. Put loop states (i.e., states that already appear on the path back to the root) in double square boxes. Since it is not clear how to assign values to loop states, write a? below these double boxes. (1, 4)? -1-1 +1 +1-1 (1, 4) (2, 4) (2, 3) +1 (1, 3) (4, 3) +1 (1, 2) (3, 2) (3, 4) (3, 1) -1 (2, 4)? (b) [4] Compute the minimax value at every internal node, showing them in the search tree as well. Explain how you handled the? values and why. See red numbers above. The? value can be obtained by copying the value of the (2,4) node next to the root. Or: it doesn t matter because B will select the right branch at (3,2). 6

(c) [3] Explain why the standard minimax algorithm would fail on this game tree. The game tree is infinite. Because minimax is depth first search, it will not terminate. Question 5. [12] Constraint Satisfaction Consider the problem of assigning colors to the five squares on board below such that horizontally adjacent and vertically adjacent squares do not have the same color. Assume there are possible two colors, red (R) and black (B). Formulated as a constraint satisfaction problem, there are five variables (the squares) and two possible values (R, B) for each variable. (a) [3] If initially every variable has both possible values and we then assign variable 1 to have value R, what is the result of the Forward Checking algorithm? Forward checking propagates constraints from the current assigned variable to all adjacent unassigned variables, which in this case are variables 2 and 4. This results in the following domains for the variables: 1 = {R}, 2 = {B}, 3 = {R, B}, 4 = {B}, 5 = {R, B} (b) [4] If initially every variable has both possible values and the Arc Consistency algorithm is run, what are the resulting domains for each of the variables? None of the domains change, with each variable still have both possible values, {R, B}. (c) [5] If initially every variable has both possible values except variable 5 has only value B, what is the result of the Arc Consistency algorithm? 1 = {B}, 2 = {R}, 3 = {B}, 4 = {R}, 5 = {B} 7

Question 6. [10] Propositional Logic (a) [2] True or false: (A B) = ( A B) True (b) [4] Is the PL sentence ((P Q) Q) P valid, unsatisfiable or satisfiable? Justify your answer. Satisfiable. When P=T and Q=T the sentence is true, but when P=F and Q=T the sentence is false. (c) [4] Given two arbitrary sentences and in PL, = if and only if i. [2] the sentence is valid (one word answer) ii. [2] the sentence is unsatisfiable (one word answer) 8

Question 7. [15] Deductive Inference in Propositional Logic Consider the following KB containing 4 sentences in PL: P (R S), P (R S), S, (R U) Q (a) [3] Can these 4 sentences be expressed as a set of Horn clauses? If yes, give them; if no, explain why not. No because the first sentence has two literals on the right hand side, meaning that the CNF has two positive literals in it. (b) [4] Convert the given sentences into conjunctive normal form (CNF) and show the result as a set of clauses. P R S, P R S, S, R Q, U Q (c) [8] Prove the query sentence Q is entailed by KB using the Resolution algorithm. 1. Q negation of query 2. P R S KB 3. P R S KB 4. S KB 5. R Q KB 6. U Q KB 7. R RR(1,5) 8. P S RR(2,7) 9. P RR(4,8) 10. R S RR(3,9) 11. R RR(4,10) 12. False RR(7,11) 9

Question 8. [10] Representation in First-Order Logic For each of the following sentences in English, is the accompanying sentence in first-order logic a good translation? If yes, answer yes. If no, explain why not. (a) [5] No two UW students have the same ID number. p,q,n (UWStudent(p) UWStudent(q) (p = q)) (IDNum(p, n) IDNum(q, n)) This is NOT correct because it uses instead of when quantified by. It should be: p,q,n UWStudent(p) UWStudent(q) (p = q) IDNum(p, n) IDNum(q, n) (b) [5] All UW students except math majors like CS majors. p,q (UWStudent(p) MathMajor(p)) (UWStudent(q) CSMajor(q) likes(p, q)) This is NOT correct because it says that if there is at least one UW student who is not a math major, then everyone has to be a UW CS major. A corrected version is: p,q (UWStudent(p) MathMajor(p) UWStudent(q) CSMajor(q)) likes(p, q) 10