Sp12 Midterm1 Solutions

17
CS 188 Introduction to Spring 2012 Artificial Intelligence Midterm Exam INSTRUCTIONS You have 1.5 hours. The exam is closed book, closed notes except a one-page crib sheet. Please use non-programmable calculators only. Mark your answers ON THE EXAM ITSELF. If you are not sure of your answer you may wish to provide a brief explanation. All short answer sections can be successfully answered in a few sentences at most. Questions are not sequenced in order of difficulty. Make sure to look ahead if stuck on a particular question. Last Name First Name SID Login All the work on this exam is my own. (please sign) For staff use only Q. 1 Q. 2 Q. 3 Q. 4 Q. 5 Q. 6 Total /12 /12 /12 / 21 / 24 /19 /100

description

Midterm AI

Transcript of Sp12 Midterm1 Solutions

CS 188 Introduction toSpring 2012 Articial Intelligence Midterm ExamINSTRUCTIONS Youhave1.5hours. Theexamisclosedbook,closednotesexceptaone-pagecribsheet. Pleaseusenon-programmablecalculatorsonly. MarkyouranswersONTHEEXAMITSELF. Ifyouarenotsureofyouransweryoumaywishtoprovideabriefexplanation. Allshortanswersectionscanbesuccessfullyansweredinafewsentencesatmost. Questionsarenotsequencedinorderofdiculty. Makesuretolookaheadifstuckonaparticularquestion.LastNameFirstNameSIDLoginAlltheworkonthisexam is my own.(pleasesign)ForstauseonlyQ.1 Q.2 Q.3 Q.4 Q.5 Q.6 Total/12 /12 /12 /21 /24 /19 /1002THISPAGEINTENTIONALLYLEFTBLANKNAME: 31. (12points) SearchABCSDG121333112Answerthefollowingquestionsaboutthesearchproblemshownabove. Breakanytiesalphabetically. Forthequestionsthataskforapath,pleasegiveyouranswersintheformS AD G.(a) (2pt)Whatpathwouldbreadth-rstgraphsearchreturnforthissearchproblem?S G(b) (2pt)Whatpathwoulduniformcostgraphsearchreturnforthissearchproblem?S AC G(c) (2pt)Whatpathwoulddepth-rstgraphsearchreturnforthissearchproblem?S AB D G(d) (2pt)WhatpathwouldA*graphsearch,usingaconsistentheuristic,returnforthissearchproblem?S AC G4(e) (4pt)Considertheheuristicsforthisproblemshowninthetablebelow.State h1h2S 5 4A 3 2B 6 6C 2 1D 3 3G 0 0i. (1pt)Ish1admissible?Yes Noii. (1pt)Ish1consistent?Yes Noiii. (1pt)Ish2admissible?Yes Noiv. (1pt)Ish2consistent?Yes NoAnadmissibleheuristicmustunderestimateorbeequaltothetruecost.Aconsistentheuristicmustsatisfyh(N) h(L) path(N L)forallpathsandnodesNandL.h1overestimatesthecostS Gas5whenitis4,soitisinadmissible.h1isnotconsistentbecauseh(S) h(A) path(S A)isviolatedas5 3 1.h2doesnotoverestimatecostsandisadmissible.h2isnotconsistentbecauseh(S) h(A) path(S A)isviolatedas4 2 1.NAME: 52. (12points) HiveMinds: ReduxLetsrevisitourbugfriendsfromassignment2. Torecap, youcontrol oneormoreinsectsinarectangularmaze-likeenvironmentwithdimensionsM N, asshownintheguresbelow. Ateachtimestep, aninsectcanmoveNorth,East,South,orWest(butnotdiagonally)intoanadjacentsquareifthatsquareiscurrentlyfree,ortheinsectmaystayinitscurrentlocation. Squaresmaybeblockedbywalls(asdenotedbytheblacksquares),butthemapisknown.For the following questions, you should answer for a general instance of the problem, not simply for the examplemapsshown.(a) (6pt)TheFleaYounowcontrolasingleeaasshowninthemazeabove,whichmustreachadesignatedtargetlocationX. However, in addition to moving along the maze as usual, your ea can jump on top of the walls. Whenonawall,theeacanwalkalongthetopofthewallasitwouldwheninthemaze. Itcanalsojumpoofthewall,backintothemaze. Jumpingontothewallhasacostof2,whileallotheractions(includingjumpingbackintothemaze)haveacostof 1. Notethattheeacanonlyjumpontowallsthatareinadjacentsquares(eithernorth,south,west,oreastoftheea).i. (2pt)Giveaminimalstaterepresentationfortheabovesearchproblem.Thestateisthelocationoftheeaasan(x, y)coordinate. Themapisknown, includingwallsandthegoal,andtheactionsoftheeadependonlyonitslocation.ii. (2pt)Givethesizeofthestatespaceforthissearchproblem.ThestatespaceisM N. Theeacanoccupyanyfreelocationinagivenmaze, andanysquaremightbefreeorawallinamaze,soanyoftheM Nlocationsarepossible.iii. (2pt)Isthefollowingheuristicadmissible? Yes Nohea=theManhattandistancefromtheeatothegoal.It is yielded by the relaxed problem where the ea passes through walls. It never overestimates because1. awallcanneverdecreasethelengthofapathtothegoaland2. thecostoftheeajumpingupawall(2)ishigherthanthecostofmoving.Ifitisnot admissible,provideanontrivialadmissibleheuristicinthespacebelow.6(b) (6pt)LongLostBugFriendsYou now control a pair of long lost bug friends. You know the maze, but you do not have any informationabout whichsquareeachbugstarts in. Youwant tohelpthebugs reunite. Youmust poseasearchproblem whose solution is an all-purpose sequence of actions such that, after executing those actions, bothbugs will be on the same square,regardless of their initial positions. Any square will do, as the bugs havenogoal inmindotherthantoseeeachotheronceagain. Bothbugsexecutetheactionsmindlesslyanddonotknowwhethertheirmovessucceed; if theyuseanactionwhichwouldmovetheminablockeddirection,theywillstaywheretheyare. Unliketheeainthepreviousquestion,bugscannot jumpontowalls. Bothbugscanmoveineachtimestep. Everytimestepthatpasseshasacostofone.i. (2pt)Giveaminimalstaterepresentationfortheabovesearchproblem.Thestateisalistofbooleanvariables, oneforeachpositioninthemaze, whichmarkswhethertheposition could contain a bug. There is no need to separately keep track of the bugs since their startingpositionsarenotknown;toensuretheymeetonlyasinglesquaremustbepossibleforboth.ii. (2pt)Givethesizeofthestatespaceforthissearchproblem.Thesizeis2MNsinceeveryof theM Npossiblemazepositionsmustbeconsideredandeverypositionhasabooleanvariable. Afull stateistheproductof theindividual positionstates, whicharebinaryvaluedforthebaseof2.iii. (2pt)Giveanontrivialadmissibleheuristicforthissearchproblem.hfriends=themaximumManhattandistanceofallpossiblepairsofpointsthebugscanbein.Thisisneveranoverestimatebecausethenumberof stepstojointheinsectswithcertaintyisatleast the shortest path (with no obstacles) between their farthest possible locations from one another.Rememberthatthestartinglocationsareunknownsothebugscannotsimplybecontrolledtomovetowardeachother.NAME: 73. (12points) A*GraphSearchfunctionA*GraphSearch(problem)fringe anemptypriorityqueuefringe Insert(Make-Node(Initial-State[problem]),fringe)closed anemptysetAddInitial-State[problem]toclosedloopif fringeisemptythenreturnfailureendifnode Remove-Front(fringe)if Goal-Test(problem,State[node])thenreturnnodeendifforsuccessorinGetSuccessors(problem,State[node])doif successornotinclosedthenAddsuccessortoclosedfringe Insert(Make-Successor-Node(successor,node),fringe)endifendforendloopendfunctionTheaboveimplementationofA*graphsearchmaybeincorrect! In the list below circle all of the problems thatthebugsmaycausewhenexecutinggraphsearchandjustifyyouranswer. Notethatthefringeisapriorityqueue. NodesareinsertedintothefringeusingthestandardkeyforA*, namelyf=g + h. hisaconsistentheuristic.(a) TheGetSuccessorsfunctioncouldbecalledmultipletimesonthesamestate.(b) Thealgorithmisnolongercomplete.(c) Thealgorithmcouldreturnasuboptimalsolution.(d) Theimplementationisincorrect,butnoneoftheaboveproblemswillbecaused.(e) Theimplementationiscorrect.Toreceiveanycredityoumustbrieyjustifyyouranswerinspacebelow.Thebugistheinsertionofsuccessor intoclosedattimeofinsertionofanodeintothefringe,ratherthanatthetimethatnodegetspoppedfromthefringe. Asaconsequenceofthisbug,therstpathencounteredtoastatewillputthatstateintheclosedlist. Thiscancausesuboptimalityasweonlyhavetheguaranteethatastatehasbeenreachedoptimallyonceanodereachingitgetspoppedothefringe.(a) is False as when a node that reaches a state s is placed in the fringe,that state s is also put on the closedlist. Thismeansneverinthefuturecananodebeplacedonthefringethatendsinthatsamestates,andhencethesamestatescanbetheargumenttoGetSuccessorsatmostonce.(b) is False. A* tree search is complete. The dierence is that the above algorithm will cut o parts of the treesearchwheneverithasplacedanodeonthefringeinthepastthatendsinthesamestate. Socomparedto tree search we only lose copies of subtrees that we are covering. Hence the above algorithm is complete.(c) isTrue. Seeexplanationatbeginningofsolution.(d) isFalse.(e) isFalse.84. (21points) TimeManagementTwo of our GSIs,Arjun and Woody,are making their schedules for a busy morning. There are ve tasks to becarriedout:(F)Pickupfoodforthegroupsresearchseminar,which,sadly,takesoneprecioushour.(H)Preparehomeworkquestions,whichtakes2consecutivehours.(P)PreparethePR2robotforagroupofpreschoolersvisit,whichtakesonehour.(S)Leadtheresearchseminar,whichtakesonehour.(T)TeachthepreschoolersaboutthePR2robot,whichtakes2consecutivehours.Thescheduleconsistsofone-hourslots: 8am-9am,9am-10am,10am-11am,11am-12pm. Therequirementsforthescheduleareasfollows:(a) InanygiventimesloteachGSIcandoatmostonetask(F,H,P,S,T).(b) ThePR2preparation(P)shouldhappenbeforeteachingthepreschoolers(T).(c) Thefoodshouldbepickedup(F)beforetheseminar(S).(d) Theseminar(S)shouldbenishedby10am.(e) Arjunisgoingtodealwithfoodpickup(F)sincehehasacar.(f) TheGSInotleadingtheseminar(S)shouldstill attend, andhencecannotperformanothertask(F, T,P,H)duringtheseminar.(g) Theseminar(S)leaderdoesnotteachthepreschoolers(T).(h) TheGSIwhoteachesthepreschoolers(T)mustalsopreparethePR2robot(P).(i) Preparinghomeworkquestions(H)takes2consecutivehours,andhenceshouldstartatorbefore10am.(j) Teachingthepreschoolers(T)takes2consecutivehours,andhenceshouldstartatorbefore10am.ToformalizethisproblemasaCSP,usethevariablesF,H,P,SandT.ThevaluestheytakeonindicatetheGSIresponsibleforit,andthestartingtimeslotduringwhichthetaskiscarriedout(forataskthatspans2hours, thevariablerepresentsthestartingtime, butkeepinmindthattheGSIwill beoccupiedforthenexthouralso- makesureyouenforceconstraint(a)!). Hencethereareeightpossiblevaluesforeachvariable,whichwewilldenotebyA8,A9,A10,A11,W8,W9,W10,W11,wherethelettercorrespondstotheGSIandthe number corresponds to the time slot. For example, assigning the value of A8 to a variables means that thistaskiscarriedaboutbyArjunfrom8amto9am.(a) (2pt)WhatisthesizeofthestatespaceforthisCSP?85sinceeverytaskvariablehas8values, 4timeslots 2GSIstocarrythemout, andthereare5suchtasks.(b) (2pt)Whichofthestatementsaboveincludeunaryconstraints?Aunaryconstraintconstrainsthedomainofasinglevariable. (d),(e),(i),(j)areunaryconstraints. (i)and(j)expressbothunaryconstraints(onthetimeof thetasks)andbinaryconstraints(thelengthoftasksexcludesotherassignmentsduringtheirtime).(c) (4pt)Inthetablebelow, enforceall unaryconstraintsbycrossingoutvaluesinthetableontheleftbelow. Ifyoumadeamistake,crossoutthewholetableandusetherightone.F A8 A9 A10 A11 W8 W9 W10 W11H A8 A9 A10 A11 W8 W9 W10 W11P A8 A9 A10 A11 W8 W9 W10 W11S A8 A9 A10 A11 W8 W9 W10 W11T A8 A9 A10 A11 W8 W9 W10 W11(d) (3pt)Startfromthetableabove, selectthevariableSandassignthevalueA9toit. Performforwardcheckingbycrossingoutvaluesinthetablebelow. Againthetableontherightisforyoutouseincaseyoubelieveyoumadeamistake.NAME: 9F A8 A9 A10 A11 W8 W9 W10 W11H A8 A9 A10 A11 W8 W9 W10 W11P A8 A9 A10 A11 W8 W9 W10 W11S A8 A9 A10 A11 W8 W9 W10 W11T A8 A9 A10 A11 W8 W9 W10 W11Forwardcheckingprunes thevariables domains of values inconsistent withS=A9, including: otherchoices for S, conicting time slots for A9 (a), the choices of F that do not precede 9 (c), W from workingduring9(f),andAteachingthepreschoolers(g).(e) (3pt) Based on the result of (d), what variable will we choose to assign next based on the MRV heuristic(breaking ties alphabetically)?Assign the rst possible value to this variable, and perform forward check-ingbycrossingoutvaluesinthetablebelow. Againthetableontherightisforyoutouseincaseyoubelieveyoumadeamistake.Variable F isselectedandgetsassignedvalue A8.F A8 A9 A10 A11 W8 W9 W10 W11H A8 A9 A10 A11 W8 W9 W10 W11P A8 A9 A10 A11 W8 W9 W10 W11S A8 A9 A10 A11 W8 W9 W10 W11T A8 A9 A10 A11 W8 W9 W10 W11Havewearrivedatadeadend(i.e.,hasanyofthedomainsbecomeempty)?No.(f ) (4pt)Wereturntotheresultfromenforcingjusttheunaryconstraints,whichwedidin(c). SelectthevariableSandassignthevalueA9. Enforcearcconsistencybycrossingoutvaluesinthetablebelow.F A8 A9 A10 A11 W8 W9 W10 W11H A8 A9 A10 A11 W8 W9 W10 W11P A8 A9 A10 A11 W8 W9 W10 W11S A8 A9 A10 A11 W8 W9 W10 W11T A8 A9 A10 A11 W8 W9 W10 W11(g) (2pt)Compareyouranswersto(d)andto(f). Doesarcconsistencyremovemorevaluesorlessvaluesthanforwardcheckingdoes?Explainwhy.Arc consistency removes more values by checking more relationships between variables: AC checks consis-tencybetweeneverypairofvariables,andre-checksafterdomainpruning,whileFConlychecksbetweenassignedandunassignedvariables.(h) (1pt) Check your answer to (f). Without backtracking, does any solution exist along this path?Providethesolution(s)orstatethatthereisnone.ACalongthispathgives1solution: F: A8 H: A10 P: W8 S: A9 T: W10Backtrackingisunnecessarysincetheconstraintshavebeenenforcedbyarcconsistencyandonlysinglevaluesremainedineachdomain.105. (24points) SurrealistPacmanInthegameof SurrealistPacman, Pacman playsagainstamovingwall . OnPacmansturn, Pacmanmustmoveinoneof thefourcardinal directions, andmustmoveintoanunoccupiedsquare. Onthewallsturn, the wall must move in one of the four cardinal directions, and must move into an unoccupied square. Thewallcannotmoveintoadot-containingsquare. Stayingstillisnotallowedbyeitherplayer. Pacmansscoreisalwaysequaltothenumberofdotshehaseaten.Therstgamebeginsinthecongurationshownbelow. Pacmanmovesrst.(a) (2pt)Drawagametreewithonemoveforeachplayer. Drawonlythelegalmoves.S E0e0e0eS N E0e0e0eSW E(b) (1pt)Accordingtothedepth-limitedgametreeyoudrewabovewhatisthevalueof thegame? UsePacmansscoreasyourevaluationfunction.0,sinceallleaveshavevalue0asPacmancannoteatadotinonemove.(c) (1pt)If weweretoconsideragametreewithtenmovesforeachplayer(ratherthanjustone), whatwouldbethevalueofthegameascomputedbyminimax?1. Pacmancanforceawinandeatthedotintenmoves,sothescoreincreasesto1oncethedotiseatenandremainsthere. Foranexampleofsuchawin,considerthesequencesE-S-S-EorE-S-E-SbyPacmanandthemovementrulesoftheplayers.NAME: 11A second game is played on a more complicated board. A partial game tree is drawn, and leaf nodes have beenscoredusingan(unknown)evaluationfunctione.(d) (3pt)Inthedashedboxes,llinthevaluesofallinternalnodesusingtheminimaxalgorithm.(e) (3pt) Cross o any nodes that are not evaluated when using alpha-beta pruning (assuming the standardleft-to-righttraversalofthetree).8e6e7e9e2e3e2e4e0e5e6e5e8e10e2e59 10 4 645Runningalpha-betapruningonthegametree.Root: = , = --Leftwall: = , = ----Leafnode: e=8. Propagatee=8backtoparent.--Leftwall: Currentvalueis8. = , = 8. Maxdoesnthaveabestvalue,socontinueexploring.----Leafnode: e=6. Propagatee=6backtoparent.--Leftwall: Currentvalueis6. = , = 6. Maxdoesnthaveabestvalue,socontinueexploring.----Leafnode: e=7. Propagatee=7backtoparent.--Leftwall: Noupdate. Currentvalueis6. = , = 6. Maxdoesnthaveabestvalue,socontinueexploring.----Leafnode: e=5. Propagatee=5backtoparent.--Leftwall: Currentvalueis5. Weredonehere,sopropagate5toroot.Root: Currentvalueis5. = 5, = . Exploreright.--Rightwall: = 5, = .----1stPac: = 5, = ------Leafnode: e=9. Propagatee=9backtoparent.----1stPac: Currentvalueis9. = 9, = MINdoesnthaveabestvalue,socontinueexploring.------Leafnode: e=2. Propagatee=2backtoparent.----1stPac: Nochange. Currentvalueis9. Propagate9toparent.--Rightwall: Currentvalueisnow9. =5, =9. MINwantsanythinglessthan9atthispoint,butitsstillpossibleforMAXtogetmorethan5. Continueexploring.----2ndPac: = 5, = 9------Leafnode: e=8. Propagatee=8backtoparent.- - - - 2ndPac: Currentvalueisnow8. =8, =9. Again, still possibleforbothplayerstobenet(Imaginevalue=8.5). Continueexploring.12------Leafnode: e=10. Propagatee=10backtoparent.- - - - 2nd Pac: Current value is now 10. So now, we know that v> , which means that one of the playersisgoingtobeunhappy. MAXwantssomethingmorethan10, butMINisonlysatisedwithsomethinglessthan9,sowedonthavetokeepexploring.----PRUNEe=2.----2ndPac: returnsvalueof10toparent.- - LeftWall: Nochangeinvalue, currentvalueisstill 9. =5, =9. Again, still possibleforbothplayerstobenet,socontinueexploring.----3rdPac: = 5, = 9------Leafnode: e=3. Propagatee=3backtoparent.----3rdPac: Currentvalueis3. = 5, = 9. Continueexploring.------Leafnode: e=2. Propagatee=2backtoparent.----3rdPac: Nochangeinvalue. Currentvalueis3. = 5, = 9. Continueexploring.------Leafnode: e=4. Propagatee=4backtoparent.----3rdPac: Currentvalueis4. Weredone,soreturnvalueof4toparent.- - LeftWall: Currentvaluebecomes4. Atthispoint, weknowthatMINwantsanythingthatislessthanorequalto4. However,MAXisonlysatisedwithsomethingthatis5orgreater. Hence,wedontneedtoexploretherestofthechildrenofthisnodesinceMAXwillneverletthegamegetdowntothisbranch.--Prunerest(Filling values returned by alpha-beta or not crossing o children of a crossed o node were not penalized.)NAME: 13Supposethatthisevaluationfunctionhasaspecialproperty: itisknowntogivethecorrectminimaxvalueofanyinternal nodetowithin2, andthecorrectminimaxvaluesof theleaf nodesexactly. Thatis, if visthetrueminimaxvalueof aparticularnode, andeisthevalueof theevaluationfunctionappliedtothatnode,e 2 v e + 2,andv= eifthenodeisadashedboxinthetreebelow.Usingthisspecialproperty,youcanmodifythealpha-betapruningalgorithmtoprunemorenodes.(f ) (10pt) Standard alpha-beta pseudocode is given below (only the max-value recursion). Fill in the boxesontherighttoreplacethecorrespondingboxesontheleftsothatthepseudocodeprunesasmanynodesaspossible,takingaccountofthisspecialpropertyoftheevaluationfunction.functionMax-Value(node,,)e EvaluationFunction(node)if nodeisleaf thenreturneendif(1)v forchild Children(node)dov Max(v, Min-Value(child, , )) (2)if v thenreturnvendif Max(, v)endforreturnvendfunctionFillintheseboxes:(1)if e 2 thenreturne 2endif(2)v Max(v, Min-Value(child,Max(, e 2), Min(, e + 2)))For (1), the special propertyguarantees e 2v ande 2is thesmallest suchvalue, sovissubstituted out without violatingtheinequality.For (2), both sides of the in-equality for the special propertyareusedtoboundthebestactionvalue for MAX and the bestaction value for MIN. and are sharpenedwhenever the 2 guarantee on e gives a higherlower-bound () or lower upper-bound().(Variationsarepossible.)14Thesamegametreeisshownbelow,withtheevaluationfunctionappliedtointernal aswellasleafnodes.(g) (4pt) In the game tree below cross o any nodes that can be pruned assuming the special property holdstrue. Ifyouarenotsureyoucorrectlyformalizedintopseudo-codeyourintuitiononhowtoexploitthespecial property for improved pruning, make sure to annotate your pruned nodes with a brief explanationofwhyeachofthemwaspruned.8e6e7e9e2e3e2e4e8e10e2e0e5e6e5e4e6e5e8e7e5e10eRunningpruningongametreeindetail. W1andW2refertotheleftandrightwallnodesrespectively.P1,P2,P3,P4refertoPacmannodesonthethirdlevel,lefttoright.Root: Evaluationfunctionreturns5. Rangeofvalue: [3,7]. Set : 3, : 7andexplore(W1,, ).-W1: Evaluationfunctionreturns4. Rangeofvalue: [2,6]. Set : 3, : 6.--Leafnode: e = 8. Send8backtoW1.-W1: v= 8. v< ?No. ThismeansthatMAXmightstillpreferthispath.--Leafnode: e = 6. Send6backtoW1.-W1: 6 < 8sov= 6. v< ?No. Continueexploring.--Leafnode: e = 7. Send7backtoW1.-W1: 7 > 6,sonochange,v= 6. v< ?No. Continueexploring.--Leafnode: e = 5. Send5backtoW1.-W1: 5 < 6,sov= 5. Done. Send5backtoroot.Root: Getsvalue5,sov= 5. : max(3, 5) = 5, : 7. StillexploringrightbranchsinceMAXcouldgetavalue5 v 7. Explore(W2,, ).-W2: Evaluationfunctionreturns6. Rangeofvalues[4, 8]. : 5, : 7,explore(P1,, ).--P1: Evaluationfunctionreturns8. Range: [6, 10], : 6, : 7.---Leafnode: e = 9. Sende = 9backtoP1.--P1: v= 9. v> ? Yes!. WecanpruneheresinceP1wantsanyvalue> 9. However,attherootweknowthatthemaximumvaluethatMAXcangetis7. Hence,thereisnowaythegamecangetdowntoP1. (Meaningthatthevalueattherootcannotbe9).---Leafnode: Prunee = 2. Return9toW2.-W2: v= 9. , dontchange: : 5, : 7. Explore(P2,, ).- - P2: Evaluation function returns 10. Range [8, 12], : 8, : 7. Notice that the best value for MIN thatcanbeachievedatP2is8. However,thebestvalueforMINattherootis7. Hence,theresnowaythegamecangetdowntoP2. (Meaningthevalueoftherootcannotby8). Pruneall ofP2schildren!. Wecanreturn8toW2sinceweknowthatthereissomeotherpaththroughW2thatyieldsareward 7.NAME: 15-W2: v: min(8, 9) = 8, : 5, : 7. v< ?No! Explore(P3,, ).--P3: Evaluationfunctionreturns5. Range: [3, 7], : 5, : 7.---Leafnode: e = 5. Send3backtoP3.--P3: v= 3.v> ?No! MeaningMINmightstillpreferthisbranch. : 5, : 7.---Leafnode: e = 2. Send2backtoP3.--P3: v= 3.v> ?No! : 5, : 7.---Leafnode: e = 4. Send4backtoP3.--P3: v= 4. Done. Return4toW2.-W2: v:min(8, 4)=4, :5, :7. v 0. Assumetheusedheuristicisconsistent.True False Depth-rstgraphsearchisguaranteedtoreturnanoptimalsolution.False. Depthrstsearchhasnoguaranteesof optimality. Further, itmeasurespathsinlengthandnotcost.True False Breadth-rstgraphsearchisguaranteedtoreturnanoptimalsolution.False. Breadthrstsearchhasnoguaranteesofoptimalityunlesstheactionsallhavethesamecost,whichisnotthecasehere.True False Uniform-costgraphsearchisguaranteedtoreturnanoptimalsolution.True. UCS expands paths in order of least total cost so that the optimal solution is found.True False Greedygraphsearchisguaranteedtoreturnanoptimalsolution.False. Greedysearchmakesnoguaranteesof optimality. Itreliessolelyontheheuristicandnotthetruecost.True False A*graphsearchisguaranteedtoreturnanoptimalsolution.True,sincetheheuristicisconsistentinthiscase.True False A*graphsearchisguaranteedtoexpandnomorenodesthandepth-rstgraphsearch.False. Depth-rstgraphsearchcould,forexample,godirectlytoasub-optimalsolution.True False A*graphsearchis guaranteedtoexpandnomore nodes thanuniform-costgraphsearch.True. Theheuristiccouldhelptoguidethesearchandreducethenumberof nodesex-panded. Intheextremecasewheretheheuristicfunctionreturns zerofor everystate,A*andUCSwill expandthesamenumberof nodes. Inanycase, A*withaconsistentheuristicwillneverexpandmorenodesthanUCS.(b) (2pt) Iterative deepening is sometimes used as an alternative to breadth rst search. Give one advantageof iterative deepening over BFS, and give one disadvantage of iterative deepening as compared with BFS.Beconciseandspecic! Advantage: iterativedeepeningrequireslessmemory(limitedtothecurrentdepth). Disadvantage: iterativedeepeningrepeatscomputationsandthereforecanrequireadditionalruntime.(c) (2pt) Consider two dierent A* heuristics,h1(s) and h2(s),that are each admissible. Now,combine thetwoheuristicsintoasingleheuristic,usingsome(notyetspecied)functiong. Givethechoiceforgthatwill result in A* expanding a minimal number of nodes while still guaranteeing admissibility. Your answershouldbeaheuristicfunctionoftheformg(h1(s), h2(s)).g=max(h1(s), h2(s)). Considerthetruecosth(s). Foradmissibility, bothh1(s) h(s)andh2(s) h(s), and their max can be no larger. h(s) leads to expanding the minimal number of nodes: in particularit expands the nodes of an optimal path to a goal and no more. g is the closest heuristic to h of guaranteedadmissibilitybyh1andh2andsoexpandsaminimalnumberofnodesforfunctionsoverh1, h2.(d) (3pt)Leth1(s)beanadmissibleA*heuristic. Leth2(s) = 2h1(s). Then:True False ThesolutionfoundbyA*treesearchwithh2isguaranteedtobeanoptimalsolution.False. h2is not guaranteedto be admissible since onlyone side of the admissibilityinequalityisdoubled.True False ThesolutionfoundbyA*treesearchwithh2isguaranteedtohaveacostatmosttwiceasmuchastheoptimalpath.True. In A* tree search we always have that as long as the optimal path to the goal has notbeenfound,aprexofthisoptimalpathhastobeonthefringe. Hence,ifanon-optimalsolutionisfound, thenattimeof poppingthenon-optimal pathfromthefringe, apaththatisaprexof theoptimal pathtothegoal issittingonthefringe. Thecost gof aNAME: 17non-optimal solution when popped is its f-cost. The prex of the optimal path to the goalhas an f-cost of g +h0= g +2h1 2(g +h1) 2C,with Cthe optimal cost to the goal.Hencewehavethat g 2Candthefoundpathisatmosttwiceaslongastheoptimalpath.True False ThesolutionfoundbyA*graphsearchwithh2isguaranteedtobeanoptimalsolution.False. h2is not guaranteed to be admissible and graph search further requires consistencyforoptimality.(e) (2pt)ConsideraCSPwiththreevariables: A,B,andC. Eachofthethreevariablescantakeononeoftwovalues: either1or2. Therearethreeconstraints: A =B, B =C, andA =C. Inthetablebelow,crossoallvaluesthatareeliminatedbyenforcingarc-consistency. Alsowriteonesentenceinterpretingyouranswer.A 1 2B 1 2C 1 2Novariablesshouldbecrossedout. ThereisnosolutiontothisCSP,butarc-consistencydoesnotdetectthis. Thereisaconsistentassignmentintheheadforeachvalueofthetailandnovaluesareeliminated.(f ) (3pt)Consideranadversarialgametreewheretherootnodeisamaximizer,andtheminimaxvalueofthegameisvM. Now, alsoconsideranotherwiseidentical treewhereeveryminimizernodeisreplacedwithachancenode(withanarbitrarybutknownprobabilitydistribution). TheexpectimaxvalueofthemodiedgametreeisvE.True False vMisguaranteedtobelessthanorequaltovE.True. The maximizer is guaranteed to be able to achieve vMif the minimizer acts optimally.He can potentially do better if the minimizer acts suboptimally (e.g. by acting randomly).The expectation at chances nodes can be no less than the minimum of the nodes successors.True False Usingtheoptimal minimax policyinthegamecorrespondingtothemodied(chance)gametreeisguaranteedtoresultinapayoofatleastvM.True. The minimax policy is always guaranteed to achieve payo of at least vM, no matterwhattheminimizerdoes.True False Usingtheoptimal minimax policyinthegamecorrespondingtothemodied(chance)gametreeisguaranteedtoresultinapayoofatleastvE.False. InordertoachievevEinthemodied(chance)game,themaximizermayneedtochangehisorherstrategy. Theminimaxstrategymayavoidactionswheretheminimumvalue is less than the expectation. Moreover, even if the maximizer followed the expectimaxstrategy,heorsheisonlyguaranteedvEinexpectation.