15-381 Spring 06 Assignment 3: Rbt Mtin, Game Thery Questins t Rng Yan(yanrng@cs.cmu.edu) Out: 2/21/06 Due: 3/7/06 Name: Andrew ID: Please turn in yur answers n this assignment (etra cpies can be btained frm the class web page). This assignment must be turned in at the beginning f class at 1:30pm n March 7. Please write yur name and Andrew ID in the space prvided n the first page, and write yur Andrew ID in the space prvided n each subsequent page. This is wrth 5 pints: if yu d nt write yur name/andrew ID in every space prvided, yu will lse 5 pints. This assignment has n cding prblems Late plicy. Yur assignment is due at 1:30pm n 3/7. Submitting yur wrk late will affect its scre as fllws: If yu submit it after 1:30pm n 3/7 but befre 1:30pm n 3/8, it will receive 90% f its scre. If yu submit it after 1:30pm n 3/8 but befre 1:30pm n 3/9, it will receive 50% f its scre. If yu submit it after 1:30pm n 3/9, it will receive n scre. Cllabratin plicy. Yu are t cmplete this assignment individually. Hwever, yu are encuraged t discuss the general algrithms and ideas in the class in rder t help each ther answer hmewrk questins. Yu are als welcme t give each ther eamples that are nt n the assignment in rder t demnstrate hw t slve prblems. But we require yu t: nt eplicitly tell each ther the answers nt t cpy answers nt t allw yur answers t be cpied In thse cases where yu wrk with ne r mre ther peple n the general discussin f the assignment and surrunding tpics, we ask that yu specifically recrd n the assignment the names f the peple yu were in discussin with (r nne if yu did nt talk with anyne else). This is wrth five pints: fr each prblem, space has been prvided fr yu t either write peple s names r nne. If yu leave any f these spaces blank, yu will lse five pints. This will help reslve the situatin where a mistake in general discussin led t a replicated weird errr amng multiple slutins. This plicy has been established in rder t be fair t the rest f the students in the class. We will have a grading plicy f watching fr cheating and we will fllw up if it is detected. 1 The Rbt Mtin Planning Prblem (15 pints) References (names f peple I talked with regarding this prblem r nne ): Cnsider the rbt planning prblem illustrated in the fllwing figure. 1
Andrew ID: 2 1.1 (5 pints) Draw (apprimately) the path fund by using ptential fields. 1.2 (5 pints) Draw (apprimately) the path fund by using apprimate cell decmpsitin (there are several pssibilities). Briefly discuss what are the advantages and disadvantages f the apprimate cell decmpsitin technique.
Andrew ID: 3 1.3 (5 pints) Draw (eactly) the path fund by using the visibility graph technique. Draw the initial visibility graph. Briefly discuss what are the advantages and disadvantages f the visibility graph technique. 2 The Game Play Prblem(40 pints) References (names f peple I talked with regarding this prblem r nne ): Gmku, g-mku, r gbang is an abstract strategy bard game with tw players. It is traditinally played with black and white stnes n a 19 * 19 g bard. One player has black stnes and the ther has white stnes. T simplify, we assume the game are played n a 10*10 bard with crsses() representing black stnes and circles() representing white stnes. In this game, black plays first and players alternate in placing a stne f their clr n an empty space. The winner is the first player t get an unbrken rw f five stnes hrizntally, vertically, r diagnally. Sme eamples f the winning situatins fr black stnes are shwn as fllws. Please see http://en.wikipedia.rg/wiki/gmku fr mre details abut this game. This game is an eample f 2-player zer-sum deterministic game f perfect infrmatin.
Andrew ID: 4 2.1 (5 pints) Any tw-player zer-sum deterministic game can be represented by the fllwing quintuple: (S, I, Succ, T, V), where S is the entire space f game states, I is the initial state, Succ is the successr functin, T are the terminal states, V maps frm terminal states t its payff/utility. Please describe what is each element f the quintuple in the Gmku game. 2.2 (10 pints) Design tw different heuristic evaluatin functins fr this game given the current state f the bard. In this prblem, the evaluatin functin shuld be able t handle the intermediate states f the game. Fr eample, yu cannt define +1 fr black wins, -1 fr white wins, 0 therwise because it cannt prvide useful infrmatin fr the intermediate states. (Hints: yu can cnsider the number f cnnected stnes n the bard.) In the fllwing discussins, let us assume we have arrived t the fllwing state f bard. Player is ging t mve net.
Andrew ID: 5 2.3 (10 pints) Slve the whle game and find the net mve fr with the mini-ma algrithm. Rather than using heuristic evaluatin functins, we will evaluate the bard state based n the simple win/lss between and (i.e., +1 fr wins, -1 fr lses and 0 therwise). Fr the purpse f grading, yu nly need t cnsider the ndes labeled in the fllwing figure (frm 1 t 4) t epand and must use the ascending rder fr epansin, i.e., n each level f epansin, yu must epand the lwest remaining numbered nde befre epanding the higher numbered ndes. Any nde where a player have 5 stnes cnnected is the leave nde and has n children. Yu d *nt* need t draw the entire game tree in this prblem, but yu need t draw the best path fund by the mini-ma algrithm (if there are several best paths, yu shuld shw the first ne epanded). Fr each nde in the path, indicate the inde f the nde epanded and the evaluated value cmputed/prpagated by the algrithm. Fr each nde, als indicate if it is frm a ma level r a min level. Mrever, please answer: what shuld be s first mve? hw many ndes des the minima algrithm need t epand in this case? 1 3 2 4 2.4 (10 pints) Slve the whle game with the alpha-beta pruning. The prblem settings are the same as the last prblem. But yu *need* t draw the entire game tree, ecept fr thse parts that yu can prune (yu must leave them ut). Indicate which level f the trees are ma levels r min levels. Fr each nde in the game tree, indicate the inde f the nde epanded and the alpha-beta values discvered. In this case, hw many ndes des the algrithm need t epand?
Andrew ID: 6 2.5 (5 pints) Nw let us cnsider a different situatin. The state f the bard is the same as befre. But player need t leave twn fr his net mve (right after the first s mve). S that mve will be handled by his representative r. But it is well knwn that r will just make a randm mve n the bard (frm 1 t 4)! Gd news is that will return fr his last mve. Therefre, the entire mving sequence is, r,,. Briefly eplain hw yu can mdify the mini-ma algrithm accrdingly t deal with this change. Under this cnditin, des player s first mve change? Please eplain why. 3 Optimal Mied Strategy (10 pints) Cnsider the game with the fllwing matri: (if yu lk carefully, this is a generalizatin f the children s game scissrs, rck, paper ) 0 1-2 -1 0 3 2-3 0 3.1 (5 pints) Shw that the value f that game (i.e., the epected payff that will be btained by either player using the ptimal mied strategy) is 0. In fact, this is true fr any game fr which m ij = m ji, but yu dn t need t prve the general result.
Andrew ID: 7 3.2 (5 pints) Derive the ptimal mied strategy, which is the same fr bth players. If yu have truble with questin 1, just assume that the value f the game is 0 and prceed with this questin. 4 Widget Cmpanies (10 pints) Cnsider tw widget cmpanies, Acme and U.S. Widgets, cmpeting fr the same market and each firm must chse a high price ($2 per widget) r a lw price ($1 per widget). Here are the rules f the game: 1. At a price f $2, 5000 widgets can be sld fr a ttal revenue f $10000; 2. At a price f $1, 10000 widgets can be sld fr a ttal revenue f $10000; 3. If bth cmpanies charge the same price, they split the sales evenly between them; 4. If ne cmpany charges a higher price, the cmpany with the lwer price sells the whle amunt and the cmpany with the higher price sells nthing; 5. Payffs are prfits revenue minus the $5000 fied cst. (Nte: This is a very special case f smething called the Curnt s game that mdels price cmpetitin. Unfrtunately, it is an verly simplified and unrealistic eample because we frce it t be a zer-sum game.) 4.1 (5 pints) Write dwn the game matri. 4.2 (5 pints) Is there a pure strategy slutin? Briefly eplain.
Andrew ID: 8 5 The Nim Game(10 pints) A very simple versin f the game f Nim is played as fllws. There are 2 players and, at the start, tw piles n the table in frnt f them, each cntaining 2 matches. In turn, the players take any psitive number f matches frm ne f the piles. The player taking the last match lses. Nw cnsider a mre elabrate versin f the game f Nim is played as fllws. There are 2 players and, at the start, three piles n the table in frnt f them, each cntaining 2 matches. In turn, the players take any psitive number f matches frm ne f the piles. The player taking the last match lses. Sketch a game tree. Shw that the first player has a sure win. 6 The Pin Game(10 pints) A game is played as fllws: The tw players, i.e., A and B, simultaneusly hld up either ne r tw pins. A wins if there is a match (the number f pins are the same fr bth players) and B wins therwise. The amunt wn is the number f pins held up by the winner. It is paid t the winner by the lser. 6.1 (5 pints) Write dwn the matri frm f the game and specify the 2 players pssible pure strategies.
Andrew ID: 9 6.2 (2 pints) Eplain why there is n pure strategy slutin in this game. 6.3 (3 pints) Cmpute the mied strategy slutin and the value f the game. 7 Mied strategy(5 pints) Cnsider a tw-player game in which each player has 4 pssible strategies (dented 1 t 4) with the matri frm shwn belw. Cmpute a mied strategy slutin, assuming that each player assigns the same prbability t strategies 1, 2, and 3. 1 2 3 4 1-1 1 1-1 2 1-1 1-1 3 1 1-1 -1 4-1 -1-1 1