{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

mid1key-s09

# mid1key-s09 - CSci 5511 Spring 2009 1st Midterm Exam Key...

This preview shows pages 1–2. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CSci 5511 Spring 2009 1st Midterm Exam Key Wednesday February 25 75 minutes == 75 points Open book and notes 1. 15 points You are given the missionaries and cannibals problem, which states that there are 3 missionaries and 3 cannibals on one side of a river, along with a boat that can hold one or two people. The problem is to find a way to get everyone to the other side of the river without ever leaving a group of missionaries in one place outnumbered by the number of cannibals in the same place. Multiple solutions will be accepted for this problem. Here is one. (a) Describe how you would represent the state space, including the states, successor function, and goal test. To describe a state, we’d want to know how many missionaries and cannibals are on either side of the river and which side of the river the boat is. It turns out, we can do this by only keeping 3 values per state ( m, c, b ): the number of missionaries on the other side ( m ∈ { , 1 , 2 , 3 } ), the number of cannibals of the other side ( c ∈ { , 1 , 2 , 3 } ), and the side the boat is on ( b ∈ { start, other } ). The initial state is (0 , , start ), and the goal state is (3 , 3 , other ). The successor function returns feasible states formed adding (or subtracting) 1 to each m and c , 2 to either m or c , or adding 1 to either m or c and toggling b . Each state could have at most 8 possible successors (or children) since it is not possible to add 2 and to subtract 2 from the same number of missionaries or cannibals without going out of range. In all cases, the real number of succes- sors will be smaller since some of these successors will be infeasible: leaving too many cannibals on one side of the river or constrained by the number of available passengers. (b) Is the search space a tree or a graph? What is the branching factor? The search space is most accurately characterized as a graph because some states can be reached on multiple paths. From the number of possible successors, we have our maximum branching factor (8). However, the actual number of children for any parent state will be much less since a number of these successors will be infeasible (either leaving too many cannibals on one side or constrained by the...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

mid1key-s09 - CSci 5511 Spring 2009 1st Midterm Exam Key...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online