hw1soln - 15-381 Spring 2007 Assignment 1 SolutionsOut:...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 15-381 Spring 2007 Assignment 1 SolutionsOut: January 23rd, 2007Due: February 6th, 1:30pm TuesdayMany people lost 5 points for failing to put their andrew ID on their assignments. This was clearly listedin the instructions for the homework.Many people lost 5 points for failing to follow the collaboration policy. This was clearly listed in theinstructions for the homework.1. The missionaries and cannibals problem is as follows. Three missionaries and three cannibals are onone side of a river, along with a boat. The boat can hold one or two people (and obviously cannot bepaddled to the other side of the river with zero people in it). The goal is to get everyone to the otherside, without ever leaving a group of missionaries outnumbered by cannibals. Your task is to formulatethis as a search problem.(a) Define a state representation. (2 points)There are many possibilities. One example is:Represent the missionaries byMand the cannibals byC. Let the boat beB. Each state can berepresented by the items on each side, e.g.Side1{M, M, C, C}, Side2{M, C, B}.(b) Give the initial and goal states in this representation. (1 point)Initial state:Side1{M, M, M, C, C, C, B}, Side2{}Goal state:Side1{}, Side2{M, M, M, C, C, C, B}(c) Define the successor function in this representation. (2 points)A set of missionaries and/or cannibals (call themMove) can be moved fromSideatoSidebif:•The boat is onSidea.•The setMoveconsists of 1 or 2 people that are onSidea.•The number of missionaries in the set formed by subtractingMovefromSideais 0 or it isgreater than or equal to the number of cannibals.•The number of missionaries in the set formed by addingMovetoSidebis 0 or it is greaterthan or equal to the number of cannibals.(d) What is the cost function in your successor fuction? (1 point)Each move has unit cost.(e) What is the total number of reachable states? (2 points)16:Side1{M, M, M, C, C, C, B}, Side2{}Side1{}, Side2{M, M, M, C, C, C, B}Side1{M, M, M, C, C, B}, Side2{C}Side1{M, M, M, C, C}, Side2{C, B}Side1{M, M, M, C, B}, Side2{C, C}Side1{M, M, M, C}, Side2{C, C, B}Side1{M, M, C, C, B}, Side2{M, C}Side1{M, M, C, C}, Side2{M, C, B}Side1{M, C, B}, Side2{M, M, C, C}1Side1{M, C}, Side2{M, M, C, C, B}Side1{C, C, C, B}, Side2{M, M, M}Side1{C}, Side2{M, M, M, C, C, B}Side1{C, C, B}, Side2{M, M, M, C}Side1{C, C, B}, Side2{M, M, M, C}Side1{M, M, M}, Side2{C, C, C, B}Side1{C, B}, Side2{M, M, M, C, C}The last one is only reachable through the goal state, but it is still technically reachable (e.g. ifyou are just exploring the state space instead of searching for a goal)....
View Full Document

This note was uploaded on 04/23/2010 for the course QWE 2131 taught by Professor Asda during the Spring '10 term at University of Karachi.

Page1 / 5

hw1soln - 15-381 Spring 2007 Assignment 1 SolutionsOut:...

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