a. (10 points). Is the number of possible board states in tic-tac-toe greater than 20,000 or not? Why?
Answer: There are nine squares, and for each square there are three possibilities (X, O, or empty). Consequently, the number of possible states is at most 3^9 = 19683 < 20000.
b. (10 points). 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?
Answer: At the first move there are 9 choices, at the second move 8 choices, at the third move 7 choices, and so on. Therefore, the number of possible games is at most 9! = 362,880 < 800,000.
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 game, answer the following question: can that minimax variant possibly never terminate, in computing the best next move? Justify your answer.
Answer: The number of moves in a tic-tac-toe game is at most nine, so all variants of minimax will terminate for tic-tac-toe. In chess, if the number of moves is unconstrained, and if we do not keep track of states already visited, then only the depth limited version of minimax will terminate. On the other hand, if we limit the number of moves to a finite number, then all three variants of minimax are guaranteed to terminate for chess.
| X | O | X |
| O | O | |
| X |
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.
Answer:

Figure 2. A game search tree.
a. (10 points) 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.
Answer:

b. (10 points) 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.
Answer:

Suppose that two computer algorithms A and B are playing tic-tac-toe against each other. Algorithm A is plain minimax search.
a. (10 points). If algorithm B is also plain minimax, does algorithm A always follow the best possible strategy?
Answer: Yes (the textbook makes this quite clear).
b. (10 points). Can you make up an algorithm B for which algorithm A (i.e., plain minimax) does not find the best possible strategy? I.e., can you make up an algorithm B such that, if the designers of A knew that their opponent uses this algorithm B, the designers of A could replace minimax with a better strategy?
Answer: Suppose algorithm B plays in a row as high up as possible, and (as a second preference) as far to the left as possible. Then, a winning strategy is to play bottom left, then center, then top right.
More generally, if we know B, this means that we can define a function b-move(state) that tells us what move algorithm B makes given a specific state. Then, we can rewrite our minimax code to replace all calls to min-value with calls to b-player-value, defined as:
function b-player-value(state)
if Terminal-Test(state) then return Utility(state)
return max-value(b-move(state))