CSE422 Midterm Spring 2023
CSE422 Midterm Spring 2023
CSE422 Midterm Spring 2023
BRAC UNIVERSITY
Department of Computer Science and Engineering
1. CO2 Suppose you have an equation f(x) = x2 - 5x + 6. Assume x can be any number between 0 to 15. Now
your job is to find an appropriate value of x such that the value of f(x) = 0 using Genetic Algorithm
a. Consider the fact that every chromosome will have 4 genes, illustrate an appropriate encoding technique 3
to create an initial population of 4 randomly generated chromosomes.
b. Using an appropriate fitness function deduce the 2 fittest chromosomes and perform a single pointer 3
crossover from the middle to create two offspring.
c. Explain how you can mutate the offspring derived from (B) and comment on the fitness of the final 2
produced offspring.
d. Explain your opinion on whether Genetic Algorithm can be treated as a class of Local Search Algorithms 2
or not.
2. CO1 a. Define the differences between a utility function and a goal function. 3
b. Define the differences between rational behavior and human like behavior. 3
c. In your mobile, you have downloaded a bot that can provide beauty tips through texts after you take a 4
selfie of your face. Define the PEAS of this application agent.
3. CO2
In the above graph, node A is the source, and node X is the destination. The arrows indicate directed
edges. The table contains the heuristic values of each node. Now answer the following:
a. Apply A* algorithm to find the path from the source to the destination. Show the steps. In case, you end 6
up with multiple nodes with f(n) = g(n) + h(n), then you can break the tie by choosing the lexicographically
(alphabetically) smaller node. Suppose, node C and node D has the same f(n), in that case, choose C.
b. Is the heuristic consistent? Why or why not? Explain with appropriate calculation. 4
Set 1
5. CO4 Assuming the upward-facing triangles stand for the maximizing player and downward-facing triangles 3
represent the minimizing player, run min-max algorithm on the following tree and find the values for each
node from A to F.
a. What path from the root node A will be returned by the min-max algorithm? State. 1
b. What will be the alpha- and beta- values of each node in this tree if alpha-beta pruning is run on this tree? 4
Also, illustrate the crossed-out branches that would be pruned by alpha-beta pruning.
c. For the game tree below, identify the minimum value of x for which the marked branch will be pruned 2
by alpha-beta pruning. Here, again assume that upward-facing triangles stand for the maximizing player
and downward-facing triangles represent the minimizing player.