CS621: Quiz-1: 10/9/07: 8

CS344
Introduction to Artificial Intelligence
Midsem-Examination
15/02/14
09.30 AM-11.30 AM
(Clarity and readability of answers are of utmost importance. Printout of class notes
and slides allowed)
Question-1
(a) Recall “Maslow’s Hierarchy of Human Needs” discussed in the class. Some of the
human needs are d-needs or deficiency needs, in the sense that their non-fulfillment
is acutely felt, but their fulfillment is not something special. There are other needs
which are exactly opposite, in that their fulfillment is noticed and lauded, but their
non-fulfillment is not critical. Mention the specific needs in these two classes?
Place them in Maslow’s hierarchy by drawing the hierarchy.
(1+1+1=3)
Answer:
The needs upto the 3rd layer are d-needs (survival, food+rest+shelter, social-acceptance).
Their non-fulfilment is critically felt, but this fulfillment is so universal that it is hardly a
big deal. The needs in 3rd layer upwards are rare, and their fulfillment is noticed, but their
non-fulfillment is not critical.
(b) What do you think the left and right parts of the brain (of a right-handed individual)
do in case of the following activities:
a. Listening to a song
b. Quarreling
c. Cuddling a pet
(Write your answer as: Left Brain: <XYZ>; Right Brain: <PQR>)
(3 X 1=3)
Answer : (flexibility and variation expected):
General principle :
Left brain- concerned with details, organization, symbol-processing, verbal part
Right brain- concerned with gestalt, holistic aspects, emotion, overall and big picture
Listening to a song- left brain : rythm, words ; right brain : tune, emotion
Quarreling- left brain : words and body language ; right brain : level of anger, frustration
Cuddling a pet- left brain : pet’s physical condition, position with respect to the cuddler’s
body; right brain : affection towards and concern for the pet
Question-2
(a) Prove by a counter example that h(n)<=h*(n) for all nodes n in a search graph does
not necessarily mean that the heuristic is monotonic. That is a heuristic may satisfy
admissibility, and not be monotonic.
(3)
Answer:
Suppose S-n1-n2-n3-G is a graph. Let, all arc costs be 1.
Then,
h*(S)=4, h*(n1)=3, h*(n2)=2, h*(n3)=1, h*(G)=0
If we have h(S)=3, h (n1)=2.8, h(n2)=1, h(n3)=0.8, h(G)=0
Then MR is violated for the n1-n2 pair, though is admissible.
(b) Prove or disprove rigorously: “If monotone restriction is satisfied, nodes in the
optimal path- assume only one optimal path- in the search graph will be expanded
in the order of their depth from the start node. Assume there is no cycle in the search
graph”.
(5)
Answer:
Suppose S-n1-n2-n3-…ni-….-G is the one and only optimal path.
Suppose ni is picked for expansion. As proved in the class, if MR is satisfied, then for any
node picked up for expansion, g value is g*.
So,
g(ni)=g*(ni)
parent(ni)=ni-1
ni-1 must have been expanded BEFORE ni, else it cannot be ni’s parent
g(ni-1)=g*(ni-1)
parent(ni-1)=ni-2
ni-2 must have been expanded BEFORE ni-1, else it cannot be ni-1’s parent
g(ni-2)=g*(ni-3)
parent(ni-2)=ni-3
ni-3 must have been expanded BEFORE ni-2, else it cannot be ni-2’s parent
i.e.,
Then,
So,
i.e.,
Then,
So,
i.e.,
Then,
and so on. Hence proved.
Question-3
(a) Positive linear combination (PLC) of a set of vectors V1, V2, V3,…, VN is defined as
N
 p V , where all pis are non-negative and not all pis are 0. Prove that PLC=0 is a
i 1
i i
sufficient condition for non-linear separability, i.e., if PLC=0, then the function
from which the vectors (augmented and 0-class negated) came, cannot be linearly
separable, that is, a single perceptron cannot compute the function.
Answer:
Proof is by contradiction. Suppose the function is linearly separable. Then there
exists a W* that computes the function. That is
W*.Vi >0, for all i=1…M
(1)
N
_
 piVi  0,
_
0 is the 0 vector
i 1
Multiply both sides by W *
LHS  0, by (1), and RHS  0
 contradiction!
For example, for XOR,
V1=[1 0 0]T, V2=[-1 0 1]T, V3=[-1 1 0]T, V4=[1 1 1]T
are the vectors.
p1=p2=p3=p4=1 will give the PLC.
(Note also that p1+p4=p2+p3, i.e., the sum of the pis for positive class is equal to the sum
of the pis for the negative class, a fact that will be used in the sigmoid neuron part)
Can a single sigmoid do the job in such a case? Prove rigorously. (4+4=8)
Answer: No a single sigmoid neuron cannot compute any function whose augmented and
negated vectors satisfy the PLC property.
Proof:
y
tu
y
tu= high water mark
tl= low water mark
tu > t l
tl
x
Given,
N
 pV
i 1
i i
_
0
1
1  ex
Without loss of generality, assume vectors 1 to M belong to the positive class and vectors
M+1 to N belong to the negative class. Denote the coefficients for negative class vectors
as qjs.
M
i.e.,
N
 pV  q V
i 1
i i
j  M 1
j
_
j
0
( A)
and ,
M
 pi 
i 1
N
q
j  M 1
j
( B)
Now, for any positive class vector the sigmoid output should rise above the high water
mark tu, while for any negative class vector the output should fall below the low water mark
tl. so,
1
 tu , i  1, M
1  e wvi
and ,
1
 tu , j  M  1, N
w(  v j )
1 e
(IMP: note the use of –Vj instead of that of Vj)
From these, after mathematical manipulation we get,
WVi  ln(
tu
), i  1, M
1  tu
and ,
WV j  ln(
1  tl
), j  M  1, N
tl
From this,
M
( piWVi 
i 1
 0  ln(
N
 q jWV j )  ln(
i  M 1
tu M
1  tl N
) pi  ln(
) qj
1  tu i 1
tl i M 1
tu M
1  tl N
) pi  ln(
) qj
1  tu i 1
tl i M 1
But ,
M
p
i 1
i

N
q
i  M 1
j
Therefore,
ln(
 ln(
tu
1  tl
)  ln(
) 0
1  tu
tl
tu  tl tu
)0
tl  tl tu
 tu  tl
that is , high water mark  low water mark ; contradiction!!
Hence proved.
(b) Give a multilayer perceptron that computes palindrome of 5 Boolean inputs
(output=1, when the input Boolean string reads the same left to right and right to
left; else 0). Show that only two hidden neurons are sufficient to compute the
function. Give a complete explanation of what the hidden neurons are doing.
(3+5=8)
Answer:
One output neuron, one hidden layer with two neurons; the input layer contains n
neurons.
e.g. for a 4 bit input the network is shown below:
-0.5
-1
-1
0.5
0.5
-1
H
+1
H
-1
1
2
-2
0
2
+1
-2
X3
X2
X1
X0
The problem is not linearly separable (2 summable: {0000+1111}={1000+0001}; so there
exists a PLC). If the input length is odd, then make the two weights from the middle bit 0
and pretend as if the middle bit does not exist. After that, The weight scheme is 2i for the
ith bit with sign altered for every consecutive bit. Also the weight vector for H 0 is the
negated weight vector for H1. The outputs of the BOTH hidden neurons are 0 when the
input is a palindrome. The outermost neuron computes a NOR function.
The Boolean functions computed by the hidden neurons are as follows:
H0:
X1 X 2  X 0 X1 X 3  X 0 X 2 X 3
H1: X1 X 2  X 0 X1 X 3  X 0 X 2 X 3
There are 4 cases of asymmetry, viz.:
a) X 1  0  X 3  1
b) X 1  1  X 3  0
c) X 1  0  X 2  1
d ) X1  1  X 2  0
The TWO hidden neurons detect these cases of asymmetry. A single neuron cannot detect
symmetry.
======Paper ends==========