0% found this document useful (0 votes)
253 views

Exam 1 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
253 views

Exam 1 PDF

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 97
CSE 4308 / 5360 — Spring 2017 Exam 1, Monday 02/20/2017 < Name: —eELlLutiovnw Student ID: (Not providing this information: -10 Points) (Name missing in Individual pages: -5 Points) Total Exam Points; 100 Score Question Points ‘Max Points 1 10 2 15 3 10 4 5 3 15 6 3 7 10 8 10 | 9 10 10 10 Total 100 Name: Question 1 10 points (a) (5 points). Is there a search problem where breadth-first search is guaranteed to find a solution and iterative deepening search will fail to find a solution? If no, justify. If yes, specify an example. Tn 2 itamhon SLI DS the x ey +e sales, RFS zl othe visi @ visthe ok Hak Bepth. So omy Sahin BFS teaches IDS usill Acaol Brus! No. () (5 points). Is there a search problem where breadth-first search is guaranteed to find a solution and uniform cost search will fail to find a solution? If no, justify. Ifyes, specify an example. T b ie ewe Succortrny 1 My oe £ oO WS Can oph Shuck Im few, : 9 unk Ve Mos Conk UcS will re bab BES ull | sO ex: Ors 4 2 Ney Roos: Yes rf line Cm bee 0 Got No €thernnre 4 Question 2 ~ 15 points Berlin Dusseldorf Dresien Saarbruecken in Srattgant as Munich, ‘The above (hopefully familiar) map defines a search space, where each city is a state, and each road represents an action that can take the agent from one city to another. The cost of going through a road is simply the length of the road, Let the Start State be Bremen, (@) G points) Assuming that the search does not keep track of cities already visited, list (in the order in which they are expanded) the first five nodes (excluding the node for the start state) expanded by uniform cost search and iterative deepening search. For each of those five nodes you have to give the name and cumulative cost of the corresponding city. (NOTE: Multiple answers may be correct here.) Uniform Cost Search: (Cromen Ce), MW mbury (116), Hemnever @)) Lucheck (\ 74), Dourrtvam (24), Heemberg (242) Iterative Deepening Search: Reem en \ x |Anagve Beeren owrrrenn, awnovt™ Hansveg Geeren, Dy giv , esseemonr, Feave rua7 AN ND ve 4 kawer, (lad BIA4 MM naoebue G, Ra Ge RO Lveeck bercins Name: (b) (5 points) For our route-finding search problem, precisely define an admissible heuristic function that makes A* behave exactly like uniform cost search (i.e, the sequence of nodes visited by A* is always the same as the sequence of nodes visited by uniform cost search, as Jong as there are no ties among nodes). h( n) ro LShere Wis Orr exky (©) (5 points) For our route-finding search problem, suppose that the search algorithm is given a pollution rating for each city on the map. Suppose that pollution ratings are related with distances to Munich as follows: ~ Any city within 300 km of driving distance from Munich has a pollution rating of 10. ~ Any city with driving distance from Munich between 301 km and 500 km has a pollution rating of 5. ~ All other cities have a pollution rating of 0. Using this information, and assuming that Munich is always the goal node, define a maximal admissible heuristic for A* (ie., a heuristic that is not dominated by any other admissible heuristic that can be defined using this knowledge), kOe) 4 0p pellakon pobre 10 {luhion rechssy i) jillwhes sah 2 Question 3 — 10 points The missionary-cannibal problem is defined as follows: ‘There are three missionaries and three cannibals on the left bank of the river. + The goal is to get al six people alive on the right bank of the river. + There isa single boat, and that boat is the only way to move from one bank to the other. © The boat cannot go from one bank to the other without at least one person in it © The boat cannot carry more than two people on the same trip. + If, at any point, there are more cannibals than missionaries on one bank, the cannibals will kill and eat any missionaries who are on that bank. We do not allow any solution that involves the death of any of the six people. In this problem, a state is described by specifying four numbers and a Boolean: ‘A: number of missionaries on the left bank. yumber of cannibals on the left bank. - C: number of missionaries on the right bank. ~ Ds number of cannibals on the right bank. X (Boolean): true if the boat is on the left side, false if the boat is on the right side. So the start state is (33007) and the goal state is (0033F). A move corresponds to moving one or two people with the boat, from one bank where the boat currently is to the other bank. The goal isto find a sequence of moves that gets all six people (alive) to the right bank. (@) (S points). How many states are there in this search space? Exchide states that result in cannibals eating missionaries. Upper bounds on the number of states may receive partial credit (depending on how close the bounds are). Justify your answer. 26 milk fe Fink Glode tk & mtasico’S S babes Sho Wt 3 mastonns 4 Wis 7 om led (220 Ve Shakes with, DL. mioS ore * | ithe TL wissioans on bt (3_9- i) fc Vat iz mee (0-2 % 7 A 6 Name: (b) (5 points). What is the branching factor in this search problem? Why? uM | : Maxx Poss Sle Pract hon, S = 2 ewnnibals = | Cnt — 2 rosin es = if —1 Canada! | Missinany WA SKE Ee Question 4—5 points ‘Suppose we have a search space with the following characteristics: = the number of states is X ~The branching factor is 2. ~ From any state there is a path to a goal state, ‘Suppose that we use iterative deepening search to find a path from state A to the goal. What is the largest possible length for that path? Justify your answer. } oA Norm bban 9 obes vrix ted qe ‘Ds of ) f A. a Pid Wa all ts sales bevel lim mat lees eh 0 4 a r . aad eee Ins, o( th) botats ee, | @ Pema bey fe A 7 In, x bA = * A- x x 2 Question 5 ~ 15 points In the 8-puzzle, there are 8 pieces, labeled with the numbers ftom 1 to 8, placed on a 3x3 grid. At each move, a tile can move up, down, left, or right, but only if the destination location is currently empty. For example, in the start state shown above, there are three legal moves: the 8 can move down, the 7 can move right, or the 6 can move up. The goal is to achieve the goal state shown above. The cost of moving a tile is 1. So the cost of a solution is the number of moves it takes to achieve that solution, Example state Goal state Suppose that we create a table where, for every possible state of the 8-puzzle, we store the best ‘move to make from that state. Obviously, it can take a lot of time to compute the best move for cach state, but assume that we do have enough time for that. Then, we define a search algorithm called TABLE-SEARCH, which figures out the next move for any state in constant time using this table that we have created. (@) G points) Make a rough estimation of the memory requirements of TABLE-SEARCH. Explain the assumptions for your estimation. Are the memory requirements realistic for a modern computer? Justify your answer. Tak A Ne ruber “} slabes M r | Ter bhe \ cane there axe Ts pandk ins ; / es Sales Be remoy yrreneds HUS Cope Vy o/s q) ) This chcalal \ ( De yeas ble eer Name: (b) (5 points) Among depth-first search, breadth-first search, iterative deepening search, uniform cost search, and A* with the Manhattan heuristic, which algorithms are more memory- efficient than TABLE-SEARCH? Why? (Manhattan heuristic: Sum of Manhattan distances between cach tile’s current location and its location in goal state) Sumer we de neh tase Ww Can be In} mie ) ST i i \ tL. unl tafe Temdy The OR ymekebs hooge Wrenner Vosyen faves “ [ARLE - SeRecH (©) G points) Among depth-first search, breadth-first search, iterative deepening search, uniform cost search, and A* with the Manhattan heuristic, which algorithms are more time-efficient than TABLE-SEARCH? Why? 7 L\ sbiy MA babes INGLE —seecH IS table I ig Lentale Vime, This is b ol) Oth lagers etter. than Question 6 ~5 points Consider a search space, where each state can be a city, suburb, farmland, or mountain, The goal is to reach any mountain, Here are some rules on the successors of different states: * Successors of a city are always suburbs. Each city has at least one suburb as a successor. * Successors of a suburb can only be cities, or suburbs, ot fatms Each suburb has at least one city as a successor. * Successors of a farm can only be farms, or suburbs, or mountains. Each farm has at least one other farm as a successor. * Successors of a mountain can only be farms. Define the best admissible heuristic h you can define using only the above information (you should not assume knowledge of any additional information about the state space). By "best admissible" we mean that h(n) is always the highest possible value we can give, while ensuring that heuristic h is still admissible. You should assume that every move from one state to another has cost 1. Define your heuristic by specifying the exact value it assigns to each state in the search space. C sing 5x Suburbs ¢ Vem, OS Harbets 10 Name: Question 7-10 points Consider the following 2 player game - Start with 4 sticks on the table - Each player on his/her turn can remove one o two sticks from the table. - fon the player’s turn there are no sticks he/she loses. Suppose you are the MAX player and you start first, Draw the full MINMAX search tree (Triangle for MAX, Inverted Triangle for MIN, Left Branch for remove 2 if possible and Right Branch for remove | if possible). Indicate utility values for terminal nodes (+1 if you win, -1 if you lose). Also compute utility for all intermediate nodes while indicating the branches pruned by ALPHA-BETA pruning. , \ tal Ne medes pomd by = J © i we hed beeen x pind aie pos ble Scous ie dccank, thy pew ck bbicwled (eceubtnn u Question 8 - 10 points Consider the game tree above. States where the MAX player has to play is represented by a ttiangle and states where MIN player plays is denoted by inverted triangle. (a) (5 points) Indicate the EXPEXTIMINMAX value of each non-terminal node. (Just indicate the values next to the nodes in the image above) (©) (2.5 points) Suppose that both MAX and MIN player plays according to the EXPECTIMINMAX algorithm, what is the best and worst possible result for the MAX player? Why? Ses ew expecled Expectinemitax Leedsion Yrede ity, expecte ubiliby Pe fuel Values Ctperel ar Chance Ber: 80 Woast + 1S (©) (2.5 points) Suppose that the MAX player plays according to the EXPECTIMINMAX algorithm but MIN player is playing some unknown strategy, what is the best and worst possible result for the MAX player? Why? ay \ vehus ¢ & c fue on HIN Player Chetee cel 0 12 Question 9 - 10 points Convert the following statements into conjunctive normal form (show the steps): (a) [5 points}: (NOT (A AND (NOT B) AND (NOT C))) AND (NOT (A AND B AND (NOT €))) CNet & om Nel (cotB) of wet(wet¢)) Awd Cot & O@ MTR on wot( wet €)) Cnet A ok Bor C) Ano Cner A oa Net & wC » (b) [5 points]: AOR NOT (B <=> ©) a Oa (ner (Bc Amo €=>8)) A om (ye(Cnstbexe) ono Creve on 8) ) ) prow CrorCnet & ened) o@ Nan Cnerc OF ®)) 0m Gor (ner €) amo ret a) A on(( Not (wet 8) prog wot C AP ot CCB awn vac joe Ce Axe werd) ») (A oR CB med net co) o& Ce fap Ne @> S)ouCcrmo va &) a ©) Pp ((( 98) awd Nee oro (ee wey 5 (@ o&% BY) MNO GI Ow WIT (cca ot &) BR (A oa were ch Ore, OC ) a @ ae ae) ie (a oe & os NeTR) AND (Aa ow wea € oowntp Question 10 — 10 points For each pair of statements, determine if you can apply resolution to those statements. If you can apply resolution, write at least one statement that can be derived by applying resolution to the given pair of statements. If you can apply resolution, apply it blindly; do NOT simplify the resulting sentences. If you cannot apply resolution, just write “cannot apply”. (a) [2.5 points]: Statement 1: A OR (NOT E) Statement 2: B OR D ORE Pow & C& D (b) [2.5 points]: Statement 1: A OR (NOT B) ORC Statement 2:B OR (NOT .C) ORD hm om oem y ‘ f 2,) » Rot (nat &) OF (©) [2.5 points): Statement I: A OR B OR (NOT D) Statement 2: A OR C OR (NOT D) Comme A rely (@ [25 points); Statement 1: A OR (NOT B) Statement 2: A ORB OR (NOT C) om of on 6 (Wet ©) 14 SCRATCH Name: 15 CSE 4308 / 5360 — Fall 2017 Exam 1, Wednesday 09/27/2017 Name: _ LUTION Student ID: (Not providing this information: -10 Points) (Name missing in Individual pages: -5 Points) Total Exam Points: 100 Score ‘Name: Question Points Max Points 1 10 2 10 3 15 4 10 5 15 6 10 G 1s 8 15 Total 100 Question 1 —10 points (a) (5 points). Is there a search problem where breadth-first search is guaranteed to find a solution and iterative deepening search will fail to find a solution? If no, justify. If yes, Lu eviny herabion > IDs de al eine: visible Sagen ode visi fe be BES at Het Gevel. Ser any sé. Bes Jinks IDS call abe ped. Os > Neo (b) (5 points). Is there a search problem where breadth-first search is guaranteed to find a solution and uniform cost search will fail to find a solution? If no, justify. If yes, specify an example. Gaile walk pak cal © les, On Se prsble poral gah been 8 1s Eo 1c) SGD) 2526p Soc cs Ths ne, ves will revs bid SO, Luh aac Pus: YES re pork CA No, Othearceise One Question 2-10 points Describe a state space with 5 states, where the number of nodes visited by iterative deepening search (including the start node) is 15. 6 - © 0-0 LDS wisils ThA Ci mde) Th2: AB Cr reder) Ga Ac C3 re >) TlLa: @eed ( Ars) TE Ss ABeDe (Srebs) - Tet Lett 1S hey Name: Question 3 ~ 15 points Lavberk Mambure_ Dresden 263 Nuremberg im ‘The above (hopefully familiar) map defines a search space, where each city isa state, and each road represents an action that can take the agent from one city to another. The cost of going through a road is simply the length of the road. Let the Start State be Hannover. (a) (5 points) Assuming that the search does not keep track of cities already visited, list (in the order in which they are expanded) the first five nodes (excluding the node for the start state) expanded by uniform cost search and iterative deepening search. (NOTE: Multiple answers may be correct here.) Uniform Cost Search (also specify cost of reaching the node): damn ove (o ») , ee @ BL), Mambeg i) Vom buns (G3) ‘coursed ( Ves), Luebede (214) Iterative Deepening Search (list all required iterations and assume root is depth level 1): ae = ) \ Vanunsves TI ee Hanne, Biemen, Hambary 5 Marge bury és anseh Tha. Ramey, Ben Hanbe, Moddubug, Kond, Lucleck | : (b) (5 points) For our route-finding search problem, precisely define an admissible heuristic function that makes A* behave exactly like uniform cost search (i.e., the sequence of nodes visited by AY is always the same as the sequence of nodes visited by uniform cost search, as Jong as there are no ties among nodes). A) Fuge ib Setkd bbs deny s yin) 4 km) UCS: Felye sorbed by 3S) Se ucs ull ebwe (kee Bho Name: (©) (5 points) Draw the first three levels of the search tree (assume root is level 1) Hamner a 4 aaa g win~ Co D ater ON, es Uu pe x Racor Question 4 —10 points ‘The missionary-cannibal problem is defined as follows: + There are three missionaries and three cannibals on the left bank of the river. ~The goal isto get all six people alive on the right bank of the river. - There is a single boat, and that boat is the only way to move from one bank to the other. ©. The boat cannot go from one bank to the other without at least one person in it ©. The boat cannot carry more than two people on the same trip. If, at any point, there are more cannibals than missionaries on one bank, the cannibals will kill and eat any missionaries who are on that bank. We do not allow any solution that involves the death of any of the six people. In this problem, a state is described by specifying four numbers and a Boolean: A: number of missionaries on the left bank. B: number of cannibals on the left bank. = C: number of missionaries on the right bank, - D: number of cannibals on the right bank. X (Boolean): true if the boat is on the left side, false ifthe boat is on the right side. So the start state is (33007) and the goal state is (0033F). A move corresponds to moving one or two people with the boat, from one bank where the boat currently is to the other bank. The goal is to find a sequence of moves that gets all six people (alive) to the right bank. (a) G points). How many states are there in this search space? Exclude states that result in cannibals eating missionaries. Upper bounds on the number of states may receive partial credit (depending on how close the bounds are). Justify your answer. Tio ® Fink States 2 2 Slate eth Srtsinns onett [0a] ae & Slabs wrtly Gmissars - r= ij. \ =3xd= & Shakes with 2 mtiatan’s on let 12 Yel = Glug With 2 aissionds oo MK [i122 Ve]= a Told Welles Name: (b) (6 points). What is the branching factor in this search problem? Why? (Branching factor is maximum number of actions possible in a state) (Dae odd \ Prot ODA | Bg oa) Ree Cen = Garni wl U — DZ wirsionitn ‘x a? sae ool nubrvivoieg y S [terete WeASiony Se coke Gin lave a rextmsn SE ® S pow dle eelios Baocksy Fachout >, Question 5 ~ 15 points In the 8-puzzle, there are 8 pieces, labeled with the numbers from I to 8, placed on a 3x3 grid. At each move, a tile can move up, down, left, or right, but only if the destination location is, currently empty. For example, in the start state shown above, there are three legal moves: the 8 can move down, the 7 can move right, or the 6 can move up. The goal is to achieve the goal state shown above, The cost of moving a tile is 1. So the cost of a solution is the number of moves it takes to achieve that solution, Example state Goal state Suppose that we create a table where, for every possible state of the 8-puzzle, we store the best move to make from that state. Obviously, it can take a lot of time to compute the best move for each state, but assume that we do have enough time for that. Then, we define a search algorithm called TABLE-SEARCH, which figures out the next move for any state in constant time using this table that we have created. (a) (5 points) Make a rough estimation of the memory requirements of TABLE-SEARCH. Explain the assumptions for your estimation. Are the memory requirements realistic for a modern computer? Justify your answer. Ther Valle woods bs hawe One enby few Cosh Blke oe if O(e ) See Me wis, ALayrere ab ly nwanbe | aber TR our Come Thay Us Os 1) stir tha av 4} shies. Ths i vibe fa min mp wher 12 ‘Name: (b) (S points) Among depth-first search, breadth-first search, iterative deepening search, uniform cost search, and A* with the Manhattan heuristic, which algorithms are more memory- efficient than TABLE-SEARCH? Why? (Manhattan heuristic: Sum of Manhattan distances between each tile’s current location and its location in goal state) Shee “Ure dy end ie yantel pels m Is Te Ge Dr vin Gar nl bons bee as ao be Thee ereo (©) (S points) Among depth-first search, breadth-first search, iterative deepening search, uniform cost search, and A* with the Manhattan heuristic, which algorithms are more time-efficient than TABLE-SEARCH? Why? Trace \eeace bh atable feck. Os vrentined Ww iat ie ee nals line Th & bebber Her all She all cov. ‘ Mon Question 6 — 10 points Consider a search space, where each state can be a city, suburb, farmland, or mountain. The goal is to reach any mountain. Here are some rules on the successors of different states: Successors of a city are always suburbs. Each city has at least one suburb as a successor. Successors of a suburb can only be cities, or suburbs, or farms. Each suburb has at least one city as a successor. ‘© Successors of a farm can only be farms, or suburbs, or mountains. Each farm has at least one other farm as a successor. Successors of'a mountain can only be farms. Define the best admissible heuristic h you can define using only the above information (you should not assume knowledge of any additional information about the state space). By "best admissible” we mean that h(n) is always the highest possible value we can give, while ensuring that heuristic h is still admissible. You should assume that every move from one state to another has cost 1. Define your heur by specifying the exact value it assigns to each state in the search space. ©. cy BiSebwh: Q: Tar X ) Wanuttes 3G) e257 cs Se Re >t s kine Ky) = ! Ma h( sys 2 iS) = V4 Name: Question 7 —15 points Consider the following 2 ~player game ~ Start with 4 sticks on the table - Each player on his/her turn can remove one or two sticks from the table. - fon the player’s turn there are no sticks he/she loses. Suppose you are the MAX player and you start first. Draw the full MINMAX search tree (Triangle for MAX, Inverted Triangle for MIN, Left Branch for remove 2 if possible and Right Branch for remove 1 if possible). Indicate utility values for terminal nodes (+1 if you win, -1 if you lose). Also compute utility for all other nodes and indicate which action the algorithm will select as an optimal strategy. Also indicate the branches (if any) that can be pruned by ALPHA- BETA pruning. Can you use the information about highest and lowest possible utifity value to safely prune any other branches? wy : ain s — Va Nya —P dys (Gers ony yedgs, A? VY we Cradle Mihet £ laser vatible cee Hon une Com pains 4 atthe Irakins seal by © Question 8 — 15 points 0.2 V/ < ara 40 80 0 35 a 3 00 0 02A os) \Q25 20 10 40 Consider the game tree above. States where the MAX player has to play is represented by a triangle and states where MIN player plays is denoted by inverted triangle. (a) (5 points) Indicate the EXPEXTIMINMAX value of each non-terminal node. (Just indicate the values next to the nodes in the image above). Also indicate which action it will select. 16 ‘Name: (b) (5 points) Suppose that both MAX and MIN player plays according to the EXPECTIMINMAX algorithm, what is the best and worst possible result for the MAX player? Why? ae Qecin~s we nade ks = idilil, Delo reult Meds a cheee, Best> 50 worst: o (©) (S points) Suppose that the MAX player plays according to the EXPECTIMINMAX algorithm but MIN player is playing some unknown strategy, what is the best and worst possible result for the MAX player?” Why? Achud Vader a ox MIN Play ~ caves. Ord ea Ces 50 Weest » O SCRATCH Name: CSE 4308 / 5360 001 — Spring 2018 Exam 1, Wednesday 02/14/2018 Name: J) inh Mod Student ID: 62246 (Not providing this information: -10 Points) (Name missing in Individual pages: -5 Points) Name: Total Exam Points: 100 Score I 2 15 e 10 | 4 I 13 5 10 10 6 lo 10 7 15 | a Bal | 8 3 15 Total 3 — | __00 Question 1 - 10 points joints), Is there a search problem where breadth-first search is guaranteed to find justify. If yes, @) solution and iterative deepening search will fail to find a solution? If nc specify an example. ed to find a (b) (5 points), Is there a search problem where breadth-first search is guarantee ail to find a solution? If no, justify. If yes, specify solution and uniform cost search will an example. v Question 2~ 15 points Luebeek Beatin 204 Duesseldorf Karlsruhe anne Munich The above (hopefully familiar) map defines a search space, where each city is a state, and each road represents an action that can take the agent from one city to another. The cost of goin through a road is simply the length of the road. Let the Start State be Dresden. (a) (5 points) Assuming that the search keeps track of cities already visited, list (in the order in which they are expanded) the first five nodes expanded (not generated) by uniform cost search and iterative deepening search. (NOTE: Multiple answers may be correct here.) Uniform Cost Search (also specify cumulative cost of reaching the node): Dresden t a) Barkin ( ) I ) ), erin Cre4) uoacle Cras Nuvem besa ) 6 5 mod nesh Name: __ Iterative Deepening Search (list all required iterations. Each node is counted only once no matter how many iterations it ocours in): Orden tarhn , 20P259 we Honbreg Megacborg bP? 19 admissible heuristic finding search problem, precisely defin behave exactly like uniform cost search (i.e. the sequence of nodes e of nodes visited by uniform cost search, as (b) GS points) For our rou function that makes A* visited by A* is always the same as the sequen: long as there are no ties among nodes). 1 On. $ vy Stanth ret aC ihe + ft wm witk @ S$ n(n) Sher beO (©) G points) Draw the first three levels of the search tree (working under the assumption that ‘suecessors to previously visited cities are not generated) Name: ' WS A Mov} Question 3— 10 point The missionary-cannibal problem is defined as follows: _ There are three missionaries and three cannibals on the = The goal is to get all six people alive on the right bank of the riv = There isasi 5 The boat cannot go from one bank to the other without at 5 The boat cannot carry more than two people on the same If, at any point, there are more cannibals than miss will kill and eat any missionaries who are on that b involves the death of any of the six people. In this problem, a state is deseribed by spec = A:number of missionaries on the left bank. = Br number of cannibals on the left bank. = Cz number of missionaries on the right bank =D: number of cannibals on the right bank - X Boolean): true }00T) and the So, the start state is ( two people with the boa is to find a sequence of moves that gets all six people (alive) to the right 12? Exclude in this search (a) (5 points). How many states are th cannibals eating missionaries. Upper bounds on the number of state boat, and that boat is the only way to move from one jonaries on one bank, sank. We do not allow any solution that om one bank where the boat currently is to the other bar left bank of the river. er bank to the other. { least one person in it tip. he cannibals ifying four numbers and a Boolean: the boat is on the left side, false ifthe boat is on the right side. al state is (0033F). A move corresponds to moving one oF The goal t bank, states that result in -s may receive partial credit (depending on how close the bounds are). Justify your answer. c <4 bre 4 the le h ( es} noric ord pe!) wm tebe bere # rant , wen (©) G points). What is the branching factor in this search problem? Why? (Branchi maximum possible number of actions for a state) Brorchig n AS prodem. 6 “ by bev ery ouncb ¢e Me od mss Va ot _Gonip ad . fi Whe ss Name i = Question 4 — 15 points Inthe 8-purzle, there are 8 pieces, labeled with the numbers from 1 to 8, placed on a 3x3 grid. At each move, a tile can move up, down, left, or right, but only if the destination location is currently empty. For example, in the start state shown above, there are three legal moves: the 8 al is to achieve the goal state ves it ‘can move down, the 7 can move right, of the 6 can move up. The shown above. The cost of moving a tile is 1, So, the cost of a solution is the number of mo takes to achieve that solution. Example state Goal uzzle, we have the best Suppose that we have a table where, for every possible state of the 8 move to make from that state. Obviously, it can take a lot of time to compute the best move for each state, but assume that has already been done and we have the results. Then, we define a search algorithm called TABLE-SEARCH, which figures out the next move for any state in constant time using this table that we have created. (a) (5 points) Make a rough estimation of the memory requirements of TABLE-SEARCH. the assumptions for your estimation. Are the memory requirements realistic for a computer’ Justify your answer. Explai 1 memory of tne WB (b) (5 points) Among depth-first search, breadth-first search, iterative deepening search and uniform cost search, which algorithms are more memory-efficient than TABLE-SEARCH? Why? Treat Tale orth. AS T On Poniry memory memory (©) (S points) Among depth-first search, breadth-first search, iterative deepeni sniform cost search, Which algorithms are more time-efficient than TABLE-SEARCH? Why? VO,one con be rer we ONE Cier fis Cauth blo be Stanh Clrmel se i AM 5 ¥ ~ SSS p Sp\c plu Non n refing m whech eats Target LRT-BE4-V2 Question 5 - 10 points ww, or black. Multiple green, blue, yello\ {ere are some rules on Consider a s states may have the same color. Th the successors of different states, based on thei unidirectional): rch space, where each state can be red al is to reach any black state. t .c color (these successor functions are .an only have green or blue children. or yellow children een children + Redstates ‘+ Blue states can only have r © Green states can only have red or Yellow states can only have green or black children. © Black states can only have red or black children. Define a maximally admissible heuristic that assigns a value to each state based only on the color of that state. Question 6 — 10 points Consider the following three variants of minimax: the simple version, alpha-beta search, and depth-limited search, and consider the games of tic-tac-toe and chess. For each combination of minimax variant and geme, answer the following question: can that minimax variant possibly never terminate, in computing the best next move? Justify your answer vv For chess, assume that the rules do not impose any limit on the total number of moves in a game wpe fee AS OS. bes jor t 1 UNC versy sinpe Jt eS pas Fe ey , A Yon he tr Mpre-bete —dacdere pe — 2+ wil elecy . Plpre-Beve - chess — 74 D wid - hietoche — 1 wil Clucy mise + ky 4 } e ‘ 2 Name: > Question 7-15 poi player Consider the followit Start with 4 sticks on the table = ach player on his/her turn can remove one or two sticks from the table If on the player's turn there are no sticks he/she loses (i.e. if on MAX tum if there are no sticks, he/she loses and the utility of that state is -1 and vice versa) - MAX plays first gle for MAX, Inverted Triangle for MIN, Left Branch for remove 2 if possible and Right Branch for remove 1 if possible). Indicate utility values for terminal nodes (+1 if MAX wins, -1 if MAX loses). Also compute utility for all other nodes and rithm will select as an optimal strategy indicate which action the Indicate the branches (if any) that can be pruned by ALPHA-BETA pruning. Can you use the information about highest and lowest possible utility value to safely prune any other branches? oY ; 4 ALPUP Bera Name:_Sinesh Mody Question 8 ~ 15 points 0.5 a5" 0.2 08 200 80 -50 500 100 0 q0 00 eS OL 09) 0.5, 6.5 600 100 400 200 Consider the game tree above. States where the MAX player has to play is represented by a triangle, states where MIN player plays is denoted by inverted triangle and random chance is represented by circles. For clarity’s sake terminal nodes are represented by just their utility Values. (8) (10 points) Indicate the EXPEXTIMINMAX value of cach non-terminal node. (Just indicate the values next to the nodes in the image above). Also indicate which action it will select. (b) (5 points) After playing the move selected by EXPECTIMINMA X what is maximum and num value that the MAX player wins from a single game. OxMnY - S0O SCRATCH Name: CSE 4308 / 5360 001 — Summer 2018 Exam 1, Monday 07/09/2018 Nice: So LUTION Student ID: (Not providing this information: -10 Points) (Name missing in Individual pages: -5 Points) Total Exam Points: 100 Score Name: Question Points Max Points i 8 2 10 3 10 4 10 5] 2 6 18 7 16 8 12 9 4 Total 100 Name: Question 1 —8 points (a) (4 points), Is there a search problem where breadth-first search is guaranteed to find a solution and iterative deepening search will fail to find a solution? If no, justify. If yes, specify an example. Tteotrve Dex we will visit ene wel. Hak Bes doen Se RES om Gind a Glin IDS well aloe fod Hh lulion. (b) (4 points). Is there a search problem where breadth-first search is guaranteed to find a solution and uniform cost search will fil to find a solution? If no, justify. If yes, specify ‘an example. Was nears 4& cak |e es hon - Zee be he complete Bes los KE Steh AO toch Sr i) ne asia a aos pbb with Zoe shp cA WUE on fel Mule BFS call bt a Qukea. 5 +S A SY Col | 5 S leo cS 5 D Question 2 0 points Luebeck Hamburg Rerlin Dresden, Saarbruseken The above (hopefully familiar) map defines a search space, where each city is a state, and each road represents an action that can take the agent from one city to another. The cost of going through a road is simply the length of the road. Let the Start State be Stuttgart. (a) (5 points) Assuming that the search keeps track of cities already visited, list (in the order in which they are expanded) the nodes expanded (not generated) by uniform cost search and iterative deepening search, till you expand the nodes representing 5 unique cities. (NOTE: Multiple answers may be correct here.) Uniform Cost Search (also specify cumulative cost of reaching the node): Shalt gab C09 Kelsanhe CT) Franhpont (200) INesemes (201) Gaon aus een Cara), cami (2 | s) Name: Iterative Deepening Search (List all required iterations. Consider root to be depth level 1): DL. Sfadtqaat Dt2: Shdtaqah, kearlsaube, anbfeat Nioowbsy Munich. Des - Shedtept Karlsruhe , Snarbuisbn Fy 44 Dandued rrved , Nisombeay Munch (b) (5 points) Draw the first three levels of the search tree (working under the assumption that successors to previously visited cities are not generated). Note: Consider the root to be depth level 1 <-USE THE NEXT PAGE -> Hey] Hb fuscia] Nunoh. aa] - Ln) eet) Sever I [Fates] (ean Nooo Shull 4 Le = hai) [ Kenbonal 5a Name: Question 3 — 10 points The missionary-cannibal problem is defined as follows: - There are three missionaries and three cannibals on the left bank of the river. ~The goal is to get all six people alive on the right bank of the river. - There is a single boat, and that boat is the only way to move from one bank to the other. ©. The boat cannot go from one bank to the other without at least one person in it. (© The boat cannot carry more than two people on the same trip. If, at any point, there are more cannibals than missionaries on one bank, the cannibals will kill and eat any missionaries who are on that bank. We do not allow any solution that involves the death of any of the six people. In this problem, a state is described by specifying four numbers and a Boolean: + A: number of missionaries on the left bank. B: number of cannibals on the left bank. + C:number of missionaries on the right bank. ~ Ds number of cannibals on the right bank. X (Boolean): true if the boat is on the left side, fal the boat is on the right side, So, the start state is (3300) and the goal state is (0033F). A move corresponds to moving one or two people with the boat, from one bank where the boat currently is to the other bank. The goal is to find a sequence of moves that gets all six people (alive) to the right bank. (a) G points). How many states are there in this search space? Exclude states that result in cannibals eating missionaries. Upper bounds on the number of states may receive partial credit (depending on how close the bounds are). Justify your answer. Stalk & Gel clilex ° 3300T, 0035 Shute unite | canmibl on ore heck.» Bao ye = Ops ae Loren Blow Ye 0231 Ve Teh Slates wie Z comb On ome lave’ 7 22 Ye Mlgei 028 et Sky talk 2 ayrbh on opetle bottle . S003 Th os30 We . 4 (b) (S points). What is the branching factor in this search problem? Why? (Branching factor is maximum possible number of actions for a state) “owl RQ cxlios 9 bak be agthy —Oc id Me wn) i oe bake be obs | canmibl — N wastery — { Crnital Ah [| tts = 2 mesionr OL. 5. ‘Name: Question 4 - 10 points Consider a search space, where each state can be red, green, blue, yellow, or black. Multiple states may have the same color. The goal is to reach any black state. Here are some rules on the successors of different states, based on their color (these successor functions are unidirectional): Red states can only have green or yellow children. Blue states can only have red or black children. Green states can only have blue or yellow children, ‘Yellow states can only have yellow or red children. Black states can only have yellow or black children. Define a maximally admissible heuristic that assigns a value to each state based only on the color of that state. Question 5 — 12 points Consider the following 2 ~player game Start with 4 sticks on the table Each player on his/her turn can remove one or two sticks from the table. If on the player's turn there are no sticks he/she loses (i if on MAX turn if there are no sticks, he/she loses and the utility of that state is -1 and vice versa) MAX plays first Draw the full MINMAX search tree (Triangle for MAX, Inverted Triangle for MIN, Left Branch for remove 2 if possible and Right Branch for remove | if possible). h icate utility values for terminal nodes (+1 if MAX wins, -1 if MAX loses). Also compute utility for all other nodes and indicate which action the algorithm will select as an optimal strategy. Indicate the branches (if any) that ean be pruned by ALPHA-BETA pruning. Can you use the information about highest and lowest possible utility value to safely prune any other branches? Name: aie jooned by ofp is taliald my a wekwos Het Lisled pracble Value > +1 flax Com ctl Sttex berches fh ib feds a child usith Lee em eee Con prune all ide, 3 Min rele, Shr borches offer aw child crcl Titec Valire Sh Sronbes pod Hos nig OR slasn unt He Shien. & Question 6 — 18 points Consider the following Map coloring problem where you must color each territory either Red, Green or Blue such that no two adjacent regions have the same color. (2) [4 points]: Draw the constraint graph for this problem. (b) [4 points}: If you are using Backtracking search with MRV and Degree heuristie to select variables. what is the first variable to be selected. (6) [6 points}: Assign the color Red to that variable and show the steps of checking for Are Cb ARV: Fy allchh, dhe AY e 3 Doren berrle S A 1 tte hujhak G) Se A Selec keel 14 Name: 8 - , ce D f& F R RAB hap Mag Rag RAB 6 — . z a D &E iP Qo OS. es te f-c a & ee dD & Fr a @ ME Ge O65 606 LAS A-E A B c D & F R G8 486 ee ag Rae AF wn B@ Cc oO € F ae R eR aw ROB ae a8 Cae F-O: ty beges =—{} > iO reo © Question 7 - 16 points Convert the following statements into conjunctive normal form: (2) [8 points} (BOR (NOT C)) >A Renusve. >, Non (2 ow Crot c) ) on A Detloves, ror B Ano Wet (rer <)) on AY Dovbl Negechon, Cnet &B And oa: Dib. Crp, Cue B&B om A) ANd Ce o« &) ta tw CrP Name: (b) [8 points]: (ASB)SC Remeve <>, Ca D>e Pro BDA) DC. fone > Net ( er A O@B) rnd (ner @ oe e)) ORC DeMonarns (Nor (rota o@ @) oe nor (nots 6k A) ) bac De Horses (C NOT (rer @) Ao nerig ) em (‘1 (words )Asvo 674) ) me wb B a le New . CC 8 FIND Nor &) oe C Bandas &)) oem Dist Psp (C+ Amp DETR) OR z) fw ( Cr Od meat oe®)] oe Dor tarp Co ove) end (nr of &) AO (a on norm) ono CREE Dot Cvp » yee Boe & onc) tro (Ace NaF owe) Ca onde onc) ano (Nor BNO (ever B ve Not A oeC) j— ‘ok John and Mary sign the following contract on January 1, 2018. John will paint the house on March 1, 2018 if and only if Mary pays John $5000 during February 1, 2018. What actually happens on February 1, 2018 and March 1, 2018 is the following: ~ Mary does not pay John any money on February 1, 2018. ~ John paints the house at some point on March 1, 2018. (a) [4 points]: Describe the contract using propositional logic. You also need to list the symbols used and the semantics. MN Corbect: Jerr (b) [3 points}: Describe what happened using propositional logic and using notation consistent with your answer in Question 5(a) TM AS ‘Name: (©) [S points}: Was the contract violated or not? Justify your answer. Mel da events. S21, M=F wHis wll JOH w fe Se Contioe} Users Viste seal Question 9 — 4 points For each pair of statements, determine if you can apply resolution to those statements. If you can apply resolution, write at least one statement that can be derived by applying resolution to the given pair of statements. If you can apply resolution, apply it blindly: do NOT simplify the resulting sentences. If you cannot apply resolution, just write “cannot apply”. (a) [2 points}: Statement 1: A (NOT D) OR wot E) Statement 2: BOR D OR A oa (Na D) ow B oR D (b) 2 points}: Statement 1: A OR B OR (NOT C) Statement 2: A OR B OR (NOT C) ComrSt — Prpglay. 19 SCRATCH Name: 21 CSE 5360 003 — Fall 2018 Exam 1, Monday 09/24/2018 + a Name: Student ID: (Not providing this information: -10 Points) (Name missing in Individual pages: -5 Points) Total Exam Points: 100 Score Name: Question Points Max Points 8 15 10 10 15 12 12 elalalalelefr 18 Total 100 ‘Name: Question 1-8 points (2) G points). Is there a search problem where breadth-first search is guaranteed to find a solution and iterative deepening search will fail to find a solution? Ifno, justify, If yes, No Every theater Go IDS wl vech wedlo Hot RES ull wise a a Repth wel - Sr ony Stabvon thet Besrnll fed, (DS cat fs bse . (b) (4 points). Is there a search problem where breadth-first search is guaranteed to find a solution and uniform cost search will fail to find a solution? Ifno, justify. If yes, specify an example. Jes, 1) au love skeps wth Onn eNtes || act stuck Rw lose While BES ust complek Ex: Question 2~ 15 points Consider the following. The cost of going through a road is simply the length of the road, Let the Start State be A. (a) (10 points) Assuming that the search does not keep track of cities already visited, list (in the order in which they are expanded) the nodes expanded (not generated) by uniform cost search and iterative deepening search. (NOTE: Multiple answers may be correct here.) Ucs. 4 (©), E a 6 © yer & 8,2, Bh, w Fan er Tha: SUB A FS Wn ‘Name: (b) ( points) Draw the first three levels ofthe search tree. Note: Consider the root to be level 1. 5 ce 5 Ak G S Sod Question 3 ~ 10 points ‘The missionary-cannibal problem is defined as follows: + There are three missionaries and three cannibals on the left bank of the river. ~The goal is to get all six people alive on the right bank of the river. + There is a single boat, and that boat is the only way to move from one bank to the other. © The boat cannot go from one bank to the other without at least one person in it. © The boat cannot carry more than two people on the same trip, If, at any point, there are more cannibals than missionaries on one bank, the cannibals will kill and eat any missionaries who are on that bank. We do not allow any solution that involves the death of any of the six people. In this problem, a state is described by specifying four numbers and a Boolean: - A: number of missionaries on the left bank. - B: number of cannibals on the left bank. - Ci number of missionaries on the right bank. + D: number of cannibals on the right bank, ~ X Goolean): true if the boat is on the left side, false if the boat is on the right side. So, the start state is (33007) and the goal state is (0033F). A move corresponds to moving one ot ‘two people with the boat, from one bank where the boat currently is to the other bank. The goal is to find a sequence of moves that gets all six people (alive) to the right bank, (@) G points). How many states are there in this search space? Exclude states that result in cannibals eating missionaries. Upper bounds on the number of states may receive partial credit (depending on how close the bounds are). Justify your answer. Tuikel 4 Final slob: 2 Slotes wet Sinissioaries on (eft (s-0-¥) ne Slale, iSh 3 adsstooles ion nyht (o-3-Ve): 6 Stale wth 2 wrissiovs on Gabe (2 Ye). 2 Skdes rth 2 missinets om apy Cnez Vp? 8 TS 18 IS Slaten Name: (b) (5 points), What is the branching factor in this search problem? Why? (Branching factor is ‘maximum possible number of actions for a state) 2 camrtlds, fesm tre, back be oii, —Leammitl fam one bak be antler — 2 Wtydtoro es her one benke be oni Her bommfe be aga — | Seaton ore, = | comnibl 2 | mestreny oe hone bs ontther to a fies pret ble Peckey Question 4 ~ 10 points Consider a search space, where each state can be red, green, blue, yellow, or black. Multiple states may have the same color. The goal is to reach any black state. Here are some rules on the successors of different states, based on their color (these successor functions are unidirectional): Red states can only have green or blue children. Blue states can only have blue or red children. Green states can only have yellow or blue children, Yellow states can only have red or black children. Black states can only have blue or black children. Define a maximally admissible heuristic that assigns a value to each state based only on the color of that state. ee _—— S ®D 10 Name: Question 5-15 points In the 8-puzzle, there are 8 pieces, labeled with the numbers from | to 8, placed on a 3x3 grid. At each move, a tile can move up, down, left, or right, but only if the destination location is currently empty. For example, in the start state shown above, there are three legal moves: the 8 ‘can move down, the 7 can move right, or the 6 can move up. The goal is to achieve the goal state shown above. The cost of moving a tile is 1. So, the cost of @ solution is the number of moves it takes to achieve that solution Example state Goal state Suppose that we have a table where, for every possible state of the 8-puzzle, we have the best ‘move to make from that state. Obviously, it can take a lot of time to compute the best move for cach state, so assume that has already been done and we have the results. Then, we define a search algorithm called TABLE-SEARCH, which figures out the next move for any state in constant time using this table that we have created. (@) (5 points) Make a rough estimation of the memory requirements of TABLE-SEARCH. Explain the assumptions for your estimation. Are the memory requirements realistic for a ‘modern computer? Justify your answer. A; nw number oh redler Hon Word AMapindertn ae O(n) thre we yt | = ey o(4\) Wwe. nooks bee i (b) (S points) Among depth-first search, breadth-first search, iterative deepening search and uniform cost search, which algorithms are more memory-efficient than TABLE-SEARCH? Why? Since we de Sb Lrrck vesiled Bldles DES bas Whatk nome ty. The Qher weltel trill bwe womery ae es Ta@le — Senace (©) (5 points) Among depth-first search, breadth-first search, iterative deepening search and uniform cost search, which algorithms are more time-efficient than TABLE-SEARCH? Why? “Tag Ur Seance Tse ee lable lnokup Ns pon Lon opreation A teks Grek ie ie Stee oben. Name: Question 6 — 12 points Consider the following 2 -player game = Start with 4 sticks on the table - Each player on his/her turn can remove one or two sticks from the table, = [fon the player's turn there are no sticks he/she loses (ie. if on MAX turn if there are no sticks, he/she loses, and the utility of that state is -1 and vice versa) MAX plays first Draw the full MINMAX search tree (Triangle for MAX, Inverted Triangle for MIN, Left Branch for remove 2 if possible and Right Branch for remove 1 if possible). Indicate utility values for terminal nodes (+1 if MAX wins, -I if MAX loses). Also compute utility for all other nodes and indicate which action the algorithm will select as an optimal strategy. Indicate the branches (if any) that can be pruned by ALPHA-BETA pruning, Can you use the information about highest and lowest possible uti other branches? y value to safely prune any ut Optinec Sterteay We Cam WR hetenum A Aindnim porrible wkbhy vliros he pure Oddiclal robs. M ins odes CON prune all bther Suse Oree tb a secon tathe udilohy “| Hax vebes con ee it all then suseeneys em wlilihy +k Slam im figune shy L~ | ‘Name: Question 7 — 12 points 2 OPTICAL sre TERY, 0.5 v L Y oe 200 80 50 500 0 o1 0.9 0.5 0.5 600 100 400 200 Consider the game tree above, States where the MAX player has to play is represented by a triangle, states where MIN player plays is denoted by inverted triangle and random chance is. represented by circles. For clarity’s sake terminal nodes are represented by just their utility values. (@) (7 points) Indicate the EXPEXTIMINMAX value of each non-terminal node. (Just indicate the values next to the nodes in the image above). Also indicate which action it will be select. (b) (5 points) After playing the move selected by EXPECTIMINMAX what is maximum and minimum value that the MAX player can win from a single game. Pry Vanichron ds dug to toner. - Question 8 — 18 points Consider the following Map coloring problem where you must color each territory either Red, Green or Blue such that no two adjacent regions have the same color. (a) [5 points}: Draw the constraint graph for this problem, (b) [4 points}: If you are using Backtracking search with MRV and Degree heuristic to select variables, what is the first variable to be selected. (©) [5 points]: Assign the color Red to that variable and show the steps of checking for Are consistency (@) [4 points}: What will be the next variable (o be selected (using the same methods as step ») @ Pah Ch) Gf ate eel Le) Mev (a) hulell Hewe A has hilar dose hwutte “| J C4) Cle PA. 16 F ‘Name: co) A-2 ap, FE AF A B c dD Ee F gp Kas Pe eg Aas RAB B-A,.8-c g-D oe B&B c ® Ee Ie R a® eae Qe as AE D-AL D-c) p- 8B. e & e D t - R ag ow a8 AB HB ee ane E-F . ttn cogs te 2 oe Po Free oa Ark lh WYG@) > 8 DEF St Hy, B 7D Rove Waghedt howwsht is SCRATCH Name: 19

You might also like