Online Exercise: Question 01. The Three Couples Problem. Three Couples Are On A Safari, When They Come To A River
Online Exercise: Question 01. The Three Couples Problem. Three Couples Are On A Safari, When They Come To A River
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.
What is the maximum number of states in the state space, i.e., including illegal 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
Depth-first search:
List of expanded states: ABCE Path returned: ABCEJ
Graph-search A*:
List of expanded states: AFGIJ Path returned: AFGIJ
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:
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
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 __________ __________________________