






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Main points of this past exam are: Bayes Classifier, Puzzle-Solving, Bayesian Networks, Constraint Satisfaction, State-Space Search, Resolution Theorem, Heuristics
Typology: Exams
1 / 11
This page cannot be seen from the preview
Don't miss anything!







On special offer
The exam will begin on the next page. Please, do not turn the page until told.
When you are told to begin the exam, please check first to make sure that you have all 11 pages, as numbered 1-11 in the bottom-left corner of each page.
The exam is closed-notes, closed-book. No calculators, cell phones, electronics.
Please clear your desk entirely, except for pen, pencil, eraser, an optional blank piece of paper (for optional scratch pad use), and an optional water bottle.
This page summarizes the points available for each question so you can plan your time.
The Exam is printed on both sides to save trees! Work both sides of each page!
3. (10 pts total) Naïve Bayes Classifier Learning. You are a robot in an animal shelter, and must learn to discriminate Dogs from Cats. You choose to learn a Naïve Bayes classifier. You are given the following (noisy) examples:
Recall that Baye’s rule allows you to rewrite the conditional probability of the class given the attributes as the conditional probability of the attributes given the class. As usual, α is a normalizing constant that makes the probabilities sum to one.
P(Class | Sound, Fur, Color) = α P(Sound, Fur, Color | Class) P(Class)
3a. (2 pts) Now assume that the attributes (Sound, Fur, and Color) are conditionally independent given the Class. Rewrite the expression above, using this assumption of conditional independence (i.e., rewrite it as a Naïve Bayes Classifier expression).
α P(Sound, Fur, Color | Class) P(Class) = α P(Sound | Class) P(Fur | Class) P(Color | Class) P(Class)
3b. (4 pts total; -1 for each wrong answer, but not negative) Fill in numerical values for the following expressions. Leave your answers as common fractions (e.g., 1/4, 3/5).
P(Dog)= 1/2 P(Cat)= 1/
P(Sound=Meow | Class=Dog)= 1/4 P(Sound=Meow | Class=Cat)= 3/
P(Sound=Bark | Class=Dog)= 3/4 P(Sound=Bark | Class=Cat)= 1/
P(Fur=Coarse | Class=Dog)= 3/4 P(Fur=Coarse | Class=Cat)= 1/
P(Fur=Fine | Class=Dog)= 1/4 P(Fur=Fine | Class=Cat)= 3/
P(Color=Brown | Class=Dog)= 1/2 P(Color=Brown | Class=Cat)= 1/
P(Color=Black | Class=Dog)= 1/2 P(Color=Black | Class=Cat)= 1/
3c. (2 pt each) Classify a new example (Sound=Bark ^ Fur=Coarse ^ Color=Brown).
P(Class=Dog | Sound=Bark ^ Fur=Coarse ^ Color=Brown) = α(3/4)(3/4)(1/2)(1/2)=9/
P(Class=Cat | Sound=Bark ^ Fur=Coarse ^ Color=Brown) = α(1/4)(1/4)(1/2)(1/2)=1/
Example Sound Fur Color Class Example #1 Meow Coarse Brown Dog Example #2 Bark Fine Brown Dog Example #3 Bark Coarse Black Dog Example #4 Bark Coarse Black Dog Example #5 Meow Fine Brown Cat Example #6 Meow Coarse Black Cat Example #7 Bark Fine Black Cat Example #8 Meow Fine Brown Cat
See Sections 13. 5.2 and 20.2.2.
4. (10 pts total, 1 pt each) Bayesian Networks. Draw the Bayesian Network that corresponds to the conditional probability equation.
4a. P(B|A,C) P(A) P(C|D) P(D)
4b. P(A) P(B) P(C) P(D)
4c. P(A|B) P(C|B) P(B) P(D)
4d. P(D|C) P(C|B) P(B|A) P(A)
4e. P(B|A) P(A) P(C|D) P(D)
Write down the factored conditional probability equation that corresponds to the graphical Bayesian Network shown.
4f. P(D|A,B,C) P(A) P(B) P(C)
4g. P(D|A,C) P(C|B) P(B|A) P(A)
4h. P(D|B,C) P(C|A,B) P(B) P(A)
4i. P(D|A,B,C) P(C|A,B) P(B|A) P(A)
4j. P(D|B,C) P(C|A) P(B|A) P(A)
A B
C D
A B C D
A
B C D
A B C D
A B C D
A
D
B C
A
D
B^ C
A
D
C
B
A
D
C
B
A
D
C
B
See Section 14.2.
6. (5 pts total, -1 for each error, but not negative) Alpha-Beta Pruning. In the game tree below it is Max 's turn to move. Inside each leaf node is the estimated score of that resulting position as returned by the heuristic static evaluator. CROSS OUT EACH LEAF NODE THAT IS PRUNED BY ALPHA-BETA PRUNING. You do not need to indicate the branch node values. 7. (10 pts total, -2 for each error, but not negative) Conversion to CNF. Convert this Propositional Logic wff (well-formed formula) to Conjunctive Normal Form and simplify. Show your work (correct result, 0 pts; correct work, 10 pts).
P ⇒ [ ¬ { ( Q ⇒ P ) ∧ ( P ⇒ Q ) } ] /* convert ( A ⇔ B ) into ( A ⇒ B) ∧ ( B ⇒ A) */
¬ P ˅ [ ¬ { ( ¬ Q ˅ P ) ∧ ( ¬ P ˅ Q ) } ] /* convert ( A ⇒ B ) into ( ¬ A ˅ B ) */
¬ P ˅ [ ( Q ∧ ¬ P ) ˅ ( P ∧ ¬ Q ) ] /* apply DeMorgan’s Laws */
( ¬ P ˅ Q ˅ P ) ∧ ( ¬ P ˅ Q ˅ ¬ Q ) ∧ ( ¬ P ˅ ¬ P ˅ P ) ∧ ( ¬ P ˅ ¬ P ˅ ¬ Q ) /* distribute */
True ∧ True ∧ True ∧ ( ¬ P ˅ ¬ Q ) /* simplify */
( ¬ P ˅ ¬ Q ) /* simplify */
Red lines indicate where in the tree pruning occurred. You are not obliged to provide the red lines — only to cross out pruned leaf nodes.
(Min)
(Max)
(Max)
See Section 5.3.
It is OK to omit the disjunction symbol here.
See Section 7.5.2.
8. (10 pts total, -2 for each error, but not negative) Resolution Theorem Proving. You are a robot in a logic-based question answering system, and must decide whether or not an input goal sentence is entailed by your Knowledge Base (KB). Your current KB in CNF is:
S1: ( P Q ) S2: ( ¬P Q ) S3: ( P ¬Q )
Your input goal sentence is: ( P ∧ Q).
8a. (2 pts) Write the negated goal sentence in CNF.
S4: (¬P ¬Q )
8b. (8 pts total, -2 for each error, but not negative) Use resolution to prove that the goal sentence is entailed by KB, or else explain why no such proof is possible. For each step of the proof, fill in Si and Sj with the sentence numbers of previous CNF sentences that resolve to produce the CNF result that you write in the resolvent blank. The resolvent is the result of resolving the two sentences Si and Sj. Use as many steps as necessary, ending by producing the empty clause; or else explain why no such proof is possible. The first one is done for you as an example.
Resolve Si S1 with Sj S2 to produce resolvent S5: ( Q )
Resolve Si S1 with Sj S3 to produce resolvent S6: ( P )
Resolve Si S4 with Sj S5 to produce resolvent S7: (¬P )
Resolve Si S6 with Sj S7 to produce resolvent S8: ( )
Resolve Si with Sj to produce resolvent S9:
Resolve Si with Sj to produce resolvent S10:
Add additional lines below if needed; or, if no such resolution proof is possible, use the space below to explain why not: Other proofs are OK as long as they are correct. E.g., you might instead resolve S with S6 to produce resolvent S7 as ( ¬ Q), then resolve that with S5 to produce S8 ( ).
It is OK to insert the disjunction symbol here.
See Section 7.5.2.
10. (8 pts total, 1 pt each) Puzzle-Solving. The sliding-tile puzzle has three black tiles (B), three white tiles (W), and an empty space (blank). The starting state is:
The goal is to have all the white tiles to the left of all the black tiles; the position of the blank is not important.
The puzzle has two legal moves with associated costs: (1) A tile may move into an adjacent empty location. This has a cost of 1. (2) A tile may hop over one or two other tiles into the empty location. This has a cost equal to the number of tiles jumped over.
10a. What is the branching factor? 6
10b. Does the search space have loops (cycles)? (Y=yes, N=no) Y
10c. Is breadth-first search optimal? (“Y" = yes, “N" = no) N
10d. Is uniform-cost search optimal? (“Y" = yes, “N" = no) Y
10e. Consider a heuristic function h1(n) = the number of black tiles to the left of the left- most white tile. Is this heuristic admissible? (“Y" = yes, “N" = no) Y
10f. Consider a heuristic function h2(n) = the number of black tiles to the left of the right- most white tile. Is this heuristic admissible? (“Y" = yes, “N" = no) Y
10g. Consider a heuristic function h3(n) = the number of black tiles to the left of the right-most white tile plus the number of white tiles to the right of the left-most black tile. Is this heuristic admissible? (“Y" = yes, “N" = no) N
10h. Consider a heuristic function h4(n) = h3(n) / 2. Is this heuristic admissible? (“Y" = yes, “N" = no) Y
11. (2 pts total, 1 pt each) Heuristics. Suppose that there is no good step cost or path cost for a problem, i.e., no cost-so-far function g(n). However, there is a good comparison method: a binary test to tell whether one node is cheaper than another, but not to assign numerical values to either. Answer Y (= yes) or N (= no).
11a. Is this enough to do a greedy best-first search? Y Question 11a was discarded as ambiguous. Everyone automatically gets it right.
11b. Suppose you also have a consistent heuristic, h(n). Is this enough to do A* search and guarantee an optimal solution? N
See Chapter 3.
See Chapter 3.
12. (10 pts total, 2 pts each) English to FOL Conversion. For each English sentence below, write the FOL sentence that best expresses its intended meaning. Use Person(x) for “x is a person,” Food(x) for “x is food,” and Likes(x, y) for “x likes y.” The first one is done for you as an example.
12a. (2 pts) “Every person likes every food.”
∀x ∀y [ Person(x) ∧ Food(y) ] ⇒ Likes(x, y)
12b. (2 pts) “For every food, there is a person who likes that food.”
∀y ∃x Food(y) ⇒ [ Person(x) ∧ Likes(x, y) ]
12c. (2 pts) “There is a person who likes every food.”
∃x ∀y Person(x) ∧ [Food(y) ⇒ Likes(x, y) ]
12d. (2 pts) “Some person likes some food.”
∃x ∃y Person(x) ∧ Food(y) ∧ Likes(x, y)
12e. (2 pts) “There is a food that every person likes.”
∃y ∀x Food(y) ∧ [ Person(x) ⇒ Likes(x, y) ]
12f. (2 pts) “For every person, there is a food that the person likes.”
∀x ∃y Person(x) ⇒ [ Food(y) ∧ Likes(x, y) ]
See Section 8.2.