Mid I
Mid I
Name: ___________________________________
___________________________________Registration No_______________________
_______________________
Please read questions carefully, give reason/show all working for all questions
Instruction/Notes: Answer all questions are on this question paper
Rough sheets can be used and attached at the end only if necessary.
necessary
Problem 1. Consider the search space shown in the figure below. In this problem the start state
is S, and the goal state is G.. The transition costs are next to the edges, and the heuristic
estimate are given inside the node
nodes.. Assume ties are always broken by choosing the state which
comes first alphabetically
Part a) [2 + 3 Points]
An intelligent but greedy automated agent/program is trying to solve the famous 0-1 knapsack
problem. In this problem the agent has a set of items to choose from with each item having a
weight, the agent has to carry if it picks that item, and a value the agent will gain by picking up
the item. The agent has the capicity to carry only a MAX_WEIGHT while his job is to select a
subset of items that it can carry such that the total value gained by the agent maximum.
The agent has been programmed by a slected team of students from a famous University (FAST)
situated in the city of Lahore. The team programmed the agent such that it uses hill-climbing
strategy to solve such optimization problems.
To represent state of the agent, while it is creating a plan to make a selection from a set of n
items, the team used an array of size n with an index corresponding to one of the item in the
set. Each index in the state array contains wither a 0 or a 1 where 0 at any index means that the
agent will not pick the corresponding item and a 1 means the agent will pick the corresponding
item.
Further, to generate successors of a state a very simple successor function is used that works by
selecting an index and if the corresponding item is not already in the list of items to be picked it
added it into the list by placing a 1 at the corresponding arry index.
i. What is the size of search space the agent has to search from? (Justify)
iii. What will be a suitable evaluation function to carry out the hill-climbing search?
Item ID A B C D
Item Weight 0.8 kg 0.7 kg 2 kg 3 kg
Item Value Rs. 80 Rs. 70 Rs. 200 Rs. 320
Table 1: Item Weights and Value
If the maximum capacity of the agent is 3.5 kg. then what will be final solution found be the
agent (Show Complete Working)
Initial State 0 0 0 0
Initial State 0 1 0 0
Figure on the following page shows a game tree of a hypothetical game. To find the best move of MAX (denoted by upwards pointing triangle) at the
root, this game tree is to be searched using minimax with α-β pruning. Assume that the minimax search has been implemented such that the
child/successors of any node are traversed from left to right order.
Part a) If value of each leaf node (specified as a square) is as given on the figure then compute the value of each intermediate node that will be
assigned by minimax with prunning. On the figure also mark all branches that will be pruned by α-β prunning strategy and specify the corresponding
values of α and β at the time of prunning [5 + 5 Points]
Bonus Part
Now assue that the values of the leaf nodes are not known and you are free to specify these values. Determin values of the nodes such that maximun
number of branch will be pruned if minimax with α-β pruning is used to search the tree and children of a node are processesed from left to right. Also
specify on the figure the branches that will be pruned. [5 Points]