2425 CSC14003 23CLC1 Quiz01
2425 CSC14003 23CLC1 Quiz01
Q1 (2.5pts) Consider the following graph. The initial state is vertex A, and the goal state is vertex G. The heuristic
table is shown aside the graph. The ties are broken in alphabetical order.
For each of the following search strategies, state the order in which states are expanded and the path returned.
Vertices should be presented in their exact order. Note that:
• The path returned will not be accepted if the list of expanded states is wrong.
• We apply early stopping for BFS, DFS, and GBFS.
Graph-search A* (0.5pt) A B E D F H G A D H G
Q2 (0.5pt) Consider the Knight's Tour problem on an 8×8 chessboard. What are the maximum branching factor
and minimum branching factor in this problem? Draw the board configurations that demonstrates these factors.
a) (0.5pt) Apply the minimax algorithm (without pruning) to obtain the value of each non-leaf node.
Node A B C D E F G H I J K L M N O
Value 9 9 3 9 10 4 3 9 8 10 1 4 0 3 1
b) (1pt) Apply the alpha-beta pruning algorithm. Mark the pruned node directly on the figure and explain for each
pruned node or pruned subtree.
Prune I – 11: I inherits = 9 from node D. I gets = 8 after visiting the left child. Thus [, ] = [9, 8] invalid.
Prune subtree rooted at K: E inherits = 9 from node B. E gets = 10 after visiting the left child. Thus [, ] =
[10, 9] invalid.
Prune L – 4: L inherits = 9 from node A. L gets = 5 after visiting the left child. Thus [, ] = [9, 5] invalid.
Prune M – 0: M inherits = 9 from node A. M gets = 4 after visiting the left child. Thus [, ] = [9, 4] invalid.
Prune subtree rooted at G: C inherits = 9 from node A. C gets = 5 after visiting the left child. Thus [, ] = [9,
5] invalid.
Q4 (0.5pt) What might happen if we eliminate the mutation step from the genetic algorithm?
Removing the mutation step from a genetic algorithm reduces genetic diversity, limits exploration, and increases
the risk of premature convergence to local optima. Over time, the algorithm may stagnate, as crossover alone
cannot introduce new traits.
Class 23CLC01 – Term III/2024-2025
QUIZ 01-B Course: CSC14003 – Artificial Intelligence
• The path returned will not be accepted if the list of expanded states is wrong.
• We apply early stopping for BFS, DFS, and GBFS.
Q2 (0.5pt) For each of the following terms on the left, write in the letter corresponding to the best answer or the
correct definition on the right. The first one is done for you as an example.
F Frontier C All states reachable from the initial state by a sequence of actions
E Optimality D Apply each legal action to state, generating a new set of states
a) (0.5pt) Apply the minimax algorithm (without pruning) to obtain the value of each non-leaf node.
Node A B C D E F G H I J K L M N O
Value -2 -2 -3 -2 -1 -3 1 -2 -8 -1 -5 -3 -6 1 -7
b) (1pt) Apply the alpha-beta pruning algorithm. Mark the pruned node directly on the figure and explain for each
pruned node or pruned subtree.
Prune I – 6: I inherits = -2 from node D. I gets = -8 after visiting the left child. Thus [, ] = [-2, -8] invalid.
Prune subtree rooted at K: E inherits = -2 from node B. E gets = -1 after visiting the left child. Thus [, ] =
[-1, -2] invalid.
Prune M – 8: M inherits = -2 from node A. M gets = -6 after visiting the left child. Thus [, ] = [-2, -6]
invalid.
Prune subtree rooted at G: C inherits = -2 from node A. C gets = -3 after visiting the left child. Thus [, ] =
[-2, -3] invalid.
Q4 (0.5pt) Describe an advantage and one disadvantage of local search over global search.
Advantage: Local search requires less memory because it does not track reached states.
Disadvantage: Local search may not be able to find the solution even when the solution exists in the state space
because it may stop when no better successor is found.
Class 23CLC01 – Term III/2024-2025
QUIZ 01-C Course: CSC14003 – Artificial Intelligence
Q1 (2.5pts) Consider the following graph. The initial state is vertex S, and the goal state is vertex G. The heuristic
table is shown aside the graph. The ties are broken in alphabetical order.
For each of the following search strategies, state the order in which states are expanded and the path returned.
Vertices should be presented in their exact order. Note that:
• The path returned will not be accepted if the list of expanded states is wrong.
• We apply early stopping for BFS, DFS, and GBFS.
Graph-search A* (0.5pt) S B C A D G S A D G
Q2 (0.5pt) Consider the Tower of Hanoi problem with three pegs and N disks. How many valid states exist in the
state space? Explain how you compute this number.
A state is legal where the disks are arranged in decreasing order of sizes from bottom to top. For the largest disk,
it can be in one of the three pegs. And next, for the second largest disk, it can be in one of the three pegs without
violating the rule. And so on until the smallest disk. Thus, the product of N numbers, 3 3 … 3 = 3N
Q3 (1.5pts) Consider the game tree below, which depicts a position reached in a minimax game. Inside each leaf
node is the estimated score of that resulting position returned by the evaluation function. It’s MAX’s turn to move.
a) (0.5pt) Apply the minimax algorithm (without pruning) to obtain the value of each non-leaf node.
Node A B C D E F G H I J K L M N O
Value 8 8 1 8 10 1 7 6 8 10 4 0 1 3 7
b) (1pt) Apply the alpha-beta pruning algorithm. Mark the pruned node directly on the figure and explain for each
pruned node or pruned subtree.
Prune subtree rooted at K: E inherits = 8 from node B. E gets = 10 after visiting the left child. Thus [, ] =
[10, 8] invalid.
Prune L – 0: L inherits = 8 from node A. L gets = 7 after visiting the left child. Thus [, ] = [8, 7] invalid.
Prune M – 1: M inherits = 8 from node A. M gets = 6 after visiting the left child. Thus [, ] = [8, 6] invalid.
Prune subtree rooted at G: C inherits = 8 from node A. C gets = 7 after visiting the left child. Thus [, ] = [8,
7] invalid.
Q4 (0.5pt) In genetic algorithm, what might happen if we set the probability of mutation to a high value?
Setting a high mutation probability in a genetic algorithm can disrupt good solutions by introducing too much
randomness, making the search behave more like a random walk. This reduces the algorithm's ability to refine and
exploit promising solutions, potentially slowing convergence and lowering overall performance.
Class 23CLC01 – Term III/2024-2025
QUIZ 01-D Course: CSC14003 – Artificial Intelligence
Q1 (2.5pts) Consider the following graph. The initial state is vertex S, and the goal state is vertex G. The heuristic
table is shown aside the graph. The ties are broken in alphabetical order.
For each of the following search strategies, state the order in which states are expanded and the path returned.
Vertices should be presented in their exact order. Note that:
• The path returned will not be accepted if the list of expanded states is wrong.
• We apply early stopping for BFS, DFS, and GBFS.
S F G
Graph-search A* (0.5pt) S F A B D G
S A D G
Q2 (1pt) For each of the following terms on the left, write in the letter corresponding to the best answer or the
correct definition on the right. The first one is done for you as an example.
C Branching Factor B Returns the state that results from doing an action in the given state
E Successor D Represents all the possible action sequences starting at the initial state
D Search tree E A state reachable from a given state by a single action
The agent devises a description of the states and actions necessary to
B Transition model F
reach the goal.
Q3 (1.5pts) Consider the game tree below, which depicts a position reached in a minimax game. Inside each leaf
node is the estimated score of that resulting position returned by the evaluation function. It’s MAX’s turn to move.
a) (0.5pt) Apply the minimax algorithm (without pruning) to obtain the value of each non-leaf node.
Node A B C D E F G H I J K L M N O
Value 0 0 -2 0 1 -2 1 0 -1 1 -3 -2 -3 1 -4
b) (1pt) Apply the alpha-beta pruning algorithm. Mark the pruned node directly on the figure and explain for each
pruned node or pruned subtree.
Prune I – 8: I inherits = 0 from node D. I gets = -1 after visiting the left child. Thus [, ] = [0, -1] invalid.
Prune subtree rooted at K: E inherits = 0 from node B. E gets = 1 after visiting the left child. Thus [, ] = [1,
0] invalid.
Prune L – 5: L inherits = 0 from node A. L gets = -2 after visiting the left child. Thus [, ] = [0, -2] invalid.
Prune subtree rooted at G: C inherits = 0 from node A. C gets = -2 after visiting the left child. Thus [, ] = [-
2, 0] invalid.
Q4 (0.5pt) While graph-search greedy best-first search and steepest-ascent hill climbing both use heuristic
functions, their behaviors and outcomes are quite different. Point out two differences between these algorithms.
Backtracking: Graph-search greedy best-first search can backtrack and explore multiple paths, while steepest-
ascent hill climbing only moves to the best neighbor and cannot backtrack.
Completeness: Greedy best-first search is more likely to find a solution (more complete), whereas hill climbing
can get stuck in local maxima and fail to find the goal.