






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







May 16, 2012
Problem Score Max Score
Total ___________ 100
Question 1. [19] Decision Trees
(a) [8] Suppose you are using the Decision Tree Learning algorithm to learn a binary classification variable, C , and you must decide which attribute to assign to a node in the tree. At this node there are 100 examples; 25 are positive and 75 are negative. If attribute A is selected, its first child will get 5 positive and 50 negative examples, and its second child will get 20 positive and 25 negative examples.
(i) [4] Write an expression in terms of logs and fractions for computing the entropy of C , i.e., H ( C ). You do not need to simplify this or give a real-valued answer.
(ii) [4] Write an expression in terms of logs and fractions for computing the conditional entropy (also called Remainder) of choosing attribute A , i.e., H ( C | A ). You do not need to simplify this or compute a real-valued answer.
(b) [3] In a problem where each example has n binary attributes, to select the best attribute for a decision tree node at depth k , where the root node is at depth 0, how many attributes are candidates for selection at this node?
Question 2. [10] Probabilistic Reasoning
A barrel contains many balls, some of which are red and the rest are blue. 40% of the balls are made of metal and the rest are made of wood. 30% of the metal balls are colored blue, and 10% of the wood balls are colored blue. Let Boolean random variables B mean a ball is blue (so ¬ B means a ball is red), and M means a ball is metal (and ¬ M means it is wood).
(a) [2] What is the probability that a wood ball is red, i.e., P (¬ B | ¬ M )?
(b) [4] What is the prior probability that a ball is blue, i.e., P ( B )?
(c) [4] What is the posterior probability that a blue ball is metal, i.e., P ( M | B )?
Question 3. [14] Naïve Bayes
Consider the problem of detecting if an email message contains a Virus. Say we use four random variables to model this problem: Boolean class variable V indicates if the message contains a virus or not, and three Boolean feature variables: A , B and C. We decide to use a Naïve Bayes Classifier to solve this problem so we create a Bayesian network with arcs from V to each of A , B and C. Their associated CPTs are created from the following data: P ( V )=0.2, P (¬ V )=0.8, P ( A | V )=0.8, P ( A |¬ V )=0.4, P ( B | V )=0.3, P ( B |¬ V )=0.1, P ( C | V )=0.1, P ( C |¬ V )=0.
(a) [3] Compute P (¬ A , B , C | V )
(b) [3] Compute P (¬ A , C , V )
(c) [4] Compute P ( A , ¬ B , ¬ C )
(d) [4] Compute P ( V | A , ¬ B , ¬ C )
Question 5. [18] Hidden Markov Models
The following HMM describes Chuck's emotional state on consecutive days. Each day he is either Happy or Sad. But he hides his emotional state so all you can observe is his facial expression each day, which is either a Smile , Frown , Laugh , or Yell. Let qt define his emotional state on day t. Let ot indicate his observed facial expression on day t. The arcs from the Start state give the probabilities of his initial emotional state on day 1 (i.e., they specify the π vector in the HMM).
(a) [3] Compute P ( q 1 = Sad , q 2 = Sad , q 3 = Happy , q 4 = Happy )
(b) [5] Compute P ( q 2 = Happy )
(c) [5] Compute P ( o 2 = Frown )
(d) [5] Compute P ( q 1 = Sad | o 1 = Frown )
(h) [2] True or false: The sentence ( P ∧ Q ) ⇔ R can be represented by a set of Horn clauses.
(i) [5] Given the four PL sentences: ¬ P ∨ ¬ Q , ( P ∨ Q ) ∧ ( P ∨ R ), ( S ∨ Q ) ∧ ( S ∨ ¬ R ), ¬ R defining a KB, prove S using the Resolution Refutation algorithm. Show your answer as a proof tree.
Question 7. [6] First-Order Logic
Let the predicates Red-hair ( x ) mean x has red-hair, Vegetarian ( x ) mean x is a vegetarian, Runner ( x ) mean x is a runner, and Likes ( x , y ) mean x likes y. Translate each of the following from English to a well-formed formula in FOL.
(a) [3] No red-haired runner likes any vegetarian.
(b) [3] There is someone with red hair who everyone likes.