Lab 4 materials - formulating search problems

In lab 4 we will look at some problems from the textbook and formulate them as search problems.

Group work

We will start by splitting the class into four groups. Each group should formulate the following problems as search problems by giving an initial state, the goal test, successor function and cost function. You don't need to write any code, but describe these things precisely enough so that they could be implemented. You will have 15-20 minutes (total) to discuss all the problems. After this time, each group will present their solution to one problem (assigned randomly to the groups) and discuss it with the class.

The problems come from problem 3.7 on page 90 in the textbook.

  1. You have to color a planar map using only four color, in such a way that no two adjacent regions have the same color.
  2. A 3-foot-tall monkey is in a room where some bananas are suspended from the 8-foot ceiling. He would like to get the bananas. The room contains two stackable, movable, climbable 3-foot-high craters.
  3. You have a program that outputs the message “Illegal input record” when fed a certain file of records where one of the records is illegal. You know that processing of each record is independent of the processing of other records. You want to discover which record is illegal.
  4. You have three jugs, measuring 12 gallons, 8 gallons, and 3 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 one gallon.
Discussion

If we have time, we'll also look at the missionaries and cannibals problem from problem 3.9. Three missionaries and three cannibals are on one side of a river, along with a boat that can hold one or two people. The task is to find a way to transport everyone to the other side, without ever leaving a group of missionaries in one place outnumbered by cannibals in that place, because then the missionaries will be eaten.

  1. Formulate the problem precisely, making only those distinctions necessary to ensure a valid solution. Draw a diagram of the complete state space.
  2. Why do you think people have a hard time solving this puzzle, given that the state space is so simple?

To play with this problem and get a feeling for it, have a look at an interactive version online: http://www.learn4good.com/games/puzzle/boat.htm

Problem set 1 and the current assignment

In the second period we'll introduce the first problem set, due in one week. We'll also be happy to assist with LISP matters regarding to the current assignment due tonight.