# CS1571: Homework 1

## Search (Chapter 3)

Assigned: September 4, 2008

Due: September 11, 2008 (before class, via dropbox or in person)

### Paper Problems (100 pts)

#### 1. Formulating Search Problems (50 pts)

Give the initial state, goal test, successor function, and cost function for each of the following. Choose a formulation that is precise enough to be implemented.

(a) As some sort of "joke", your roommate placed your last bottle of soda at the very top of your highest bookshelf. Having somehow missed out on the tall genes in your family, you are not able to reach the bottle without a little help from your furniture. The only things not nailed to the floor are your mini fridge and a chair. You are thirsty and want to get your bottle down. The height of the mini fridge is 1 foot, the chair 2 feet, and the book shelf 9 feet. You are only 5 feet tall but can reach to 6 feet. You are at your door, and your items are not yet stacked on one another.

(b) Most of you who have been on a road trip have probably played the following 2-player game. You start with a set X of actors. The first player names an actor x1 who is an element of X, and the other player names an actor x2 who is also an element of X (but not x1) who has appeared in a movie with x1. The first player must then name an actor x3 who has appeared in a movie with x2, and so on. So the two players generate a sequence of actors such that each actor in the sequence has co-starred with the actor immediately preceding. A player loses when it's his or her turn to move, and s/he cannot name an actor of X who hasn't been named before. You are given a set of actors X, with complete information on who has appeared in a movie with whom, and you want to determine how to win the game.

#### 2. Blind Search (50 pts)

Consider a state space where the start state is number 1 and the successor function for state n returns two states, numbers 2n and 2n+1.

(a) Draw the portion of the state space for states 1 to 15.

(b) List the order in which the first 10 nodes will be visited for breadth-first search, and for depth-first search.

(c) What is the search space size? If you had to choose, would you pick breadth-first or depth-first search as a method for exploring a larger portion of this state space? Explain your answer.