Docsity

Map Coloring - Artificial Intelligence - Exam, Exams of Artificial Intelligence

Toggle sidebar
bg1
1
CS-271, Intro to A.I. — Mid-term Exam — Fall Quarter, 2011
YOUR NAME AND EMAIL ADDRESS:
YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:
The exam will begin on the next page. Please, do not turn the page until told.
When you are told to begin the exam, please check first to make sure that you
have all eight pages, as numbered 1-8 in the bottom-left corner of each page.
The exam is closed-notes, closed-book. No calculators, cell phones, electronics.
Please clear your desk entirely, except for pen, pencil, eraser, an optional blank
piece of paper (for optional scratch pad use), and an optional water bottle.
This page summarizes the points available for each question so you can plan your time.
1. (10 pts total, -2 pts for each error, but not negative) MINI-MAX SEARCH IN GAME TREES.
2. (10 pts total, -2 for each error, but not negative) ALPHA-BETA PRUNING.
3. (10 pts total, 2 pts each) CONSTRAINT SATISFACTION PROBLEMS.
4. (10 pts total, 2 pts each) State-Space Search.
5. (15 pts total, 1 pt each) Agent/Search Concepts..
6. (5 pts total, -2 pts each wrong answer, but not negative) Task environment.
7. (20 pts total, 1 pt each) SEARCH PROPERTIES.
8. (10 pts total, -1 each error, but not negative) State Space Search.
9. (10 pts total, -2 each error, but not negative) Optimality of A* Search.
pf3
pf4
pf5
pf8

Partial preview of the text

Download Map Coloring - Artificial Intelligence - Exam and more Exams Artificial Intelligence in PDF only on Docsity!

CS-271, Intro to A.I. — Mid-term Exam — Fall Quarter, 2011

YOUR NAME AND EMAIL ADDRESS:

YOUR ID: ID TO RIGHT: ROW: NO. FROM RIGHT:

The exam will begin on the next page. Please, do not turn the page until told.

When you are told to begin the exam, please check first to make sure that you

have all eight pages, as numbered 1-8 in the bottom-left corner of each page.

The exam is closed-notes, closed-book. No calculators, cell phones, electronics.

Please clear your desk entirely, except for pen, pencil, eraser, an optional blank

piece of paper (for optional scratch pad use), and an optional water bottle.

This page summarizes the points available for each question so you can plan your time.

1. (10 pts total, -2 pts for each error, but not negative) MINI-MAX SEARCH IN GAME TREES. 2. (10 pts total, -2 for each error, but not negative) ALPHA-BETA PRUNING. 3. (10 pts total, 2 pts each) CONSTRAINT SATISFACTION PROBLEMS. 4. (10 pts total, 2 pts each) State-Space Search.

5. (15 pts total, 1 pt each) Agent/Search Concepts..

6. (5 pts total, -2 pts each wrong answer, but not negative) Task environment. 7. (20 pts total, 1 pt each) SEARCH PROPERTIES. 8. (10 pts total, -1 each error, but not negative) State Space Search. 9. (10 pts total, -2 each error, but not negative) Optimality of A Search.*

3. (10 pts total, 2 pts each) CONSTRAINT SATISFACTION PROBLEMS. This problem asks about the Map Coloring Problem. Each region must be colored one of Red (R), Green (G), or Blue (B).

Neighboring regions must be a different color. The map (left) and constraint graph (right) are below.

3a. (2 pts total, -1 for each error, but not negative) FORWARD CHECKING. Consider the partial assignment below. Variable B has been assigned value R as shown. Cross out all values that would be eliminated by Forward Checking (FC) after the assignment to variable B.

A B C D E F

R G B R R G B R G B R G B R G B

3b. (2 pts total, -1 for each error, but not negative) ARC CONSISTENCY. Consider the partial assignment below. Variables A and B have been assigned values as shown. Cross out all other values that would be eliminated by Arc Consistency (AC, also called AC-3 in your book).

A B C D E F

R G R G B R G B R G B R G B

3c. (2 pts total, -1 for each error, but not negative) MINIMUM-REMAINING-VALUES HEURISTIC. Consider the partial assignment below. Variable A is already assigned value R, and Arc Consistency is already done. List all unassigned variables that might possibly be selected by the Minimum-Remaining- Values (MRV) Heuristic:.

A B C D E F

R G B R G B G B R G B R G B

3d. (2 pts total, -1 for each error, but not negative) DEGREE HEURISTIC. Consider the partial assignment below. (It is the same assignment as in problem 3c above.) List all unassigned variables that might possibly be selected by the Degree Heuristic:.

A B C D E F

R G B R G B G B R G B R G B

3e. (2 pts total) MIN-CONFLICTS HEURISTIC. Consider the complete but inconsistent assignment below. E has just now been selected to be assigned a new value. List all new values that might be chosen below for E by the Min-Conflicts Heuristic?.

A B C D E F

R G B R? G

AA AB

AD AE

C

F

A

E F

B C

D

4. (10 pts total, 2 pts each) State-Space Search. Execute Tree Search through this graph (i.e., do not remember visited nodes, so repeated nodes are possible). It is not a tree, but pretend you don’t know that. Step costs are given next to each arc, and heuristic values are given next to each node (as h=x). The successors of each node are indicated by the arrows out of that node. (Note: C is a successor of itself). For each search strategy below, indicate the order in which nodes are expanded (i.e., to expand a node means that its children are generated), ending with the goal node that is returned as the result from the search. If the search gets stuck in a loop, show the repeating sequence and then “ …. ”

4.a. (2 pts, -1 for each wrong answer, but not negative) UNIFORM COST SEARCH.

4.b. (2 pts, -1 for each wrong answer, but not negative) GREEDY (BEST-FIRST) SEARCH.

4.c (2 pts, -1 for each wrong answer, but not negative) ITERATED DEEPENING SEARCH.

4.d. (2 pts, -1 for each wrong answer, but not negative) A SEARCH.*

4.e. (2 pts, -1 for each wrong answer, but not negative) OPTIMALITY.

Did Uniform Cost Search find the optimal goal? Why or why not?

Did A* Search find the optimal goal? Why or why not?

**** TURN PAGE OVER AND CONTINUE ON THE OTHER SIDE ****

S

A B

D E F

G1 G2 G

h=13^ C

h=16 h=11 h=

h=

h=

h=

8. (10 pts total, -1 each error, but not negative) State Space Search. This is a classic brain-teaser puzzle:

A man is traveling to market with a fox, a goose, and a bag of oats. He comes to a river.

The only way across the river is a boat that can hold the man and exactly one of the fox, goose or

bag of oats. The fox will eat the goose if left alone without the man. The goose will eat the oats

if left alone without the man. How can the man get all his possessions safely across the river?

We will call states where something gets eaten “forbidden” and consider them as part of the state

space, but from which there is no return; i.e., there is no way to go to any other state (including

back to the previous state) from such a forbidden state. All other states are “allowed.” In this

state space, an “action” corresponds to the man crossing the river in the boat. The man may cross

the river either alone or with at most one of his possessions.

One way to represent this problem is as a state vector with components (M,F,G,O), where

M=man, F=fox, G=goose, and O=oats are binary variables that are 0 if the man/fox/goose/oats

are on the near (close) bank, and 1 if on the far (distant) bank. Note that the boat is always on

the same side of the river as the man. Thus, the start state is (0,0,0,0), with the man and all his

possessions on the near bank. The single goal state is (1,1,1,1), with everything on the far bank.

8.a. (1 pt) How many total states (both allowed and forbidden) in this state space?

8.b. (1 pt) What is the maximum branching factor counting BOTH allowed and forbidden states

as children?

8.c. (8 pts, -1 for each error, but not negative) Draw the state space considering only ALLOWED

states. Represent an allowed state as a circle enclosing its binary vector (M,F,G,O). Connect

states that are possible successors of each other. The start and goal states are shown. The first

one is done for you as an example.

**** TURN PAGE OVER AND CONTINUE ON THE OTHER SIDE ****

9. (10 pts total, -2 each error, but not negative) Optimality of A Search.* You know that A* tree search with an admissible heuristic is an optimal search strategy. Recall that:

g(n) = true path cost so far h(n) = estimated optimal cost from n to goal ≤ true optimal cost f(n) = g(n) + h(n) = estimated total optimal path cost ≤ true total optimal cost

The following is a proof that A* tree search (queue sorted by f(n) ) is optimal if the heuristic is admissible. The lines of the proof are labeled A through G. Unfortunately, they have been mixed up (permuted).

Let ng be the first goal node popped off the queue. Let no be any other node still on the queue. We wish to prove that the path through no can never be extended to a path to any goal node that costs less than the path to ng that we just found.

A: true total cost of path to ng B: ≤ f(no) // because queue is sorted by f and ng came off queue first C: ≤ g(no) + true optimal cost to goal from no // because h is admissible D: = f(ng) // by definition of f, with h(ng) = 0 because ng is a goal node E: = g(no) + h(no) // by definition of f F: = g(ng) // because ng represents a complete path G: = true total optimal path cost through no

Fill in the blanks with the letters B, C, D, E, F ,and G to prove that the true total cost of the path to ng is less than or equal to the true total optimal path cost through no. The first and last letters, A and G, have been done for you as an example.

A G.