|
||||
Adversarial Searchout 3/5, due 11:59pm Friday 3/16(1) Minimax and Alpha-Beta (20 points)In the game trees in this problem, the value of the static evaluator functions is show for the leaves. Squares are maximizing nodes and circles minimizing nodes. 1.1 (10 points) For this game tree, use the minimax algorithm to compute a value for each non-leaf node. Squares represent max nodes and circles represent min nodes. Indicate which move the maximizing player should make.
1.2 (10 points) Simulate the alpha-beta algorithm on this game tree, crossing out the nodes that are pruned. For each non-leaf node that is not pruned, show the exact value (e.g., =3) or the last constraint (e.g., <= 2, >=8) that the alpha-beta algorithm determines.
![]() (2) Questions on GitSee the file questions.md in the git repository. Add your answers using git's md markup as necessary. Each subquestion is worth 5 points. (3) Nim (45 points)The AIMA book's Python code games.py has a generic framework for multi-player deterministic games along with examples for Tic-Tac-Toe and Connect Four. Use this framework to implement a game and players for the simple game Nim. Nim has been used as an exercise for computer programs for a long time -- see this short article on an electronic Nim playing device from the New Yorker from 1952. Nim is a simple two-person, turn-taking fully-observable game in which the two players take turns removing objects such as coins or sticks, from a set of distinct heaps. On each turn, a player must remove at least one object, and may remove any number of objects provided they all come from the same heap. The last player to take an object loses, i.e., the player who is left without a move wins. Nim has been completely solved for any number of initial heaps and objects, e.g., in games with heaps of three, four, and five, the first player will win with optimal play. Your representation should be able to support games with any non-zero number of heaps with an arbitrary number of initial objects. For example, you should be able to handle a game of Nim with three heaps that initially contain seven, six and five objects. Complete the file nim.py and test it using play_nim.py. Commit your modified version of nim.py. You should examine carefully the comments in nim.py and the testing program play_nim.py and well as the code in the aima-python file games.py, which is in your repository. What to hand inCommit changes to the files nim.py and questions.md. If you can produce electronic versions of the two trees, mmo and mm1
|