Sunteți pe pagina 1din 7

CS 4710 - Artificial Intelligence

CS-4710 Artificial Intelligence


Final Examination
Date: 17 February 2015
SOLUTION
Time Allowed: 120 minutes Max. Marks: 50

Q 1. 10 Marks

a) The inference mechanism which reaches the conclusion by starting with a set of
known facts and deriving new facts using given rules is called

a) Backward chaining c) Forward chaining


b) Deduction of the information d) Resolution

b) The problem with constraints, domains and variables where we have to give
values to variables from domain according to some restrictions is called

a) Domain variables problem c) Partial assignment problem


b) Constraints satisfaction d) Fully explained problem
problem
c) Entailment between two sentences α and β (α entails β ) may be defined as

a) α follows logically from β c) β is true in all those models where α


b) α is true in all those models is true
where β is true d) All of these

d) We use first order logic instead of propositional logic because

a) Propositional logic allows partial information


b) Propositional logic has very limited expressive power
c) Meaning in propositional logic is context-independent
d) All of the above

e) Inference is the process of deriving new information from the old known
information

a) True b) False c) None

f) Inference algorithm which derives only entailed sentences is called

a) Complete c) Satisfied
b) Sound d) None of these

Final Exam – Fall 2014 Page 1 of 7


CS 4710 - Artificial Intelligence

g) CNF may be defined as

a) Critical Normal Form c) Disjunction of Conjunctions


b) Conjunction of Disjunctions d) All of these

h) In CSP we use MRV heuristic to select

a) Next variable c) Value of next variable


b) Next arc d) Previous variable

i) In Regression planning we start by selecting the

a) Last action first c) First action


b) Action with most causal links d) Action without a causal link

j) Demotion is the process of


a) Placing an action after threatened actions
b) Placing an action before the threatened actions
c) Placing an action between the threatened actions
d) None of the above

Q 2. 10 Marks
Express the following sentences in first order logic, then convert into CNF and
prove through resolution that Maryam is older than Anam.

1. Maryam is the mother of Anam


2. Maryam is alive
3. If x is the mother of y it means that x is parent of y
4. If x is the parent of y it means that x is older than y

Use following predicates

Mother(x, y) to denote x is the mother of y;


Parent(x, y) to denote x is the parent of y;
Alive(x) to denote x is alive;
Older(x, y) to denote x is older than y:

Answer

1) Mother(Maryam, Anam)
2) Alive(Maryam)
3) Mother(x,y)  Parent(x,y)
4) Parent(x,y)  Older(x,y)
5) Older(x,y) .. We suppose negation of our conclusion.

6) Mother(x,y)  Parent(x,y) remove  in 3 above

Final Exam – Fall 2014 Page 2 of 7


CS 4710 - Artificial Intelligence

7) Parent(x,y)  Older(x,y) remove  from 4 above

Replace x with “Maryam” and y with “Anam” in sentences 3 to 7.

Combine 1 & 6 above,


Mother(Maryam,Anam) ‘resolves’ with Mother(Maryam,Anam) and we are left
with

8) Parent(Maryam, Anam)

Now combine 7 & 8 above,


Parent(Maryam,Anam) ‘resolves’ with Parent(Maryam,Anam) and we are left
with

9) Older(Maryam,Anam)

When we combine 5 & 9 above, we get empty clause (sentence) because


Older(Maryam,Anam) ‘resolves’ with Older(Maryam,Anam)

Hence proved by resolution.

Q3 5 Marks
Convert the Q  (P  R) into Conjunctive Normal Form.

Answer

Q  (P  R)
(Q  (P  R))  ((P  R)  Q) REMOVE 
(Q  P  R)  ( (P  R)  Q) REMOVE 
(Q  P  R)  (P  R)  Q) DEMORGAN LAW

(Q  P  R)  (P  Q)  (R  Q) Distribute / 

Now the above sentence is in CNF

Q4 7 Marks
Solve the following blocks world problem below using partial order planning; trace
the search from the initial empty plan to a complete solution. Small case letters are
representing the variables

The actions are:

Move(b, x, y):
Precond: On(b, x) ^ Clear(b) ^ Clear(y)
Effect: On(b, y) ^ Clear(x) ^ On(b, x) ^ Clear(y)

Final Exam – Fall 2014 Page 3 of 7


CS 4710 - Artificial Intelligence

MoveToTable(b, x):
Precond: On(b, x) ^ Clear(b)
Effect: On(b, Table) ^ Clear(x) ^ On(b, x)

The initial state is On(B, A) ^ On(A, Table) ^ On(C, Table) ^ Clear(B) ^ Clear(C).
The goal is On(C, B) ^ On(B, Table).

Answer

“T” stands for “Table”

I: On(B,A) On(A,T) On(C,T) Clear(B) Clear(C)


G: On(C,B) On(B,T)

We will start from open pre-conditions On(B,T) & On(C,B) at A∞ level and take
them one by one respectively. Then we will move from A∞ to A0 using those
actions which satisfies our open pre condition.

A0
On(B,A) On(A,T) On(C,T) Clear(C) Clear(B)

On(C,T) Clear(C) Clear(B)


A2: Move(C,T,B)
On(C,B) On(C,T) Clear(B) On(B,A) Clear(B)
A1: MoveToTable(B,A)
On(B,T) Clear(A) On(B,A)

On(C,B) On(B,T)
A∞
Explanation:
Start with open pre condition On(B,T) at A∞ level and use “MoveToTable” action
because its effect is On(B,T). The pre-conditions for this action are available in our
initial state. After this we take second open pre-condition On(C,B) and use
“Move(C,T,B)” action because On(C,B) is the effect of this action. All the pre-
conditions for this action are also available in initial state.

Final Exam – Fall 2014 Page 4 of 7


CS 4710 - Artificial Intelligence

Red arrows show the causal links and green thick arrow shows the plan steps.

Q5 8 Marks
Consider the following planning problem.

An agent is at home and has no food. The goal is to be at home and have food.
Actions available to the agent are:

Buy(Food):
Precond: At(x) ^ Sells(x, Food)
Effect: Have(Food)

Go(x, y):
Precond: At(x)
Effect: :  At(x) ^ At(y)

The initial state is At(Home) ^ Sells(S1, Food)


The goal state is At(Home) ^ Have(Food).

Solve this problem using regression planning; trace the algorithm, explaining each
step.

Answer

I: At(Home) ^ Sells(S1, Food) Initial state


G: At(Home) ^ Have(Food) Goal state

Applying Regression algorithm step by step

Reg (I, G, AllActions, ()) Start with an empty path


Reg (I, {At(S1) ^ Have(Food)}, AllActions, (Go(S1,Home)))
Reg (I, {At(S1) ^ Sells(S1,Food)}, AllActions, (Buy(Food),Go(S1,Home)))
Reg (I, {At(Home) ^ Sells(S1,Food)}, AllActions,
(Go(Home,S1),Buy(Food),Go(S1,Home)))

The current goal {At(Home) ^ Sells(S1,Food)} ⊆ I (initial state) therefore the


process terminates.

Final Exam – Fall 2014 Page 5 of 7


CS 4710 - Artificial Intelligence

Q6 10 Marks
Consider the following graph representing the Australian map. You have to color it
with three colors namely Red (R), Blue (B) and Green (G)

Every region can be assigned one color out of three colors such that neighboring
regions do not have the same color.

The domains of all the variables are as follows

WA NT Q NSW V SA T
R B G R B G R B G R B G R B G R B G R B G
a)
Now answer the following questions (Each part is independent of the others).

Let us assume that we assign “Red” color to “WA” variable. What will be the effect
on domains of the remaining variables using “Forward Checking Algorithm”.

Answer

Red color will be removed from the domains of neighboring regions NT & SA. The
updated domains will look like the figure below.

WA NT Q NSW V SA T
R B G R B G R B G R B G B G R B G
b)

Consider the following variable and domain values

WA NT Q NSW V SA T
R B G R B R B G B R B G

Whether the following arcs are consistent? If not then make them consistent.

Final Exam – Fall 2014 Page 6 of 7


CS 4710 - Artificial Intelligence

i) From SA to NSW
ii) From NSW to SA

Answer

i) Arc from SA to NSW is consistent because when we assign ‘B’ to SA there still
remains a legal value ‘R’ to be assigned to NSW. The other neighboring regions to
NSW are Q and V. We have already assigned ‘G’ to Q and the same color can be
assigned to V also because Q and V are not connected.

ii) The arc from NSW to SA, however, is not consistent if we assign ‘B’ to NSW
and then there will be none value left for SA. We can make it consistent by
assigning ‘R’ to NSW and ‘B’ has already been assigned to SA.

>>>>>>>>>>>>>>>> Good Luck <<<<<<<<<<<<<<<<

Final Exam – Fall 2014 Page 7 of 7

S-ar putea să vă placă și