Download First-Order Logic - Artificial Intelligence - Solved Exam and more Exams Artificial Intelligence in PDF only on Docsity!
Final Examination
CS540: Introduction to Artificial Intelligence
December 22, 2009
LAST NAME: SOLUTION
FIRST NAME:
Problem Score Max Score
1 ___________ 14
2 ___________ 10
3 ___________ 12
4 ___________ 14
5 ___________ 10
6 ___________ 14
7 ___________ 10
8 ___________ 8
9 ___________ 8
Total ___________ 100
1. [14] First-Order Logic
(a) [4] Which of the following are correct translations of “No two adjacent countries
have the same color”?
(i) x , y Country x ( ) Country y ( ) Adjacent x y ( , ) ( Color x ( ) Color y ( ))
Yes
(ii) x^ ,^^ y^ (^ Country x ( )^^ ^ Country y (^ )^^ ^ Adjacent x y ( ,^^ ))^ (^ Color x ( )^^ Color y ( ))
Yes
(iii) x , y Country x ( ) Country y ( ) Adjacent x y ( , ) ( Color x ( ) Color y ( ))
No
(iv) x , y ( Country x ( ) Country y ( ) Adjacent x y ( , )) Color x ( y )
No
(b) [3] Let C1 be the clause ŸRepublican(Mother( x )) ¤ Republican( x ) and let C2 be the
clause ŸRepublican( y ) ¤ likes( y , Sarah) ¤ ŸResident( y , Alaska). What is the result of
applying the resolution rule of inference to C1 and C2?
ŸRepublican(Mother(x)) ¤ likes(x, Sarah) ¤ ŸResident(x, Alaska)
(c) [4] Which of the following are valid sentences?
(i) ( x x x ) ( y z y z ) Valid
(ii) x P x ( ) P x ( )
Valid
(d) [3] Are the following two expressions unifiable? If so, what is the most general
unifier? If not, why not?
P ( x , g ( y , A, h ( y , B))) and P ( h (A,B), g (A, y , x ))
MGU = {x/h(A, B), y/A}
3. [12] Perceptrons
(a) [4] Can a Perceptron learn the SAME function of three binary inputs, defined to be 1
if all inputs are the same value and 0 otherwise? Either argue/show that this is impossible
or construct a Perceptron that correctly represents this function.
No. SAME is the complement of XOR. It is not linearly separable and therefore cannot be represented by a Perceptron. Proof is by a figure showing the 3D space.
(b) [4] Can a Perceptron learn to correctly classify the following data, where each
consists of three binary input values and a binary classification value: (111,1), (110,1),
(011,1), (010,0), (000,0)? Either show that this is impossible or construct such a
Perceptron.
Yes. Output is 1 if at least 2 of the 3 inputs are 1. Therefore a Perceptron with all three weights equal to 0. and a threshold value of 0.8 will work.
(c) [2] True or False: Training neural networks has the potential problem of over-fitting
the training data.
True
(d) [2] True or False: The Perceptron Learning Rule is a sound and complete method for
a Perceptron to learn to correctly classify any two-class problem.
False. It can only learn linearly-separable functions.
4. [14] Back-Propagation Learning in Neural Networks
(a) [4] What is the search space and what is the search method used by the back-
propagation algorithm for training neural networks?
The search space is the n-dimensional weight space defined by the n weights (including biases) in a given network. The search method is gradient descent.
(b) [3] Back-propagation minimizes what quantity?
Minimizes the sum-squared error between the output of the network and the desired output.
(c) [3] Does the back-propagation algorithm, when run until a minimum is achieved,
always find the same solution no matter what the initial set of weights are? Briefly
explain why or why not.
No. It will iterate until a local minimum in the squared error is reached.
(d) [4] Instead of using a sigmoid function as the activation function at each unit, which
of the following are mathematically legitimate when using the back-propagation
algorithm for training, assuming x = S wi ai where ai are the inputs to the unit. Explain
briefly.
(i) g ( x ) = sin( x )
Okay since it is differentiable everywhere.
(ii) g ( x ) = +1 if x > 0; -1 otherwise
Not okay since it is not differentiable at 0.
6. [14] Probability
(a) [8] Fill in the missing values in the following joint probability table assuming that A
and B are independent. Show your work.
A =T A =F
B =T 3/12 6/
B =F
Since A and B are independent, P(A, B) = P(A)P(B). Here, P(A, B) = 3/12 = P(A)P(B) and P(ŸA, B) = 6/12 = P(ŸA)P(B) Solving, we get P(A) = 1/3 and P(B) = 3/ So, P(A, ŸB) = P(A)P(ŸB) = (1/3)(1 – 3/4) = 1/ P(ŸA, ŸB) = P(ŸA)P(ŸB) = (1 – 1/3)(1 – 3/4) = 2/12 = 1/
(b) [6] Consider two arbitrary Boolean random variables, C and D.
Assuming P ( C =F, D =T) / P ( C =T, D =T) = 2, what is P ( C =T | D =T)?
By the product rule, P (Ÿ C , D ) = P (Ÿ C | D ) P ( C ) and P ( C , D ) = P ( C | D )P( D ) So, P (Ÿ C , D ) / P ( C , D ) = P (Ÿ C | D ) P ( D ) / P ( C | D )P( D ) = P (Ÿ C | D ) / P ( C | D ) = 2 and P ( C | D ) = P (Ÿ C | D ) / 2 We also know P ( C | D ) + P (Ÿ C | D ) = 1 Using these two equations, we can solve for P ( C | D ) = 1/
7. [10] Bayesian Networks
Consider a (Naïve) Bayesian network B A C where the variables are all Boolean.
Complete the following CPTs assuming P ( A =T, B =T, C =T) = 1/18, and
P ( A =F, B =F, C =F) = 1/24. Show your work.
P ( B =T | A =F) = 1/
P ( C =T | A =T) = 1/
P ( C =T | A =F) = 3/
P ( A =T) =?
P ( B =T | A =T) =?
P (Ÿ A , Ÿ B , Ÿ C ) = P (Ÿ C | Ÿ A , Ÿ B ) P (Ÿ B | Ÿ A ) P (Ÿ A )
= P (Ÿ C | Ÿ A ) P (Ÿ B | Ÿ A ) P (Ÿ A )
= (1 – 3/4) (1 – 1/2) P (Ÿ A ) = 1/
So, P (Ÿ A ) = 8/24 = 1/3 and P ( A ) = 2/
P ( A , B , C ) = P ( C | A , B ) P ( B | A ) P ( A ) = P ( C | A ) P ( B | A ) P ( A ) = (1/4) P ( B | A ) (2/3) = 1/ So, P ( B | A ) = 1/