0% found this document useful (0 votes)
47 views7 pages

Online Exercise: Question 01. The Three Couples Problem. Three Couples Are On A Safari, When They Come To A River

This document contains an online exercise for an Artificial Intelligence course with 6 questions. Question 1 asks about solving the three couples problem of crossing a river with constraints. Question 2 tests various graph search algorithms. Question 3 covers the 4-queens problem and genetic algorithms. Question 4 tests minimax and alpha-beta pruning on a game tree. Question 5 applies hill climbing to the 8-puzzle problem. Question 6 covers constraint satisfaction problems and coloring a map with regions.

Uploaded by

Thiện Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

Online Exercise: Question 01. The Three Couples Problem. Three Couples Are On A Safari, When They Come To A River

This document contains an online exercise for an Artificial Intelligence course with 6 questions. Question 1 asks about solving the three couples problem of crossing a river with constraints. Question 2 tests various graph search algorithms. Question 3 covers the 4-queens problem and genetic algorithms. Question 4 tests minimax and alpha-beta pruning on a game tree. Question 5 applies hill climbing to the 8-puzzle problem. Question 6 covers constraint satisfaction problems and coloring a map with regions.

Uploaded by

Thiện Trần
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Course: CSC14003 - Artificial Intelligence

Class 20CLC – Term II/2021-2022

ONLINE EXERCISE

Question 01. The three couples problem. Three couples are on a safari, when they come to a river.
The only way for them to cross is with a small rowboat which can only accommodate two people at
a time. Complicating the process is the fact that the women are all the jealous type, and refuse to
leave their significant other in the presence of another woman unless she is there as well. How can
the couples cross the river without any romantic strife?
Consider a state as a tuple of values. Which values should be included in the tuple?

From this point, answer the following questions according to the definition of a state above.

Define the initial state and the goal state.

What is the path cost?

What is the maximum number of states in the state space, i.e., including illegal states? Explain.

What is the total number of reachable states? Explain.

Question 02. Consider the following graph. The initial state is marked with a BLUE circle, and the
goal state is marked with a RED circle. 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, and they are separated by a single
space, (e.g., S A B C)
Note that the path returned will not be accepted if the list of expanded states is wrong.

Breadth-first search
List of expanded states: ABFCDGHE Path returned: ABCEJ

Uniform cost search:


List of expanded states: AFGBIDCHJ Path returned: AFGIJ

Depth-first search:
List of expanded states: ABCE Path returned: ABCEJ

Greedy best-first search:


List of expanded states: AFHI Path returned: AFHIJ

Graph-search A*:
List of expanded states: AFGIJ Path returned: AFGIJ

Question 03. Consider the 4-bishops problem. Every state of the


problem has 4 bishops on the board, each of which is in a separate
column.

Answer the following questions:

The total number of states in the state space is:


4*4*4*4

Each step of the search moves a bishop within its own column. How many successors can a state
generate?

Each state of the problem can be represented in the genetic algorithm as 4 digits, each indicating the
position of a bishop in that column. For example, S = 4213.
Let nb be the number of attacking pairs of bishops of state n.
Define the fitness function for a state n:

The current generation includes 4 states: S1 = 2341; S2 = 2132; S3 = 1232; S4 = 4321.


Calculate the value of Fit(n) for each of the 4 states and the probability that each of them will be
chosen in the “selection” step.

State n S1 S2 S3 S4

Fit(n)

Prob(n)

Question 04. Consider the following game tree. Assume that the root node corresponds to the MAX
player and the search always visits children left-to-right.
Compute the final backed-up computed by minimax algorithm. (No alpha-beta pruning at this step)
A B C D E F G

5 5 3 5 13 3 10

Compute the final backed-up computed by alpha-beta pruning. If a node is pruned, mark X.
A B C D E F G

5 5 3 5 13 3 X

Using the minimax calculations from part a), without performing any alpha-beta calculation, rotate
the children of each node in the above tree at every level to ensure maximum alpha-beta pruning.
Fill in the nodes with the letter of the corresponding node. Draw the new edges

Question 05. The 8-puzzle problem. Apply the hill-climbing algorithm with Manhattan distance
heuristic to find a solution for the following pair of initial and goal states.
Initial state Goal state

2 8 3 1 2 3

1 6 4 8 - 4

7 - 5 7 6 5

Your work should address the following requirements


- Draw the search tree including all possible successors of expanded states (except the goal)
- Calculate the heuristic value for every node
- Mark the optimal strategy found

Question 06. Consider the problem of coloring the six


regions (numbered 1...6) in the following map using
three colors: R, G and B, so that no adjacent regions
have the same color. Two regions are adjacent if they
share part of an edge (note: they are NOT adjacent if
they only share a corner).

If initially every variable has all three possible values except region 1 has known value R (1 = R) and
region 2 has known value G (2 = G). What is the result of the Forward Checking algorithm for this
step?

Variables 1 2 3 4 5 6

Final domains R G

Assume the initial domains of the regions in the map above are given as 1 = {R, G, B}, 2 = {R, G}, 3 =
{R, G, B}, 4 = {R}, 5 = {R, G, B}, and 6 = {R}. What is the result of applying the Arc Consistency
algorithm, AC-3, starting at Region 1?

Variables 1 2 3 4 5 6

Final domains
Assume no variables have been assigned yet, solve the CSP using backtracking with forward
checking. Ties (after considering all necessary heuristics) are resolved by numeric ordering (e.g., if
both region 1 and region 2 are possible, choose region 1).

For every step, present the MRV values for all regions that are not colored yet. If there are many
regions that have the same minimum MRV, present the DH values for these regions.

Step 1

Variables 1 2 3 4 5 6

MRV

DH

Color the region ______________ _____________ with the color __________ __________________________

Step 2

Variables 1 2 3 4 5 6

MRV

DH

Color the region ______________ _____________ with the color __________ __________________________

Step 3

Variables 1 2 3 4 5 6

MRV

DH

Color the region ______________ _____________ with the color __________ __________________________

Step 4

Variables 1 2 3 4 5 6

MRV

DH

Color the region ______________ _____________ with the color __________ __________________________
Step 5

Variables 1 2 3 4 5 6

MRV

DH

Color the region ______________ _____________ with the color __________ __________________________

Step 6

Color the region ______________ _____________ with the color __________ __________________________

You might also like