Sample problems from 2nd half of course
Let me emphasize that this is just a collection of sample problems,
not a sample final exam.
Multiple choice problems
Problem 1
Consider the following CFG grammar:
S -> NP VP
NP -> NG | NG "and" NG
NG -> pronoun | noun
VP -> verb | verb NP | VP "and" VP
Lexicon:
I : pronoun.
cook : noun, verb
eggs : noun
fish : noun, verb.
Which of the following parse tree are correct:
i. S ---> NP ---> NG ---> pronoun ---> I
|
|-> VP ---> verb ---> cook
|
|-> NP ---> NG ---> noun ---> eggs
|
|-> "and"
|
|-> NG ---> noun ---> fish
ii. S ---> NP ---> NG ---> pronoun ---> I
|
|-> VP ---> verb ---> cook
|
|-> NP ---> NG ---> noun ---> eggs
|
|-> "and"
|
|-> VP ---> verb ---> fish
iii.S ---> NP ---> NG ---> pronoun ---> I
|
|-> VP ---> VP ---> verb ---> cook
| |
| |-> NP ---> NG ---> noun ---> eggs
|
|-> "and"
|
|-> VP ---> verb ---> fish
iv. S ---> NP ---> NG ---> pronoun ---> I
|
|-> VP ---> verb ---> cook
|
|-> NP ---> NG ---> noun ---> eggs
|
|-> "and"
|
|-> VP ---> verb ---> fish
A. All four.
B. Only (i)
C. (i), (iii), and (iv).
D. (i) and (iii).
E. (i) and (iv).
Problem 2
In a chart parser, the "EXTENDER" module could combine
edge [2,4,VP -> VG * NP] with
A. edge [2,4,VG -> modal verb *] to
create edge [2,4,VP -> VG NP *]
B. edge [4,6,VG -> modal verb *] to
create edge [2,6,VP -> VG NP *]
C. edge [2,6,VG -> modal verb *] to
create edge [2,6,VP -> VG * NP]
D. edge[2,4,NP -> determiner noun *] to create
edge [2,4,VP -> VG NP *]
E. edge[4,6,NP -> determiner noun *] to create
edge [2,6,VP -> VG NP *]
F. edge[2,6,NP -> determiner noun *] to create
edge [2,6,VP -> VG * NP]
Problem 3
Compositional semantics is
- A. The principle that the meaning of a sentence is derived by combining
the meanings of the words in a mode indicated by the syntactic structure.
- B. A technique for applying world knowledge to semantic interpretation.
- C. The problem of giving an interpretation to a text of many sentences.
- D. A method of disambiguation.
- E. The decomposition of a word into a root and its inflections, prefixes
and suffixes.
Problem 4
Bayes' Law states that
- A. Prob(P|Q) = Prob(P) / Prob(Q).
- B. Prob(P|Q) = Prob(Q|P)
- C. Prob(P|Q) = Prob(Q|P) / Prob(Q)
- D. Prob(P|Q) = Prob(P) * Prob(Q|P) / Prob(Q)
- E. Prob(P|Q) = Prob(Q) * Prob(Q|P) / Prob(P)
Problem 5
In a feed-forward, back-propagation network, learning proceeds by
- A. Propagating activation levels from the input layer to the output layer.
- B. Propagating activation levels from the output layer to the input layer.
- C. Propagating modification to weights on the arcs from the input layer to the output layer.
- D. Propagating modification to weights on the arcs from the output layer to the input layer.
- E. Adding nodes and links in the hidden layers.
- F. Both adding and deleting nodes and links in the hidden layers.
Long Answer Problems
Problem 6:
Consider a domain where the individuals are people and languages.
Let Z be the first-order language with the following primitives:
s(X,L) --- Person X speaks language L.
c(X,Y) --- Persons X and Y can communicate.
i(W,X,Y) --- Person W can serve as an interpreter between persons X and Y.
j,p,m,e,f --- Constants: Joe, Pierre, Marie, English, and French respectively.
A. Express the following statements in Z:
- i. Joe speaks English, but Pierre speaks French.
- ii. If X and Y both speak L, then X and Y can communicate.
- iii. If W can communicate both with X and with Y, then
W can serve as an interpreter between X and Y.
- iv. For any two languages L and M, there is someone who speaks both
L and M.
- v. Marie can speak both English and French.
- vi. Marie can interpret between Joe and Pierre.
B. Show how sentences (i), (ii), (iii), (v), and (vi) can be expressed
in Datalog. (Hint: Sentences (i) and (v) each turn into two
facts in Datalog.)
C. Explain why sentence (iv) cannot be expressed in Datalog.
D. Show how (vi) can be proven from (i), (ii), (iii) and (v) using forward
chaining.
D. Show how (vi) can be proven from (i), (ii), (iii) and (v) using backward
chaining.
Problem 7
Consider the following pair of sentences:
A. Joe wore a wool suit. ("suit" = pants and jacket)
B. The suit is in the court. ("suit" = lawsuit).
Explain how the disambiguation techniques of selectional restriction and
frequency in context can be applied in these two sentences.
Problem 8
List the major modules of a natural language interpretation system and
explain their function.
Problem 9
Consider the sentence "Hammers are for driving nails into surfaces."
Name two words in this sentence that are lexically ambiguous. (There are
at least four.) For each of these two words, describe a disambiguation
technique which will choose the right interpretation over at least one
of the wrong interpretations. Be specific.
Problem 10
In this problem and in problem 11, we consider a data set
with three Boolean predictive attributes,
A,B,C, and a Boolean classification, Z.
A. Suppose that your data is completely
characterized by the following rules:
- 1. If X.A = T and X.C = F then X.Z = T.
- 2. If X.B = F and X.C = T then X.Z = T.
- 3. Otherwise, X.Z=F.
Construct a decision tree whose predictions correspond to these rules.
B. True or false: Given any consistent set of rules like those above, it
is possible to construct a decision tree that executes that set of rules.
By "consistent", I mean that there are no examples where two different rules
give different answers.
Problem 11
Which of the following expresses the independence
assumption that is used
in deriving the formula for Naive Bayesian learning, for the classification
problem in problem 10.
- a. Prob(Z|A,B,C) = Prob(Z|A) * Prob(Z|B) * Prob(Z|C)
- b. Prob(Z|A,B,C) = Prob(A,B,C | Z) * Prob(Z) / Prob(A,B,C)
- c. Prob(A,B,C|Z) = Prob(A|Z) * Prob(B|Z) * Prob(C|Z)
- d. Prob(A,B,C) = Prob(A) * Prob(B) * Prob(C)
- e. Prob(Z|A,B,C) = Prob(Z|A) * Prob(A|B) * Prob(B|C).
- f. Prob(A,B,C|Z) = Prob(A|Z) * Prob(B|A) * Prob(C|B).
Problem 12
Consider the following data set T. A and B are numerical attributes and
Z is a Boolean classification.
A B Z
1 2 T
2 1 F
3 2 T
1 1 F
Find a set of weights and a threshhold that categorizes all this data
correctly. (Hint: Sketch a graph of the instances in the plane where
the coordinates are A and B.)