This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 15381 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.
 Spring '10
 asda

Click to edit the document details