mid1key-f08 - Answer Key Answer Key CSci 5511 Artificial...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Answer Key October 7, 2008 Exam 1 CSIS 5511 Artificial Intelligence 1 Page 1 of 15 Answer Key CSci 5511 Artificial Intelligence 1 October 7, 2008 Exam 1 1. Problem Representation 20 points [graded by baylor] Consider the following problem: you are given a path of N white and black squares. The exact configuration of white and black squares and the length of the path vary with the instance of the problem you are given to solve. You start on the left-most square and the goal is to move off to the right end of the path in the least number of moves. If you are on white, you can move 1 or 2 squares right. If you are on a black square, you can move 1 or 4 squares right. 1.1. Describe how you would represent the state space, including the states, successor function and goal test. State Space array of colors, size 1-N Solution array of actions, size N State an integer (position in the problem). Let’s call it position Goal Test position > N Operators move1(position): position = position + 1 move2(position): position = position + 2 when onWhite(position) move4(position): position = position + 4 when onBlack(position) Discussion State Space Representation The world is a one-dimensional array so we’ll represent it that way. A four square world of all black will look like [B,B,B,B] and an alternating black and white world will look like [B,W,B,W]. Solution Representation For this problem, we want to find the sequence of moves to the right so we need to track each move we make. To represent that sequence, we can use complete-state or incremental-state representations. For this problem, incremental state makes the most sense. We’ll start with an empty array of actions []. When we’re done, the array will hold the (ordered) set of moves (actions) needed to solve the problem. The length of the array depends on the number of actions needed to solve the problem but, in the worst case, it will be size of the state space.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Answer Key October 7, 2008 Exam 1 CSIS 5511 Artificial Intelligence 1 Page 2 of 15 For completeness, let’s look at how we could have done this as a complete-state formulation. We begin (and end) with an array the size of the state space. For each state, we’d store a Boolean saying whether we pick that move or not. Obviously, the incremental-formulation is always smaller than or equal to the size of the complete-state formulation and contains all the same information. Since the incremental-formulation is more compact and the complete-state formulation offers no advantages (for this problem), i prefer the incremental-formulation. You were not required to solve the problem, you just had to show how to represent it. Still, i think seeing the solution will help you understand why we choose one representation over another. For the image above, the shortest path is [1,4,4,1,4,4]. Technically, the solution is [move1, move4, move4, move1, move4, move4] but since the number version is shorter and unambiguous, i’m going to abbreviate the method names to the number of steps they represent. Just keep in mind those numbers in the solution are function names, not actual numbers. Here’s
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/21/2011 for the course CSCI 5511 taught by Professor Staff during the Spring '08 term at Minnesota.

Page1 / 15

mid1key-f08 - Answer Key Answer Key CSci 5511 Artificial...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online