Professional Documents
Culture Documents
An agent is something/someone who takes actions on behalf of its owner. A software agent is an agent
that is created using some agent software / program.
(Note: As there is no standard definition, A student may give his/her own definition – as long as it is
able to convey the meaning, it is fine)
(b) Write a context free grammar that can accept the sentence: "Ram hit the ball". (3)
(c) In the following two-ply game tree, the terminal nodes show the utility values computed by the utility
function. Use the Minimax algorithm to compute the utility values for other nodes in the given game
tree. (2)
(d) Find whether the following set is unifiable or not. If unifiable, find the most general
unifier(m.g.u.). (2)
w = { PARENTS(x, FATHER(x), MOTHER(bill)) , PARENTS(bill, FATHER(bill), y) }
(f) Write the conceptual graph and FOPL representtation for the following sentence:
“Every motorbike has a handle” (4)
(g) Consider that append(L1,L2,L3) is a function in Prolog, in which list L1 is contacted with
L2 and the result is stored in L3. What would be the output of the following statement in
Prolog?
?- append([2,3,4],L,[2,3,4,a,b]). (2)
Solution: ?- L = [a, b].
(j) Transform the following sentence into disjunctive normal form: (3)
~
(P V ~Q) & (R → S)
S : P → Q → ~P (2)
OR
(l) Why should the heuristic function of A* algorithm always underestimate? Give reason.
example. (3)
Solution: To ensure that A* always finds an optimal solution.
(n) Prove that if A and B are independent events, P(A|B) = P(A). (Note that A and B are
independent if and only if P(A & B) = P(A)P(B)). (3)
2. (a) Differentiate between partially observable and fully observable task environment of an
agent. Give an example of each. (5)
(b) Create a frame network for terrestrial motor vehicles (cars, trucks, motorcycles) and given one complete
frame in detail for cars which includes the slots for the main component parts, their attributes, and relations
between parts. (5)
Note: In addition to a network example given above, any complete Frame containing details of various parts of the car
would be acceptable.
Modus Latin for "method of affirming." A rule of inference used to draw logical
Ponens conclusions, which states that if p is true, and if p implies q (p q), then q is
true.
(c) Given formula S1 and S2 below, show that Q(a) is a logical consequence of the two. (4)
5. (a) Write a program in Prolog to compute the sum of elements of a list. (5)
sumlist([],0).
sumlist([H|T],S):- sumlist(T,S1),
S is H+S1.
(b) What are alpha and beta cutoffs? How alpha-beta pruning is used to improve the
efficiency of Minimax procedure? (5)
Alpha-Beta Pruning
Alpha-beta pruning is a modified version of the minimax algorithm. It is an optimization technique for the
minimax algorithm.
As we have seen in the minimax search algorithm that the number of game states it has to examine are
exponential in depth of the tree. Since we cannot eliminate the exponent, but we can cut it to half. Hence there
is a technique by which without checking each node of the game tree we can compute the correct minimax
decision, and this technique is called pruning. This involves two threshold parameter Alpha and beta for future
expansion, so it is called alpha-beta pruning. It is also called as Alpha-Beta Algorithm.
Alpha-beta pruning can be applied at any depth of a tree, and sometimes it not only prune the tree leaves but also entire
sub-tree.
The two-parameter can be defined as:
Alpha: The best (highest-value) choice we have found so far at any point along the path of Maximizer. The initial value
of alpha is -∞.
Beta: The best (lowest-value) choice we have found so far at any point along the path of Minimizer. The initial value of
beta is +∞. The Alpha-beta pruning to a standard minimax algorithm returns the same move as the
standard algorithm does, but it removes all the nodes which are not really affecting the final decision but making algorithm
slow. Hence by pruning these nodes, it makes the algorithm fast.
Condition for Alpha-beta pruning:
The main condition which required for alpha-beta pruning is:
1. α>=β
Key points about alpha-beta pruning:
o The Max player will only update the value of alpha.
o The Min player will only update the value of beta.
o While backtracking the tree, the node values will be passed to upper nodes instead of values of alpha
and beta.
o We will only pass the alpha, beta values to the child nodes.
Alpha-Beta pruning is not actually a new algorithm, rather an optimization technique for minimax algorithm.
It reduces the computation time by a huge factor. This allows us to search much faster and even go
into deeper levels in the game tree.
6. (a) Compare and contrast Best-first search and Hill Climbing search. You can use
example. (4)
The two algorithms have a lot in common, so their advantages and disadvantages are somewhat similar. For
instance, neither is guaranteed to find the optimal solution.
For hill climbing, this happens by getting stuck in the local optima. One way to bypass them is to run the algorithm
in parallel with different initializations. This way, we can increase our chances of finding the “hill” that can lead us to
the global optimum. For BeFS, there’s a possibility of getting stuck in a loop when visiting a node whose successor
is its parent node. This can be avoidable by a good choice of a heuristic function.
In addition, hill climbing is prone to having plateaus and bridges. Plateaus are the states where the surrounding
points are equal to the current state. This case can be confusing for the algorithm since it won’t be able to find the
next move. Choosing it randomly might put us in a path the leads nowhere. On the other hand, ridges are local
optima whose gradients are not zero. This can make it hard for the algorithm to move on the ridges since it can’t
move in all directions. Therefore, the algorithm has to choose a zigzag-shaped path to get to the goal, which will
make it slow.
On the positive side, hill climbing needs very little memory since, at each step, it has to store the goal state and the
current state. On the contrary, in BeFS, in order to choose the best next state, we need to store all the open and
closed nodes in two queues. Therefore, it’ll require more storage.
Finally, while hill climbing chooses the first neighbor that it finds to be better than the current state, BeFS checks
more neighbors and compares them with the heuristic function. This makes it possible to choose the best one
among several states.
We can summarize the pros and cons of the two algorithms as follows:
(b) What is a Recursive Transition Network (RTN)? Give an example. (4)
RTNs are considered as development for finite state automata with some essential conditions to
take the recursive complexion for some definitions in consideration. A recursive transition
network consists of nodes (states) and labeled arcs (transitions). It permits arc labels to refer to
other networks and they in turn may refer back to the referring network rather than just permitting
word categories. It is a modified version of transition network. It allows arc labels that refer to
other networks rather than word category.
The number of sentences accepted by an RTN can be extended if backtracking is permitted when
a failure occurs. This requires that states having alternative transitions be remembered until the
parse progresses past possible failure points. In this way, if a failure occurs at some point, the
interpreter can backtrack and try alternative paths. The disadvantage with this approach is that
parts of a sentence may be parsed more than time resulting in excessive computations. During
the traversal of an RTN, a record must be maintained of the word position in the input sentence
and the current state and return nodes to be used as return points when control has been
transformed to a lower level network.
Note: Any correct example given by the student would be acceptable.
S → NP VP
NP → N
NP → DET N
VP → V NP
VP → V PP
VP → V NP PP
PP → PREP NP
DET → ART ADJ
DET → ART
N → man | dog | house
V → locked
ART → the | a
ADJ → cruel
PREP → in
8. (a) Solve the following crypt arithmetic problem using constraint satisfaction. (4)
ODD
+ ODD
------------
EVEN
------------