You are on page 1of 4

ARTIFICIAL INTELLIGENCE Week 4 Tutorial Questions

Question 1.

Figure 1 A road map of Romania Figure 1 gives a simplified road map of Romania. Find a path from Bucharest to Timisoara using Depth-First-Search and Breadth-First-Search. Assume that when performing the BFS traversal, the cities will be considered in counter-alphabetical order when in the same level.

Question 2.
For each of the following problems, specify (i) a representation for a state; (ii) the start and goal states and (iii) the operators, each of which is followed by an example. Example problem: The water-jug problem in the lecture notes. State representation: a pair (x,y) where xand yare respectively the amounts of water in 4-litre and 3-litre jugs. Start state:(0,0)

Goal state:(2,n) 0<=n<=3 Operators: - Fill up the first jug: (2,2) (4,2) - Fill up the second jug: (2,2) (2,3) - Empty the first jug: (2,2) (0,2) - Empty the second jug: (2,2) (2,0) - Fill up the first jug by the water in the second one: (2,3) (4,1) - Fill up the second jug by the water in the first one: (2,1) (0,3) - Empty the first jug to the second one: (1,1) (0,2) - Empty the second jug to the first one: (2,1) (3,0) a. The 8-puzzle problem:The 8-puzzle is a small board game for a single player;it consists of 8 square tiles numbered 1 through 8 and one blank space on a 3 x 3 board, as depicted in left board in Figure 2. Moves of the puzzle aremade by sliding an adjacent tile into the position occupied by the blank space, which hasthe effect of exchanging the positions of the tile and blank space. Only tiles that arehorizontally or vertically adjacent (not diagonally adjacent) may be moved into the blank space. The object is to reach the configuration in the right board of Figure 2.

Figure 2 An instance of the 8-puzzle problem Give all states that can be generated from the left board in Figure 2.

b. The 8-queens problem: The eight-queens puzzle is the problem of putting eight chess queens on an 88 chessboard such that none of them is able to capture any other using the standard chess queen's moves. Figure 3 depicts one solution.

Figure 3 An example solution for the 8-queens problem c. The missionaries and cannibals problem: Three cannibals and three missionaries must cross a river from the bank to the right one. Their boat can only hold two people. If the cannibals outnumber the missionaries, on either sideof the river, the missionaries are in trouble. How can all six get across the river? Illustrate the state space (up to 3 levels) in which the duplicated states are eliminated. d. Touring problems: Visit every city in Figure 4 at least once, starting, and ending in Bucharest

Figure 4: A road map of Romania

Question 3.
Analyze each of four problems in Question 2 with respect to the seven problem characteristics discussed in Chapter 2.

You might also like