CSE 4308 - Assignments - Assignment 3 - Written Part

List of assignment due dates.

The assignment should be submitted via Blackboard. Your answers should be placed in a file called answers.xxx. Extension xxx in your answers.xxx file depends on the file format you use, which can be PDF, text, Microsoft Word, or Open Office.


Task 1 (20 points)

a. Is the number of possible board states in tic-tac-toe greater than 20,000 or not? Why?

b. A game is defined as a sequence of moves starting from an empty board and finishing at a terminal board state. Is the number of possible tic-tac-toe games greater than 800,000 or not? Why?


Task 2 (20 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 game, answer the following question: if you were to choose one and only one out of these variants for a commercial product that plays that game, which variant would be the most appropriate? Justify your answer.


Task 3 (10 points)

X O X
O O
  X  

Figure 1. A tic-tac-toe board state.


Consider the tic-tac-toe board state shown in Figure 1. Draw the full minimax search tree starting from this state, and ending in terminal nodes. Show the utility value for each terminal and non-terminal node. Utility values are +1 if X wins, 0 for a tie, and -1 if O wins. Assume that X makes the next move.


Task 4 (20 points)

   

Figure 2. A game search tree.

a. In the game search tree of Figure 2, indicate what nodes will be pruned using alpha-beta search, and what the estimated utility values are for the rest of the nodes. Assume that, when given a choice, alpha-beta search expands nodes in a left-to-right order. Also, assume the MAX player plays first.

b. This question is also on the game search tree of Figure 2. Suppose we are given some additional knowledge about the game: the maximum utility value is 10, i.e., it is not mathematically possible for the MAX player to get an outcome greater than 10. How can this knowledge be used to further improve the efficiency of alpha-beta search? Indicate the nodes that will be pruned using this improvement. Again, assume that, when given a choice, alpha-beta search expands nodes in a left-to-right order, and that the MAX player plays first.


Task 5 (15 points)

Suppose that two computers A and B are playing some game against each other. Computer A follows the standard minimax algorithm (no alpha-beta pruning, no depth-limited search). If algorithm B follows the alpha-beta version of minimax (with no depth-limited search), does computer A always follow the best possible strategy? I.e., will computer A always achieve the highest utility that is possible given what we know about computer B?

Another way to phrase the same question is: can you come up with an example (a specific game tree) where computer A would have achieved a better utility if it followed another strategy instead of standard minimax? If so, you should specify the game tree and the alternative strategy that would achieve a better utility.


Task 6 (15 points)



Figure 3. Yet another game search tree.

Consider the MINIMAX tree above. Suppose that we are the MAX player, and we follow the MINIMAX algorithm to play a full game against an opponent. However, we do not know what algorithm the opponent uses.

Under these conditions, what is the best possible outcome of playing the full game for the MAX player? What is the worst possible outcome for the MAX player? Justify your answer.

NOTE: the question is not asking you about what MINIMAX will compute for the start node. It is asking you what is the best and worst outcome of a complete game under the assumptions stated above.


Optional Task 1 (0 points, just for fun)

Part a: Suppose that two computers A and B are playing some game against each other. Computer A follows the standard minimax algorithm (no alpha-beta pruning, no depth-limited search). Can you come up with an algorithm X, such that if computer B follows algorithm X, then computer A (i.e., which follows standard minimax) does not follow the best possible strategy? I.e., can you make up an algorithm X such that, if the designers of A knew that computer B uses this algorithm X, the designers of A could replace minimax with a better strategy, that would lead to better results? If so, provide a specific example, by specifying the game tree, the algorithm X, and an improved algorithm for computer A that would provide a better result than minimax.

Part b: Suppose that two computers A and B are playing some game against each other. Computer A follows the standard minimax algorithm (no alpha-beta pruning, no depth-limited search). Computer B follows the alpha-beta version of minimax with depth-limited search. Can you come up with an algorithm Y, such that if computer A follows algorithm Y, then computer A (i.e., which follows standard minimax) will get a utility value at least as high, and sometimes higher, compared to using standard minimax, as long as computer B follows depth-limited minimax?? If so, provide a specific example, by specifying the game tree, the evaluation function and depth cutoff used by computer B, and the algorithm Y that will produce a better result than minimax in that case.


Optional Task 2 (0 points, just for fun)

Suppose that you want to implement an algorithm tht will compete on a two-player deterministic game of perfect information. Your opponent is a supercomputer called DeepGreen. DeepGreen does not use Minimax. You are given a library function DeepGreenMove(S), that takes any state S as an argument, and returns the move that DeepGreen will choose for that state S (more precisely, DeepGreenMove (S) returns the state resulting from the opponent's move).

Write an algorithm in pseudocode (following the style of the Minimax pseudocode) that will always make an optimal decision given the knowledge we have about DeepGreen. You are free to use the library function DeepGreenMove(S) in your pseudocode. If you think regular Minimax is the answer, just state so.


Optional Task 3 (0 points, just for fun)

For the purposes of this task, assume that "game" refers to any perfect-information, deterministic game, with a finite game tree.

a. Is it possible for a game to exist where a random player may sometimes defeat minimax, assuming that random player plays first? Justify your answer.

b. Is it possible for a game to exist where a random player may sometimes defeat minimax, assuming that random player plays second? Justify your answer.