0% found this document useful (0 votes)
9 views11 pages

Solution 2024

The document provides a solution key and marking scheme for an Artificial Intelligence exam, covering various topics such as PROLOG predicates, Bayes' theorem, closed world assumption, means-ends analysis, and different types of agents. It includes detailed explanations, transformations, and examples for each question, along with marking criteria. Additionally, it discusses algorithms, fuzzy sets, and logical reasoning, emphasizing the importance of subjective solutions.

Uploaded by

Apeksha Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views11 pages

Solution 2024

The document provides a solution key and marking scheme for an Artificial Intelligence exam, covering various topics such as PROLOG predicates, Bayes' theorem, closed world assumption, means-ends analysis, and different types of agents. It includes detailed explanations, transformations, and examples for each question, along with marking criteria. Additionally, it discusses algorithms, fuzzy sets, and logical reasoning, emphasizing the importance of subjective solutions.

Uploaded by

Apeksha Sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Solution Key and Marking Scheme for UPC: 32341601

Paper: Artificial Intelligence


Course: B.Sc (H) Computer Solution-Semester: VI
Note: Please consider any other correct solution presented. Also, subjective marking is suggested.

1. (a) Explain uses of Cut-Fail predicates in PROLOG. (1+1)


Cut is used to stop unnecessary backtracking and prevents searching for alternate solutions when it is not
required. Fail is used to control the flow of the program, particularly in backtracking scenarios and in
defining search strategies or loops. When Prolog encounters fail, it will backtrack to the most recent
choice point to try another alternative. It is often used in conjunction with cut (!) to enforce failure.

(b) Is it possible to compute P(A|~B) when you are only given P(A), P(B|A) and P(B)? explain your
answer. (2)
Given Information
P(A) - The probability of A, P(B∣A) - The probability of B given A, P(B) - The probability of B.
Desired Probability: P(A∣¬B) - The probability of A given ¬B.

Applying Bayes' Theorem


Bayes' theorem relates conditional probabilities as follows: P(A∣¬B) = P(¬B∣A) P(A)/P(¬B)
Compute P(¬B∣A) and P(¬B)
By definition, P(¬B∣A) is: P(¬B∣A)=1−P(B∣A)
P(¬B) can be derived from P(B) =1−P(B)
Substitute the values into Bayes' theorem: P(A∣¬B)=P(¬B∣A)P(A)/P(¬B)
Substitute the expressions: P(A∣¬B)=(1−P(B∣A))P(A)/1−P(B)
Yes, it is possible to compute P(A∣¬B) using the given probabilities P(A), P(B) and P(B/A).

(c) What do you understand by closed world assumption? Explain using suitable example. (3)
1 mark for definition + 1 mark for explanation + 1 mark for example
The Closed World Assumption (CWA) is the assumption that what is not known to be true must be false.
The CWA applies when a system has complete information.

Let T be: ∀xP(x)→Q(x)


P(a) ∧ R(b)
HB(T)={P(a), Q(a), R(a), P(b), Q(b), R(b)}
CWA(T)= T ∪ { ¬ R(a), ¬ P(b), ¬ Q(b)} OR

For example, consider a database application for airline reservations. If you are looking for a direct flight
between Austin and Madrid, and it doesn’t exist in the database, then the result is “There is no direct
flight between Austin and Madrid.”

(d) Transform the following sentence into CNF: P V (~P & Q & R) (3) (1 mark for each line)
(PV~P) & (PVQ) & (PVR) –apply Distributive Law
True & (PVQ) & (PVR) ----P∨~P is a tautology
(PVQ) & (PVR)---CNF

(e) What do you understand by Means Ends Analysis? Explain using suitable example. (2+1)
Means-ends analysis centres around the detection of difference between the current state and the goal
state. Once such difference is isolated, an operator that can reduce the difference must be found.
Operators have preconditions and results and are generally represented as rules stored in a difference table
indexed by the differences they can be used to reduce. If none of the operators available can be applied to
the current state- we set up a subproblem of getting to a state in which it can be applied. This process of
defining subproblems is called operator sub-goaling.
Problems are solved using operator sub-goaling as decided by the difference table and finally, combining
all the subgoals to reach the required goal.
Any example showing the usage of operators to reduce and solve the problem.

(f) Is the problem decomposable? Justify the statement. (1+2)


This problem can be solved by breaking it down into three smaller problems, each of which can then be
solved by using specific rules. At every step it is checked if the problem, can be solved directly, if so its
value is given otherwise it is broken into smaller sub-problems. Then by recursion method sub-problems
are solved. The final solution is the sum of all the sub-problems.
For Justification, any example showing decomposability can be considered like,

OR
Block World Problem

(g) Differentiate between Model based and Utility based agent. (1.5 + 1.5)

Aspect Model-based Agent Utility-based Agent


Internal Model Maintains a model of the environment May or may not have an explicit model
Decision Making Based on predicting outcomes Based on maximizing utility
Goals vs. Utility Operates with specific goals Operates with a utility function
Flexibility Goal-oriented, less flexible Can handle trade-offs, more flexible
Example A robot programmed to avoid obstacles in Autonomous car
its path.

Note: Marks should be given if the student has explained the difference using diagram

(h) Explain the architecture of the probel solver with a TMS. (2 marks for explanation and 1 marks for
block diagram)
TMS also known as belief revision and revision maintenance system. The main job of the TMS is to
maintain consistency of the knowledge base. The IE solves domain problems based on its current belief
set.
Steps:
TMS maintains the currently active belief set.
After each inference, information is exchanged b/w IE and TMS.
IE tells the TMS what deductions it has made and TMS asks the question about the current beliefs and
reasons for failure.
Maintains consistent set of beliefs for the IE to work with new knowledge.

(i) Differentiate between deterministic and non-deterministic parser with the help of an example.
(2 + 2)

A deterministic algorithm is a type of algorithm in which the result of every algorithm is uniquely
defined. Hence, a deterministic algorithm performs fixed number of steps and always get finished with
accept or reject state with the same result. The target machine executes the same instruction and gives the
same results that does not depend upon the way or process in which the instruction gets executed.
Deterministic algorithms can solve a problem in polynomial time. A deterministic algorithm always has a
single outcome, i.e. the input given to it always results the same output. A mathematical function is a
common example of the deterministic algorithm.

A non-deterministic algorithm is one in which the output of every algorithm is not uniquely defined and
thus the result could be random. Hence, the non-deterministic algorithms have multiple outcomes. Non-
deterministic algorithms take multiple execution paths, thus it is quite difficult to determine the next state
of the machine. Unlike deterministic algorithms, a non-deterministic algorithm cannot solve problems in
polynomial time. Random functions are examples of nondeterministic algorithms.

(j) Draw an associative network for the following sentences (2+2)

i) The car is red and has a powerful engine.


ii) The cake is delicious and has a creamy frosting.

(k) Write a script for going to a museum. (5)

Please consider any other correct solution presented

2. (a) Create a frame network for transportation methods and give one complete frame for
any one type transportation method which includes the slots for the main component parts, their
attributes and relations between parts. (2+3)
(b) Transform the following into disjunctive normal form: P → ((Q&R) ↔ S) (3)

(c) Express the following structure as a conceptual graph structure:


"Dog scratches its ear with its paw" (2)
Q3. (a)Develop a parse tree for the sentence “I saw the man with a telescope” using the
following rules. S (4)
NP N I
VP
V saw
NP
DET the
N man
PP
PREP with
NP
DET a
N telescope

(b) Draw the RTN to implement the grammar given above. (3)

(c) Write schemata for default reasoning using the sentence: If someone is adult and it is
consistent to assume that adults can vote, infer that person can vote. (3)
4. (a) Give the similarities and differences between Best First Search and A* algorithm. Under
what conditions A* algorithm provide an optimal solution? (5)

(b) Using Constraint Satisfaction algorithm. Solve the following cryptarithmetic problem.

(3)
Only answer:- 1.5 marks, Answer with steps:- 3 marks
(c) Differentiate between a static and dynamic environment of an agent. (2)
(1 mark each for static and dynamic)

Q5. (a) Explain the following terms with respect to fuzzy sets: (4 marks)

(i) Dilation
(ii) Concentration
(i) Dilation tends to increase the degree of membership of all partial members x by spreading
out the characteristic function curve. The dilation of A (fuzzy set) is defined as
DIL(A) = [μA(x)]1/2 for all x in U (2 marks)

(ii) The concentration is the opposite of dilation. It tends to decrease the degree of
membership of all partial members and concentrates the characteristic function curve. The
concentration of A (fuzzy set) is defined as
CON(A) = [μA(x)]2 for all x in U (2 marks)

Q5. (b) Write a prolog program to implement GCD of two numbers. (3)

Note: Marks can be given to solutions other than mentioned above if logic is correct

Q5. (c) Given the formulae:

E1: A →B
E2: ¬B
G: ¬A
Prove that G is the logical consequence of E1 and E2. (3)
Solution :

A B E1:A→B E2:¬B E1∧E2 G:¬A E1∧E2→G


T T T F F F T
T F F T F F T
F T T F F T T
F F T T T T T

P is a logical consequence of (P & Q) since any interpretation for which


(P & Q) is true. P is also true
Alternate Solution:

6. (a) Transform the following formula to Prenex Normal Form:


∀xy (∃z P(x, z) & P(y, z)) → ∃u Q(x, y, u) (4)

(b) Draw a pictorial definition for the linguistic variable TALL giving your own subjective
values for TALL variables and their values. (4)

- Short (Blue Line): Full membership at heights less than 1.52m, gradually decreasing to 0 at 1.57m.
- Average (Green Line): Membership increases from 0 at 1.52m, reaches full membership (1) between
1.57m and 1.73m, and decreases to 0 by 1.78m.
- Tall (Orange Line): Membership increases from 0 at 1.73m, reaches full membership (1) between
1.78m and 1.83m, and decreases to 0 by 1.88m.
- Very Tall (Red Line): Membership starts increasing from 1.78m, reaches full membership (1) above
1.83m.
Note: Subjective values and definition may vary as per individual. 2 marks for pictorial
definition and 2 marks for subjective values explanation.

(c) Explain the following sentence as conceptual dependency structure.


"Susan gave the keys to Peter". (2)

Q7. (a) Consider the following game tree in which static scores are all from the first player’s
point of view: What moves should be chosen and why? Which nodes will be pruned according to
the alpha-beta pruning procedure? Give justification of each. (5)

The move chosen should be the path ABEL. As we start from the bottom of the tree the values
selected by the MAX player will be E-3, F-9, G-0, H-7, I-2, and J-6 (as the MAX player will try to
maximize his/her chances of winning). As we move upwards, the MIN player will choose B-3, C-0,
and D-2 (as the MIN player will try to minimize the chances of MAX player winning). Finally at root
A-3 will be chosen, resulting in the move ABEL.
(2 marks)

The nodes that will be pruned according to the alpha-beta pruning procedure are N, H, P, Q, J, T, U.
As we start from the leaf nodes, max player will choose value 3 at node E (3>2). The same will be
transferred to node B. Now at node B (MIN), we are looking for values <=3. F will take value 5 from
node M since N is not encountered yet. Now F value will be updated only if value at N is greater than
5 and since B is looking for values <=3, there is no need to process node N. Hence node N will be
pruned. The same concept will be applied at node C and Node D.

(3 marks)
Alternative solution: Nodes pruned: N, H, P, Q, J, T, U. Justification via α >= β logic.

Note: Any justification similar to above can be considered.

Q7. (b) Given the following information for a database:


A1. If x is on top o f y, y supports x.
A2. If x 1s above y and they are touching each other, x is on top of y.
A3. A cup is above a book.
A4. A cup is touching a book.
(i) Translate the statements A1 through A4 into clausal form. (2 marks (.5 each))
(ii) Show that the predicate supports (book, cup) is true using resolution. (3 marks)

Note: Also consider any other alternate resolution sequence

You might also like