You are on page 1of 13

UPC :32341601 Paper: BHCS13: Artificial Intelligence

Course: B.Sc. (H) Computer Science Semester: VI Duration of


Examination:3 Hours Maximum Marks:75
Instructions for Candidates:
i. Question 1 is compulsory.
ii. Attempt any four questions from Question 2 to Question 8.
iii. Parts of a question must be answered together.

1. (a) Describe the following terms: (4)


i. Heuristic Function
ii. Software Agent

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) }

(e) Express the following sentence as conceptual dependency structure:


“Sohan gave Tina a box of chocolate” (2)

(f) Write the conceptual graph and FOPL representtation for the following sentence:
“Every motorbike has a handle” (4)

[MOTORBIKE: ∀] → (PART) → [HANDLE]

(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].

(h) Find the meaning of the statement


(~P V Q) & R → S V (~R & Q)
for the interpretation: P is true, Q is false, R is true, S is true. (2)

(j) Transform the following sentence into disjunctive normal form: (3)
~
(P V ~Q) & (R → S)

(k) Determine whether the following sentence is satisfiable, contradictory or valid:

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.

(m) What is non-monotonic reasoning? Give an example. (3)

(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)

Fully Observable vs Partially Observable


• When an agent sensor is capable to sense or access the complete state of an
agent at each point in time, it is said to be a fully observable environment else it is
partially observable.
• Maintaining a fully observable environment is easy as there is no need to keep
track of the history of the surrounding.
• An environment is called unobservable when the agent has no sensors in all
environments.
Examples:
• Chess – the board is fully observable, so are the opponent’s moves.
• Driving – the environment is partially observable because what’s around
the corner is not known.

(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.

3. (a) What is closed world assumption? Give an example. (3)


Solution 3.
The closed-world assumption (CWA), in a formal system of logic used for knowledge representation, is the
presumption that a statement that is true is also known to be true. Therefore, conversely, what is not
currently known to be true, is false.
(b) Define Modus ponens rule. Elaborate using an example. (3)

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)

S1 : (∀x)(P(x) → Q(x)) and S2 : P(a)


4. (a) Create a script for shopping in a supermarket. (5)
(b) Joint probability P(x1, x2, … , x7) by inspection as a product of chain conditional
probabilities is:
P(x1, x2, … , x7) = P(x7 | x3) . P(x6 | x5) . P(x5 | x2 x3) . P(x4 | x1 x2) . P(x3) . P(x2 | x1) . P(x1)
Draw the Bayesian belief network for the same. (5)

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.

(c) Give two limitations of propositional logic. (2)


• We cannot represent relations like ALL, some, or none with propositional logic.
Example: All the girls are intelligent. ...
• Propositional logic has limited expressive power.
• In propositional logic, we cannot describe statements in terms of their properties or
logical relationships.

7. (a) Consider the following axioms:


January
Clouds
Cold & Preciptation → Snow
January → Cold
Clouds → Precipitation
Convert them into clausal form and prove the truth of “Snow” using
resolution. (5)
(b) Develop a parse tree for the sentence “The cruel man locked the dog in the
house” using the following rules. (5)

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
------------

(b). Describe the limitations of Hill Climbing Methods (3)


Problems in Hill climbing Methods
Hill climbing cannot reach the optimal/best state (global maximum) if it enters any of the following regions:
1. Local maximum: It is a state which is better than all of its neighbors but isn’t better than some other states
which are farther away. At local maxima, all moves appear to make the things worse. They are sometimes
frustrating also as they often occur almost within slight of a solution. So, it is also called as Foot-Hills.
2. Plateau: It is a flat area of the search space in which a whole set of neighbouring states(nodes) have the
same order. On a plateau, it is not possible to determine the best direction in which to move by making local
comparisons. A plateau is an area of the state space landscape where the evaluation function is flat. It can
be a flat local maximum or a shoulder from which it is possible to make progress.
3. Ridge: It is a special kind of local maximum. it is an area of the search space which is higher than the
surrounding areas and that itself has a slope. We can’t travel the ridge by single moves as the orientation
of the high region compared to the set of available moves makes it impossible.

(c). Define the PEAS for vacuum cleaner agent (3)

You might also like