You are on page 1of 3

Subject : AI

Dr. Yasser Fouad


Games Sheet

1. CONSTRAINT SATISFACTION PROBLEMS. This problem asks about the


Australia Coloring Problem. Each region must be colored one of Red (R), Green
(G), or Blue (B). Neighboring regions must be a different color. Variable Q has
been assigned value R, using Depth-first search, assign values for others circles.

N H

W S
V

2. Nim is a two-player game. The rules are as follows. The game starts with a single
stack of 9 tokens. At each move a player selects one stack and divides it into two
non-empty, non-equal stacks. A player who is unable to move loses the game.
a) Draw the complete search tree for Nim.
b) Assume two players, min and max, play Nim. Min plays first.
c) If a terminal state in the search tree developed above is a win for min, a utility
function of zero is assigned to that state. A utility function of 1 is assigned to a
state if max wins the game. Apply the minimax algorithm to the search tree to
assign utility functions to all states in the search tree.
d) If both min and max play a perfect game, who will win? Explain your answer.

3. In the game tree, fill in all eight internal minimax scores and clearly indicate what move
× should make. Perform a simulation of the alpha-beta algorithm on the game tree

1
4. In a cryptoarithmetic puzzle, the variables A, B, C, D, E and F can take values 1
to 7, the variables must all be different and satisfy the following sum: A + C = E
and B + D = F. Solve the CSP problem by Search tree? If A = 1 find the solution
to the puzzle.
5. Given the following game tree, apply the alpha-beta pruning algorithm to it and

show the search tree that would be built by this algorithm. Make sure that you

show where the alpha and beta cuts are applied and which parts of the search tree

are pruned thus.

6.
A

B
C

D E F G

H I J K L M N O

6 5 8 10 2 1 15 18
2
1. In a cryptoarithmetic puzzle, the variables A, B, C, D, E and F can take values 1
to 7, the variables must all be different and satisfy the following sum: A + C = E
and B + D = F. Solve the CSP problem by Search tree? If A = 1 find the solution
to the puzzle.

7. Consider the game of 2×2 tictactoe where each player has the additional option of
passing (i.e., marking no square). Assume X goes first
a) Draw the full game tree down to depth 2.
b) Suppose the evaluation function is the number of Xs minus the number of
Os. Mark the values of all leaves and internal nodes
c) Circle any node that would not be evaluated by alpha–beta during a left-
to-right exploration of your tree.

You might also like