CSE 4308/5360 - Assignments - Assignment 3 (Written 2)

Solution

Due date: Tuesday, October 02, 2007, in class.

This is a written assignment. Handwritten or printed solutions will be accepted. Solutions must be submitted in class on Tuesday, October 02, 2007. There are 75 points for the CSE 4308 version of the assignment, 85 points for the CSE 5360 version of the assignment, and 10 extra credit points.


Problem 1

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

b. (5 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 400,000 or not? Why?


Problem 2

10 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 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.


Problem 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.


Problem 4

5 points.

Can alpha-beta search ever visit more nodes than plain minimax search that does no pruning? Why, or why not?


Problem 5 (CSE 5360 only)

Suppose that two computer algorithms A and B are playing tic-tac-toe against each other. Algorithm A is plain minimax search.

a. (5 points). If algorithm B is also plain minimax, does algorithm A always follow the best possible strategy?

b. (5 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?


Problem 6

Consider a knowledge base containing the following statements:
A AND B
NOT A
a. (10 points). We want to see if this knowledge base entails statement C (i.e., a statement consisting of the single literal C). Do a manual trace of TT-ENTAILS (a function described in the textbook) and its subsequent calls to TT-CHECK-ALL. For each function call, show the input arguments and output result. What is the final answer? Does this knowledge base entail C?

b. (10 points, extra credit). Consider an alternative knowledge base, containing statements:

A OR B
A OR (NOT D)
E AND (D => (NOT G))
(NOT B) OR F
Would this knowledge base entail C? You should not do any tracing or extensive calculations such as truth tables here, just give a simple argument.


Problem 7

Consider a knowledge base containing only the following single statement:
 (A AND B) OR (NOT (A => B))
a. (5 points). Put this statement in conjunctive normal form.

b. (5 points). Apply step by step the resolution algorithm to determine whether this knowledge base entails the sentence

A OR C
Show each step of the algorithm. What is the final answer?


Problem 8

5 points.

What is the number of all possible Wumpus worlds of size 4x4, with 3 pits, one Wumpus, and no gold? Assume that the Wumpus cannot be in the same location as a pit.


Problem 9

Mary and Jane sign a contract saying: "If Jane donates her laptop to charity by Sunday, Mary will donate her car to charity on Monday." What happens afterwards is that Jane does NOT donate her laptop to charity by Sunday, and Mary does donate her car to charity on Monday.

a. (5 points). How do we represent the above world? What are the literals? What logical expression(s) represent the contract?

b. (5 points). What knowledge base represents the facts that Jane does NOT donate her laptop to charity by Sunday, and Mary does donate her car to charity on Monday?

c. (5 points). According to this knowledge base, was the contract violated or not? Give your own answer, and also name one algorithm from the textbook that can be used to answer this question.