Midterm 2 V1. Introduction to Artificial Intelligence. CS 188 Spring 2015

Similar documents
Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

Midterm II. Introduction to Artificial Intelligence. CS 188 Spring ˆ You have approximately 1 hour and 50 minutes.

CS 188 Fall Introduction to Artificial Intelligence Midterm 2

Midterm II. Introduction to Artificial Intelligence. CS 188 Fall ˆ You have approximately 3 hours.

Introduction to Artificial Intelligence Midterm 2. CS 188 Spring You have approximately 2 hours and 50 minutes.

Final. Introduction to Artificial Intelligence. CS 188 Spring You have approximately 2 hours and 50 minutes.

Midterm II. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 3 hours.

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

CS 188 Fall Introduction to Artificial Intelligence Midterm 2

Final. Introduction to Artificial Intelligence. CS 188 Summer 2014

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Final Exam December 12, 2017

Introduction to Spring 2009 Artificial Intelligence Midterm Exam

Introduction to Fall 2011 Artificial Intelligence Final Exam

Midterm Exam, Spring 2005

Final Exam December 12, 2017

Andrew/CS ID: Midterm Solutions, Fall 2006

Introduction to Machine Learning Midterm, Tues April 8

CSE 150. Assignment 6 Summer Maximum likelihood estimation. Out: Thu Jul 14 Due: Tue Jul 19

Machine Learning, Midterm Exam: Spring 2009 SOLUTION

Introduction to Fall 2009 Artificial Intelligence Final Exam

Outline. CSE 473: Artificial Intelligence Spring Bayes Nets: Big Picture. Bayes Net Semantics. Hidden Markov Models. Example Bayes Net: Car

Machine Learning, Fall 2009: Midterm

Mark your answers ON THE EXAM ITSELF. If you are not sure of your answer you may wish to provide a brief explanation.

Bayes Nets III: Inference

Final. CS 188 Fall Introduction to Artificial Intelligence

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

1 Probabilities. 1.1 Basics 1 PROBABILITIES

Machine Learning, Midterm Exam

Midterm. Introduction to Machine Learning. CS 189 Spring Please do not open the exam before you are instructed to do so.

Midterm: CS 6375 Spring 2015 Solutions

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October,

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

FINAL: CS 6375 (Machine Learning) Fall 2014

Final. Introduction to Artificial Intelligence. CS 188 Spring You have approximately 2 hours and 50 minutes.

CS 188: Artificial Intelligence Fall 2009

1 Probabilities. 1.1 Basics 1 PROBABILITIES

6.867 Machine learning

CSE 546 Final Exam, Autumn 2013

FINAL EXAM: FALL 2013 CS 6375 INSTRUCTOR: VIBHAV GOGATE

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2013

Introduction to Spring 2006 Artificial Intelligence Practice Final

CS188 Fall 2018 Section 7: Bayes Nets and Decision Nets

CS 5522: Artificial Intelligence II

Qualifier: CS 6375 Machine Learning Spring 2015

Name (NetID): (1 Point)

Midterm: CS 6375 Spring 2018

Machine Learning, Midterm Exam: Spring 2008 SOLUTIONS. Q Topic Max. Score Score. 1 Short answer questions 20.

Final Examination CS 540-2: Introduction to Artificial Intelligence

UNIVERSITY of PENNSYLVANIA CIS 520: Machine Learning Final, Fall 2014

Product rule. Chain rule

Final Examination CS540-2: Introduction to Artificial Intelligence

Math 51 Midterm 1 July 6, 2016

Midterm. Introduction to Machine Learning. CS 189 Spring You have 1 hour 20 minutes for the exam.

CS 188: Artificial Intelligence Fall Recap: Inference Example

Recap: Bayes Nets. CS 473: Artificial Intelligence Bayes Nets: Independence. Conditional Independence. Bayes Nets. Independence in a BN

The exam is closed book, closed notes except your one-page (two sides) or two-page (one side) crib sheet.

Inference in Graphical Models Variable Elimination and Message Passing Algorithm

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

Midterm, Fall 2003

Machine Learning Practice Page 2 of 2 10/28/13

Name: Josh Hug Your EdX Login: SID: Name of person to left: Josh Hug Exam Room: Josh Hug Name of person to right: Josh Hug Primary TA: Adam Janin

CS188: Artificial Intelligence, Fall 2010 Written 3: Bayes Nets, VPI, and HMMs

Bayesian Networks BY: MOHAMAD ALSABBAGH


Name: UW CSE 473 Final Exam, Fall 2014

Announcements. CS 188: Artificial Intelligence Fall Causality? Example: Traffic. Topology Limits Distributions. Example: Reverse Traffic

Designing Information Devices and Systems I Fall 2015 Anant Sahai, Ali Niknejad Midterm 1. Exam location: 60 Evans, last digit SID= 6

CS534 Machine Learning - Spring Final Exam

Bayes Nets: Independence

CS 188: Artificial Intelligence Spring Announcements

Department of Computer and Information Science and Engineering. CAP4770/CAP5771 Fall Midterm Exam. Instructor: Prof.

Chris Bishop s PRML Ch. 8: Graphical Models

Bayes Networks. CS540 Bryan R Gibson University of Wisconsin-Madison. Slides adapted from those used by Prof. Jerry Zhu, CS540-1

Introduction to Machine Learning Midterm Exam

6.034 Quiz 4. 2 December Ryan Alexander Ben Greenberg Neil Gurram. Eeway Hsu Brittney Johnson Veronica Lane

Outline. CSE 573: Artificial Intelligence Autumn Bayes Nets: Big Picture. Bayes Net Semantics. Hidden Markov Models. Example Bayes Net: Car

Artificial Intelligence Bayes Nets: Independence

Based on slides by Richard Zemel

CS540 ANSWER SHEET

Final. Introduction to Artificial Intelligence. CS 188 Fall You have approximately 2 hours and 50 minutes.

Final Exam, Machine Learning, Spring 2009

6.036: Midterm, Spring Solutions

Introduction to Spring 2009 Artificial Intelligence Midterm Solutions

You have 3 hours to complete the exam. Some questions are harder than others, so don t spend too long on any one question.

Bayesian Networks. Vibhav Gogate The University of Texas at Dallas

Announcements. CS 188: Artificial Intelligence Fall VPI Example. VPI Properties. Reasoning over Time. Markov Models. Lecture 19: HMMs 11/4/2008

CS 188: Artificial Intelligence Spring Announcements

Probabilistic Models

Be able to define the following terms and answer basic questions about them:

Designing Information Devices and Systems II Spring 2016 Anant Sahai and Michel Maharbiz Midterm 1. Exam location: 1 Pimentel (Odd SID + 61C)

Hidden Markov Models. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 19 Apr 2012

CSE 473: Artificial Intelligence Autumn 2011

Midterm exam CS 189/289, Fall 2015

Bayes Nets. CS 188: Artificial Intelligence Fall Example: Alarm Network. Bayes Net Semantics. Building the (Entire) Joint. Size of a Bayes Net

Midterm. You may use a calculator, but not any device that can access the Internet or store large amounts of data.

Probabilistic Graphical Models Homework 2: Due February 24, 2014 at 4 pm

MIDTERM SOLUTIONS: FALL 2012 CS 6375 INSTRUCTOR: VIBHAV GOGATE

Transcription:

S 88 Spring 205 Introduction to rtificial Intelligence Midterm 2 V ˆ You have approximately 2 hours and 50 minutes. ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet. ˆ Mark your answers ON THE EXM ITSELF. If you are not sure of your answer you may wish to provide a brief explanation or show your work. ˆ For multiple choice questions, means mark all options that apply means mark a single choice ˆ There are multiple versions of the exam. For fairness, this does not impact the questions asked, only the ordering of options within a given question. First name Last name SID edx username First and last name of student to your left First and last name of student to your right For staff use only: Q. Probability /4 Q2. ayes Nets: Representation /8 Q3. ayes Nets: Independence /8 Q4. ayes Nets: Inference /6 Q5. ayes Nets: Sampling /0 Q6. VPI /3 Q7. HMM: Where is the ar? /3 Q8. Particle Filtering: Where are the Two ars? / Q9. Naive ayes MLE /7 Q0. Perceptron /0 Total /00

THIS PGE IS INTENTIONLLY LEFT LNK

Q. [4 pts] Probability (a) For the following questions, you will be given a set of probability tables and a set of conditional independence assumptions. Given these tables and independence assumptions, write an expression for the requested probability tables. Keep in mind that your expressions cannot contain any probabilities other than the given probability tables. If it is not possible, mark Not possible. (i) [ pt] Using probability tables P(), P( ), P( ), P(, ) and no conditional independence assumptions, write an expression to calculate the table P(, ). P(, ) = Not possible. (ii) [ pt] Using probability tables P(), P( ), P( ), P(, ) and no conditional independence assumptions, write an expression to calculate the table P(, ). P(, ) = P () P ( ) P (,) b P () P ( ) P (,) Not possible. (iii) [ pt] Using probability tables P( ), P(), P(, ), P( ) and conditional independence assumption, write an expression to calculate the table P(). P() = a P ( ) P ( ) Not possible. (iv) [ pt] Using probability tables P(, ), P(), P(, ), P(, ) and conditional independence assumption, write an expression for P(,, ). P(,, ) = Not possible. (b) For each of the following equations, select the minimal set of conditional independence assumptions necessary for the equation to be true. (i) [ pt] P(, ) = P( ) P() No independence assumptions needed. (ii) [ pt] P(, ) = P() P( ) P( ) P( ) P() No independence assumptions needed. (iii) [ pt] P(, ) = c P(, c) P( c) P(c) No independence assumptions needed. 3

(iv) [ pt] P(,, D) = P(, D) P(,, D) D D D D No independence assumptions needed. (c) (i) [2 pts] Mark all expressions that are equal to P( ), given no independence assumptions. c P (, c ) P (, ) P ( ) c P (, c) c P (,,c) c P (,c) P ( ) P ( ) c P (,c) P (,) P (,) P ( ) None of the provided options. (ii) [2 pts] Mark all expressions that are equal to P(,, ), given that. P () P () P (, ) P () P ( ) P ( ) P () P ( ) P (, ) P ( ) P ( ) P () P () P ( ) P ( ) P (, ) P (, ) None of the provided options. (iii) [2 pts] Mark all expressions that are equal to P(, ), given that. P ( ) P ( ) c P (,,c) P () P () P ( ) P ( ) P (,) P () P ( ) P (,) c P (,,c) P (, ) P () P () P ( ) P ( ) None of the provided options. 4

Q2. [8 pts] ayes Nets: Representation ssume we are given the following ten ayes nets, labeled G to G 0 : G G 2 G 3 G 4 G 5 G 6 G 7 G 8 G 9 G 0 ssume we are also given the following three ayes nets, labeled to 3 : 2 3 efore we go into the questions, let s enumerate all of the (conditional) independence assumptions encoded in all the ayes nets above. They are: ˆ G : ; ; ; ; ; ˆ G 2 : ; ; ; ˆ G 3 : ; ; ; ˆ G 4 : ˆ G 5 : ˆ G 6 : ˆ G 7 : ˆ G 8 : ˆ G 9 : ˆ G 0 : ˆ : ; ; ; ˆ 2 : ˆ 3 : (a) [2 pts] ssume we know that a joint distribution d (over,, ) can be represented by ayes net. Mark all of the following ayes nets that are guaranteed to be able to represent d. G G 2 G 3 G 4 G 5 G 6 G 7 G 8 G 9 G 0 5

None of the above. Since can represent d, we know that d must satisfy the assumptions that follows, which are: ; ; ;. We cannot assume that d satisfies the other two assumptions, which are and, and so a ayes net that makes at least one of these two extra assumptions will not be guaranteed to be able to represent d. This eliminates the choices G, G 2, G 3, G 6, G 8. The other choices G 4, G 5, G 7, G 9, G 0 are guaranteed to be able to represent d because they do not make any additional independence assumptions that makes. (b) [2 pts] ssume we know that a joint distribution d 2 (over,, ) can be represented by ayes net 2. Mark all of the following ayes nets that are guaranteed to be able to represent d 2. G G 2 G 3 G 4 G 5 G 6 G 7 G 8 G 9 G 0 None of the above. Since 2 can represent d 2, we know that d 2 must satisfy the assumptions that 2 follows, which is just:. We cannot assume that d 2 satisfies any other assumptions, and so a ayes net that makes at least one other extra assumptions will not be guaranteed to be able to represent d 2. This eliminates the choices G, G 2, G 3, G 4, G 5, G 7. The other choices G 6, G 8, G 9, G 0 are guaranteed to be able to represent d 2 because they do not make any additional independence assumptions that 2 makes. (c) [2 pts] ssume we know that a joint distribution d 3 (over,, ) cannot be represented by ayes net 3. Mark all of the following ayes nets that are guaranteed to be able to represent d 3. G G 2 G 3 G 4 G 5 G 6 G 7 G 8 G 9 G 0 None of the above. Since 3 cannot represent d 3, we know that d 3 is unable to satisfy at least one of the assumptions that 3 follows. Since 3 only makes one independence assumption, which is, we know that d 3 does not satisfy. However, we can t claim anything about whether or not d 3 makes any of the other independence assumptions. d 3 might not make any (conditional) independence assumptions at all, and so only the ayes nets that don t make any assumptions will be guaranteed to be able to represent d 3. Hence, the answers are the fully connected ayes nets, which are G 9, G 0. (d) [2 pts] ssume we know that a joint distribution d 4 (over,, ) can be represented by ayes nets, 2, and 3. Mark all of the following ayes nets that are guaranteed to be able to represent d 4. G G 2 G 3 G 4 G 5 G 6 G 7 G 8 G 9 G 0 None of the above. Since, 2, 3 can represent d 4, we know that d 4 must satisfy the assumptions that, 2, 3 make. The union of assumptions made by these ayes nets are: ; ; ;,,. Note that this set of assumptions encompasses all the possible assumptions that you can make with 3 random variables, so any ayes net over,, will be able to represent d 4. 6

Q3. [8 pts] ayes Nets: Independence For the following questions, each edge shown in the ayes nets below does not have a direction. For each of the edges shown, assign a direction (by adding an arrowhead at one end of each edge) to ensure that the ayes Net structure implies the assumptions provided. You cannot add new edges. The ayes nets can imply more assumptions than listed, but they must imply the ones listed. If there does not exist an assignment of directions that satisfies all the assumptions listed, clearly mark the Not Possible choice. If you mark the Not Possible choice, the directions that you draw in the ayes net will not be looked at. Keep in mind that ayes Nets cannot have directed cycles. You may find it useful to use the front of the next page to work on this problem. (a) [2 pts] D E ssumptions: ˆ E ˆ E D ˆ E Not Possible This is one of three correct answers. correct answer must have the common effect triple and must have either the causal chain or common cause triple for DE. This is because E implies that there must at least be one common effect triple with the middle node either at, or D. If the common effect triple is D, then the and DE triples are either going to be common cause or causal chain triples. Either way, when considering the assumption E, the path DE will be active and so this assumption is not guaranteed to hold, so D cannot be a common effect triple. Now take the assumption E D. To make the path DE inactive, since we claimed D is not a common effect triple, it must be either a causal chain or common cause triple, and either way, with unobserved, the triple is active. So DE needs to be inactive, and the only way to do that is to make DE either a causal chain triple or common cause triple since D is observed. This means that DE is not a common effect triple, so going back to the fact that there has to be at least one common effect triple to satisfy E, the triple must be a common effect triple. (b) [3 pts] D E F G H ssumptions: ˆ E H ˆ H, D ˆ F G, D Not Possible There is no possible assignment of edges that satisfies all the assumptions. Starting off with the assumption E H, this implies that the triple DE is a common effect triple with the middle node unobserved and none of its descendants observed, which means we need the edge D, E D, and H D. Now take the assumption H, D. We observe the path DH. The triple DH is a common effect triple with the middle node observed, so it is an active triple. No matter how you draw the direction between and, D will be either a common cause or causal chain triple with the middle node unobserved, so it is active. For the path to be inactive, we need the triple to be inactive, and since the middle node is observed, this 7

means that cannot be a common effect triple. Now we consider the final assumption F G, D, which means we consider the path F G. To make this path inactive, one of the triples F or G must be inactive, and since the middle node is unobserved in both triples, one of these triples must be a common effect triple with no descendants observed. If we make F a common effect triple by adding the arrows F and, since we already claimed that is not a common effect triple, then must be a causal chain with the edges and. Due to the edge, is a descendant of, so F will still be an active triple. Now let s consider making G a common effect triple by adding the arrows and G. ut D is a descendant of, so this triple is also active. Hence, the path F G is guaranteed to be active, and so we cannot satisfy all assumptions. (c) [3 pts] D E F G H ssumptions: ˆ H ˆ G E, F ˆ E, H Not Possible This is one of four correct answers. correct answer must have all edges the same as the solution above, with the exception that the edges between (, F ) and (, ) can point in either direction. G E, F implies that G is a common effect triple, so we add the edges and G. We also need to be wary that none of s descendants can be observed, so we have to be careful of node E and F since they are observed. This also implies that the triple F G must either be a causal chain triple or a common effect triple, which will come in handy later. E, H implies that D cannot be a common effect triple, so we have to add the arrow D. Now, we mentioned that E should not be a descendant of, so we need the edge E D. Now consider the assumption H. For the path F GH, we need a common effect triple in either F G or F GH, but since we claimed earlier that F G is not a common effect triple, F GH must be a common effect triple and so we add the arrows F G and H G. ecause a ayes net cannot have cycles, we need the arrow H D. For any direction for the edges (, ) and (, F ), you can do a final check to see that all the assumptions will be satisfied in the ayes net. 8

This page is intentionally left blank for scratch work. Nothing on this page will be graded.

Q4. [6 pts] ayes Nets: Inference ssume we are given the following ayes net, and would like to perform inference to obtain P (, D E = e, H = h). D E F G H (a) [ pt] What is the number of rows in the largest factor generated by inference by enumeration, for this query P (, D E = e, H = h)? ssume all the variables are binary. 2 8 2 6 2 2 2 3 None of the above. Since the inference by enumeration first joins all the factors in the ayes net, that factor will contain six (unobserved) variables. The question assumes all variables are binary, so the answer is 2 6. (b) [2 pts] Mark all of the following variable elimination orderings that are optimal for calculating the answer for the query P (, D E = e, H = h). Optimality is measured by the sum of the sizes of the factors that are generated. ssume all the variables are binary.,, F, G G, F,, F, G,,,, F, G None of the above. The sum of the sizes of factors that are generated for the variable elimination ordering G, F,, is 2 + 2 + 2 2 + 2 2 rows, which is smaller than for any of the other variable elimination orderings. The ordering F, G,, is close but the sum of the sizes of factors is slightly bigger, with 2 2 + 2 + 2 2 + 2 2 rows. (c) Suppose we decide to perform variable elimination to calculate the query P (, D E = e, H = h), and choose to eliminate F first. (i) [2 pts] When F is eliminated, what intermediate factor is generated and how is it calculated? Make sure it is clear which variable(s) come before the conditioning bar and which variable(s) come after. f ( G, e ) = f P (f )P (G f, e) This follows from the first step of variable elimination, which is to join all factors containing F, and then marginalize over F to obtain the intermediate factor f. (ii) [ pt] Now consider the set of distributions that can be represented by the remaining factors after F is eliminated. Draw the minimal number of directed edges on the following ayes Net structure, so that it can represent any distribution in this set. If no additional directed edges are needed, please fill in that option below. 0

D E No additional directed edges needed G H n additional edge from to G is necessary, because the intermediate factor is of the form f (G ). Without this edge from to G, the ayes net would not be able to express the dependence of G on. (Note that adding an edge from G to is not allowed, since that would introduce a cycle.)

Q5. [0 pts] ayes Nets: Sampling ssume we are given the following ayes net, with the associated conditional probability tables (PTs). D P() +a 0.5 a 0.5 E P( ) +a +b 0.2 +a b 0.8 a +b 0.5 a b 0.5 P( ) +b +c 0.4 +b c 0.6 b +c 0.8 b c 0.2 D P(D ) +b +d 0.2 +b d 0.8 b +d 0.2 b d 0.8 D E P(E, D) +c +d +e 0.6 +c +d e 0.4 +c d +e 0.2 +c d e 0.8 c +d +e 0.4 c +d e 0.6 c d +e 0.8 c d e 0.2 You are given a set of the following samples, but are not told whether they were collected with rejection sampling or likelihood weighting. a b +c +d +e a +b +c d +e a b c d +e a b +c d +e a +b +c +d +e Throughout this problem, you may answer as either numeric expressions (e.g. 0. 0.5) or numeric values (e.g. 0.05). (a) [2 pts] ssuming these samples were generated from rejection sampling, what is the sample based estimate of P (+b a, +e)? nswer: 0.4 The answer is the number of samples satisfying the query variable s assignment (in this case, = +b divided by the total number of samples, so the answer is 2 / 5 = 0.4. (b) [2 pts] ssuming these samples were generated from likelihood weighting, what is the sample-based estimate of P (+b a, +e)? 2

nswer: 3 ased on likelihood weighting, we know the weight of each sample is P ( = a) P (E = e = c, D = d). The weights are: 0.3 (= 0.5 * 0.6), 0. (= 0.5 * 0.2), 0.4 (= 0.5 * 0.8), 0. (same assignments to and D as second sample), 0.3 (same assignments to and D as first sample). The estimate is then (0. + 0.3) / (0.3 + 0. + 0.4 + 0. + 0.3) = 0.4 /.20 = /3 = 0.333. (c) [2 pts] gain, assume these samples were generated from likelihood weighting. However, you are not sure about the original PT for P (E, D) given above being the PT associated with the ayes Net: With 50% chance, the PT associated with the ayes Net is the original one. With the other 50% chance, the PT is actually the PT below. D E P(E, D) +c +d +e 0.8 +c +d e 0.2 +c d +e 0.4 +c d e 0.6 c +d +e 0.2 c +d e 0.8 c d +e 0.6 c d e 0.4 Samples from previous page copied below for convenience: a b +c +d +e a +b +c d +e a b c d +e a b +c d +e a +b +c +d +e Given this uncertainty, what is the sample-based estimate of P (+b a, +e)? nswer: 0 27 The weight of each sample is P ( = a) (0.5 P (E = e = c, D = d) + 0.5 P 2 (E = e = c, D = d)). The new weights are 0.35 (= 0.5 * (0.5 * 0.6 + 0.5 * 0.8)), 0.5 (= 0.5 * (0.5 * 0.2 + 0.5 * 0.4)), 0.35 (= 0.5 * (0.5 * 0.8 + 0.5 * 0.6)), 0.5, and 0.35. The estimate is then (0.5 + 0.35) / (0.35 * 3 + 0.5 * 2) = 0.5 /.35 = 0 / 27 (d) [ pt] Now assume you can only sample a small, limited number of samples, and you want to estimate P (+b, +d a) and P (+b, +d +e). You are allowed to estimate the answer to one query with likelihood weighting, and the other answer with rejection sampling. In order to obtain the best estimates for both queries, which query should you estimate with likelihood weighting? (The other query will have to be estimated with rejection sampling.) P (+b, +d a) P (+b, +d +e) Either both choices allow you to obtain the best estimates for both queries. The evidence +e is at the leaves of the ayes net, which means it s possible to sample all the other variables, but have to reject the last node E. We can avoid this problem by using likelihood weighting for sampling, since it fixes the values of observed random variables to that of the fixed evidence. (e) Suppose you choose to use Gibbs sampling to estimate P (, E +c, d). ssume the PTs are the same as the ones for parts (a) and (b). urrently your assignments are the following: a b +c d +e (i) [ pt] Suppose the next step is to resample E. What is the probability that the new assignment to E will be +e? nswer: 0.2 In order to sample E, we need to calculate P (E a, b, +c, d), which is equal to P (E +c, d) since E is conditionally independent of and, given and D. The value for P (+e +c, d) is given directly in the PT for P (E, D), and it is 0.2. 3

(ii) [ pt] Instead, suppose the next step is to resample. What is the probability that the new assignment to will be +a? 8 nswer: 3 In order to sample, we need to calculate P ( b, +c, d, +e), which is equal to P ( ) since is conditionally independent of, D, and E, given. We can calculate this using ayes rule: P ( ) = 0.8 0.5 0.8 0.5+0.5 0.5) = 0.4 0.65 = 8 3 P ( )P () P (). Thus, P (+a b) = P ( b +a)p (+a) P ( b) = P ( b +a)p (+a) a {+a, a} P ( b a)p (a) = (iii) [ pt] Instead, suppose the next step is to resample. What is the probability that the new assignment to will be +b? nswer: 3 In order to sample, we need to calculate P ( a, +c, d, +e), which is equal to P ( a, +c, d) since is conditionally independent of E, given and D. The PT tables that are involved in calculating P ( a + c, d, +e) are P (), P ( ), P ( ), P (D ). First, we remove rows of the PTs that do not agree with the evidence -a, +c, -d, +e. We then join the resulting PTs to obtain P ( a,, +c, d). We select P ( a, +b, +c, d) and P ( a, b, +c, d) from this table, and normalize so that the two probabilities sum to one (i.e., to transform them to P (+b a, +c, d) and P ( b a, +c, d). 4

Q6. [3 pts] VPI onsider a decision network with the following structure. Node is an action, and node U is the utility: D E U F G (a) [ pt] hoose the option which is guaranteed to be true, or Neither guaranteed if no option is guaranteed to be true. V P I() = 0 V P I() > 0 Neither guaranteed It is guaranteed that V P I(X) = 0 if and only if X is conditionally independent of U, and so knowing X would not change our beliefs about the utility we get. D-Separation shows us that this is true for node, so V P I() = 0. (b) [2 pts] Mark all of the following that are guaranteed to be true. V P I(E) V P I() V P I(E) = V P I() V P I(E) V P I() None of the above Utility depends on the action and the values of and D, so the value of E matters only if it gives us information about and D. In this case, since E is conditionally independent of D, it can only give us information about. E can give us noisy information about, but this cannot be any better than actually knowing the value of. So, we get that V P I(E) V P I(). Note that equality can happen when E gives perfect information about, or when both V P Is are 0, but it is not guaranteed to be happen. (c) [2 pts] Mark all of the following that are guaranteed to be true. V P I(E F ) V P I( F ) V P I(E F ) V P I( F ) V P I(E F ) = V P I( F ) Here, E gives us some information about and D. information about and less information about D. None of the above This may or may not be more valuable than perfect 5

The decision network on the previous page has been reproduced below: D E U F G (d) [2 pts] Noting that E G F, mark all of the following that are guaranteed to be true. V P I(E, G F ) = V P I(E F ) + V P I(G E, F ) V P I(E, G F ) = V P I(E F )V P I(G E, F ) V P I(E, G F ) = V P I(E F ) + V P I(G F ) V P I(E, G F ) = V P I(E F )V P I(G F ) None of the above Regardless of the ayes Net structure, it is true that V P I(E, G F ) = V P I(E F ) + V P I(G E, F ). This just says that the information by getting E and then getting G is the same as the information by getting E and G at the same time. Then, D-separation shows that E is conditionally independent of G given F, and so we know V P I(G E, F ) = V P I(G F ). Thus, V P I(E, G F ) = V P I(E F ) + V P I(G F ) (e) [3 pts] Suppose we have two actions, a and a 2. In addition, you are given P () and P (D) below. Fill in the empty entries in the utility table below with either or such that V P I() = V P I(D) = 0, but V P I(, D) > 0. Note on grading: You will get point for each condition you enforce correctly, that is, you get point each for ensuring V P I() = 0, V P I(D) = 0, and V P I(, D) > 0. If you cannot enforce all three conditions, try to enforce two for partial credit. ction a : U(a,, D) +b +d ction a 2 : U(a 2,, D) +b +d P () +b 0.5 -b 0.5 P (D) +d 0.5 -d 0.5 b +d +b d b +d +b d b d b d There are many possible answers. The conditions that need to hold are given below: For V P I(, D) > 0, we need the utilities to be such that for some assignment to and D, the optimal action is a, whereas for some other assignment, the optimal action is a 2. Thus, having the information of and D allows us to choose a sometimes and a 2 sometimes, giving us a better score than if we only got to choose a or a 2 no matter what the values of and D are. Thus, there needs to be one row where U(a, b, d) > U(a 2, b, d) and another row where U(a 2, b, d) > U(a, b, d). For V P I(D) = 0, we need the optimal action to remain the same when we know D and when we don t know D. First, notice that the optimal action when we don t know D is just whichever table has more s. (If both tables have the same number of s, then both actions have an expected utility of 0 and so they are both optimal.) 6

Suppose that the optimal action is a. Then, when we learn D, in both cases (D = +d and D = d) the optimal action should still be a (if it changes to a 2, that will increase the expected utility). The optimal action for D = +d is the action which has more s in the first two rows, and the optimal action for D = d is the action which has more s in the last two rows. Similarly, for V P I() = 0, we need the optimal action to remain the same when we know and when we don t know. Here, the optimal action for = +b is the action which has more s in the first and third rows, and the optimal action for = b is the action which has more s in the second and fourth rows. (f) For this question, assume you did the previous part correctly - that is, you should assume that V P I() = V P I(D) = 0, and V P I(, D) > 0. Now taking into account your answer from the previous part, choose the option which is guaranteed to be true, or Neither guaranteed if no option is guaranteed to be true. This means that you should fill in one circle for each row. (i) [ pt] V P I(E) = 0 V P I(E) > 0 Neither guaranteed (ii) [ pt] V P I(G) = 0 V P I(G) > 0 Neither guaranteed (iii) [ pt] V P I(D ) = 0 V P I(D ) > 0 Neither guaranteed We know that E is conditionally independent of D given no evidence. So, E can only give us information about, and not about D. However, even perfect information about is not worth anything (since V P I() = 0), and so the imperfect information about given by E is also useless, and so V P I(E) = 0. On the other hand, G can affect both and D (by D-separation, we see that we cannot guarantee that G is conditionally independent of or D). Thus, G could give us information about both and D, and since V P I(, D) > 0, we could have V P I(G) > 0. However, we are not guaranteed that this is true - perhaps G is conditionally independent of, even though it cannot be inferred by D-separation. In this case, we would have V P I(G) = 0. Finally, we have V P I(D ) = V P I(, D) V P I() > 0. 7

Q7. [3 pts] HMM: Where is the ar? Transportation researchers are trying to improve traffic in the city but, in order to do that, they first need to estimate the location of each of the cars in the city. They need our help to model this problem as an inference problem of an HMM. For this question, assume that only one car is being modeled. (a) The structure of this modified HMM is given below, which includes X, the location of the car; S, the noisy location of the car from the signal strength at a nearby cell phone tower; and G, the noisy location of the car from GPS.... X t X t X t+...... S t G t S t G t S t+ G t+... We want to perform filtering with this HMM. That is, we want to compute the belief P (x t s :t, g :t ), the probability of a state x t given all past and current observations. The dynamics update expression has the following form: P (x t s :t, g :t ) = (i) (ii) (iii) P (x t s :t, g :t ). omplete the expression by choosing the option that fills in each blank. (i) [ pt] P (s :t, g :t ) P (s :t, g :t ) P (s :t )P (g :t ) P (s :t )P (g :t ) (ii) [ pt] x t x t max xt max xt (iii) [ pt] P (x t 2, x t ) P (x t x t 2 ) P (x t, x t ) P (x t x t ) The derivation of the dynamics update is similar to the one for the canonical HMM, but with two observation variables instead. P (x t s :t, g :t ) = x t P (x t, x t s :t, g :t ) = x t P (x t x t, s :t, g :t )P (x t s :t, g :t ) = x t P (x t x t )P (x t, x t s :t, g :t ) In the last step, we use the independence assumption given in the HMM, X t S :t, G :t X t. 8

The observation update expression has the following form: P (x t s :t, g :t ) = (iv) (v) (vi) P (x t s :t, g :t ). omplete the expression by choosing the option that fills in each blank. (iv) [ pt] P (s t, g t s :t, g :t ) P (s :t, g :t s t, g t ) P (s t s :t )P (g t g :t ) P (s :t s t )P (g :t g t ) P (s t s :t )P (g t g :t ) P (s t, g t s :t, g :t ) P (s :t s t )P (g :t g t ) P (s :t, g :t s t, g t ) (v) [ pt] x t x t max xt max xt (vi) [ pt] P (s t x t )P (g t x t ) P (x t, s t )P (x t, g t ) P (x t, s t, g t ) P (x t, s t )P (x t, g t ) P (x t, s t, g t ) P (x t s t )P (x t g t ) P (x t s t )P (x t g t ) P (s t x t )P (g t x t ) gain, the derivation of the observation update is similar to the one for the canonical HMM, but with two observation variables instead. P (x t s :t, g :t ) = P (x t s t, g t, s :t, g :t ) = P (s t, g t s :t, g :t ) P (x t, s t, g t s :t, g :t ) = P (s t, g t s :t, g :t ) P (s t, g t x t, s :t, g :t )P (x t s :t, g :t ) = P (s t, g t s :t, g :t ) P (s t, g t x t )P (x t s :t, g :t ) = P (s t, g t s :t, g :t ) P (s t x t )P (g t x t )P (x t s :t, g :t ) In the second to last step, we use the independence assumption S t, G t S :t, G :t X t ; and in the last step, we use the independence assumption S t G t X t. 9

(b) It turns out that if the car moves too fast, the quality of the cell phone signal decreases. Thus, the signaldependent location S t not only depends on the current state X t but it also depends on the previous state X t. Thus, we modify our original HMM for a new more accurate one, which is given below.... X t X t X t+...... S t G t S t G t S t+ G t+... gain, we want to compute the belief P (x t s :t, g :t ). In this part we consider an update that combines the dynamics and observation update in a single update. P (x t s :t, g :t ) = (i) (ii) (iii) (iv) P (x t s :t, g :t ). omplete the forward update expression by choosing the option that fills in each blank. (i) [ pt] P (s t, g t s :t, g :t ) P (s :t, g :t s t, g t ) P (s t s :t )P (g t g :t ) P (s t, g t s :t, g :t ) P (s t s :t )P (g t g :t ) P (s :t, g :t s t, g t ) P (s :t s t )P (g :t g t ) P (s :t s t )P (g :t g t ) (ii) [ pt] x t x t max xt max xt (iii) [ pt] P (x t 2, x t, s t )P (x t, g t ) P (x t, x t, s t )P (x t, g t ) P (s t, g t x t ) P (s t x t 2, x t )P (g t x t ) P (s t x t, x t )P (g t x t ) P (s t, g t x t ) P (x t 2, x t s t )P (x t g t ) P (x t, x t s t )P (x t g t ) P (x t 2, x t, s t, g t ) P (x t, x t, s t, g t ) (iv) [ pt] P (x t, x t ) P (x t x t ) P (x t 2, x t ) P (x t x t 2 ) For this modified HMM, we have the dynamics and observation update in a single update because one of the previous independence assumptions does not longer holds. P (x t s :t, g :t ) = x t P (x t, x t s t, g t, s :t, g :t ) = P (x t, x t, s t, g t s :t, g :t ) P (s t, g t s :t, g :t ) x t = P (s t, g t x t, x t, s :t, g :t )P (x t, x t s :t, g :t ) P (s t, g t s :t, g :t ) x t = P (s t, g t x t, x t )P (x t x t, s :t, g :t )P (x t s :t, g :t ) P (s t, g t s :t, g :t ) x t = P (s t x t, x t )P (g t x t, x t )P (x t x t )P (x t s :t, g :t ) P (s t, g t s :t, g :t ) x t = P (s t x t, x t )P (g t x t )P (x t x t )P (x t s :t, g :t ) P (s t, g t s :t, g :t ) x t In the third to last step, we use the independence assumption S t, G t S :t, G :t X t, X t ; in the second to last step, we use the independence assumption S t G t X t, X t and X t S :t, G :t X t ; and in the last step, we use the independence assumption G t X t X t. 20

(c) The Viterbi algorithm finds the most probable sequence of hidden states X :T, given a sequence of observations s :T, for some time t = T. Recall the canonical HMM structure, which is shown below.... X t X t X t+...... S t S t S t+... For this canonical HMM, the Viterbi algorithm performs the following dynamic programming computations: m t [x t ] = P (s t x t ) max x t P (x t x t )m t [x t ]. We consider extending the Viterbi algorithm for the modified HMM from part (b). We want to find the most likely sequence of states X :T given the sequence of observations s :T and g :T. The dynamic programming update for t > for the modified HMM has the following form: m t [x t ] = (i) (ii) (iii) m t [x t ]. omplete the expression by choosing the option that fills in each blank. (i) [ pt] x t x t max xt max xt (ii) [ pt] P (x t 2, x t, s t )P (x t, g t ) P (x t, x t, s t )P (x t, g t ) P (s t, g t x t ) P (s t x t 2, x t )P (g t x t ) P (s t x t, x t )P (g t x t ) P (s t, g t x t ) P (x t 2, x t s t )P (x t g t ) P (x t, x t s t )P (x t g t ) P (x t 2, x t, s t, g t ) P (x t, x t, s t, g t ) (iii) [ pt] P (x t, x t ) P (x t x t ) P (x t 2, x t ) P (x t x t 2 ) If we remove the summation from the forward update equation of part (b), we get a joint probability of the states, P (x :t s :t, g :t ) = P (s t, g t s :t, g :t ) P (s t x t, x t )P (g t x t )P (x t x t )P (x :t s :t, g :t ). We can define m t [x t ] to be the maximum joint probability of the states (for a particular x t ) given all past and current observations, times some constant, and then we can find a recursive relationship for m t [x t ], m t [x t ] = P (s :t, g :t ) max x :t P (x :t s :t, g :t ) = P (s :t, g :t ) max x :t P (s t, g t s :t, g :t ) P (s t x t, x t )P (g t x t )P (x t x t )P (x :t s :t, g :t ) P (s :t, g :t ) = max P (s t x t, x t )P (g t x t )P (x t x t ) x t P (s t, g t s :t, g :t ) max P (x :t s :t, g :t ) x :t 2 = max x t P (s t x t, x t )P (g t x t )P (x t x t )P (s :t, g :t ) max x :t 2 P (x :t s :t, g :t ) = max x t P (s t x t, x t )P (g t x t )P (x t x t )m t [x t ]. Notice that the maximum joint probability of states up to time t = T given all past and current observations is given by max P (x :T s :T, g :T ) = max x t m T [x t ] x :T P (s :T, g :T ). We can recover the actual most likely sequence of states by bookkepping back pointers of the states the maximized the Viterbi update equations. 2

Q8. [ pts] Particle Filtering: Where are the Two ars? s before, we are trying to estimate the location of cars in a city, but now, we model two cars jointly, i.e. car i for i {, 2}. The modified HMM model is as follows: ˆ X (i) the location of car i ˆ S (i) the noisy location of the car i from the signal strength at a nearby cell phone tower ˆ G (i) the noisy location of car i from GPS... X () t X () t X () t+... S ()... S (2) t G () S () t S () t G () t t+ G () t+ t G (2) S (2) t S (2) t G (2) t t+ G (2) t+... X (2) t X (2) t X (2) t+............ d D(d) E L (d) E N (d) E G (d) -4 0.05 0 0.02 0-3 0.0 0 0.04 0.03-2 0.25 0.05 0.09 0.07-0.0 0.0 0.20 0.5 0 0 0.70 0.30 0.50 0.0 0.0 0.20 0.5 2 0.25 0.05 0.09 0.07 3 0.0 0 0.04 0.03 4 0.05 0 0.02 0 The signal strength from one car gets noisier if the other car is at the same location. Thus, the observation S (i) t depends on the current state of the other car X (j) t, j i. The transition is modeled using a drift model D, the GPS observation G (i) t using the error model E G, and the observation S (i) t using one of the error models E L or E N, depending on the car s speed and the relative location of both cars. These drift and error models are in the table above. The transition and observation models are: P (S (i) t X (i) P (X (i) t X (i) t, X(i) t P (G (i) t t ) = D(X(i) t, X (j) t ) = X (i) t ) { E N (X (i) t S (i) t ), if X (i) t X (i) t 2 or X(i) t = X (j) t E L (X (i) t X (i) t ) = E G (X (i) t G (i) t ). S (i) t ), otherwise Throughout this problem you may give answers either as unevaluated numeric expressions (e.g. 0. 0.5) or as numeric values (e.g. 0.05). The questions are decoupled. (a) ssume that at t = 3, we have the single particle (X () 3 =, X (2) 3 = 2). (i) [2 pts] What is the probability that this particle becomes (X () 4 = 3, X (2) 4 = 3) after passing it through the dynamics model? P (X () 4 = 3, X (2) 4 = 3 X () 3 =, X (2) 3 = 2) = P (X () 4 = 3 X () 3 = ) P (X (2) 4 = 3 X (2) 3 = 2) = D( 3 ( )) D(3 2) nswer: 0.025 = 0.25 0.0 = 0.025 also 22

(ii) [2 pts] ssume that there are no sensor readings at t = 4. What is the joint probability that the original single particle (from t = 3) becomes (X () 4 = 3, X (2) 4 = 3) and then becomes (X () 5 = 4, X (2) 5 = 4)? P (X () 4 = 3, X () 5 = 4, X (2) 4 = 3, X (2) 5 = 4 X () 3 =, X (2) 3 = 2) = P (X () 4 = 3, X () 5 = 4 X () 3 = ) P (X (2) 4 = 3, X (2) 5 = 4 X (2) 3 = 2) = P (X () 5 = 4 X () 4 = 3) P (X () 4 = 3 X () 3 = ) P (X (2) 5 = 4 X (2) 4 = 3) P (X (2) 4 = 3 X (2) 3 = 2) = D( 4 ( 3)) D( 3 ( )) D(4 3) D(3 2) = 0.0 0.25 0.0 0.0 = 0.00025 nswer: 0.00025 For the remaining of this problem, we will be using 2 particles at each time step. (b) t t = 6, we have particles [(X () 6 = 3, X (2) 6 = 0), (X () 6 = 3, X (2) 6 = 5)]. Suppose that after weighting, resampling, and transitioning from t = 6 to t = 7, the particles become [(X () 7 = 2, X (2) 7 = 2), (X () 7 = 4, X (2) 7 = )]. (i) [2 pts] t t = 7, you get the observations S () 7 = 2, G () 7 = 2, S (2) 7 = 2, G (2) 7 = 2. What is the weight of each particle? Particle Weight (X () 7 = 2, X (2) 7 = 2) (X () 7 = 4, X (2) 7 = ) P (S () 7 = 2 X () 6 = 3, X () 7 = 2, X (2) 7 = 2) P (G () 7 = 2 X () 7 = 2) P (S (2) 7 = 2 X (2) 6 = 0, X (2) 7 = 2, X () 7 = 2) P (G (2) 7 = 2 X (2) 7 = 2) = E N (2 2) E G (2 2) E N (2 2) E G (2 2) = 0.30 0.50 0.30 0.50 = 0.0225 P (S () 7 = 2 X () 6 = 3, X () 7 = 4, X (2) 7 = ) P (G () 7 = 2 X () 7 = 4) P (S (2) 7 = 2 X (2) 6 = 5, X (2) 7 =, X () 7 = 4) P (G (2) 7 = 2 X (2) 7 = ) = E L (4 2) E G (4 2) E N ( 2) E G ( 2) = 0.05 0.07 0.20 0.5 = 0.00005 (ii) [2 pts] Suppose both cars cell phones died so you only get the observations G () 7 = 2, G (2) 7 = 2. What is the weight of each particle? Particle Weight (X () 7 = 2, X (2) 7 = 2) (X () 7 = 4, X (2) 7 = ) P (G () 7 = 2 X () 7 = 2) P (G (2) 7 = 2 X (2) 7 = 2) = E G (2 2) E G (2 2) = 0.50 0.50 = 0.25 P (G () 7 = 2 X () 7 = 4) P (G (2) 7 = 2 X (2) 7 = ) = E G (4 2) E G ( 2) = 0.07 0.5 = 0.005 23

(c) [3 pts] To decouple this question, assume that you got the following weights for the two particles. Particle Weight (X () 7 = 2, X (2) 7 = 2) 0.09 (X () 7 = 4, X (2) 7 = ) 0.0 What is the belief for the location of car and car 2 at t = 7? Location P (X () 7 ) P (X(2) 7 ) X (i) 7 = 0 0.09+0.0 = 0 0.0 0.09+0.0 = 0. X (i) 7 = 2 0.09 0.09+0.0 = 0.9 0.09 0.09+0.0 = 0.9 X (i) 7 = 4 0.0 0.09+0.0 = 0. 0 0.09+0.0 = 0 24

Q9. [7 pts] Naive ayes MLE onsider a naive ayes classifier with two features, shown below. We have prior information that the probability model can be parameterized by λ and p, as shown below: Note that P (X = 0 Y = 0) = P (X = Y = ) = p and P (X Y ) = P (X 2 Y ) (they share the parameter p). all this model M. Y X X 2 We have a training set that contains all of the following: ˆ n 000 examples with X = 0, X 2 = 0, Y = 0 ˆ n 00 examples with X = 0, X 2 =, Y = 0 ˆ n 00 examples with X =, X 2 = 0, Y = 0 ˆ n 0 examples with X =, X 2 =, Y = 0 Y P (Y ) 0 λ - λ X Y P (X Y ) 0 0 p 0 p 0 p p X 2 Y P (X 2 Y ) 0 0 p 0 p 0 p p ˆ n 00 examples with X = 0, X 2 = 0, Y = ˆ n 0 examples with X = 0, X 2 =, Y = ˆ n 0 examples with X =, X 2 = 0, Y = ˆ n examples with X =, X 2 =, Y = (a) [2 pts] Solve for the maximum likelihood estimate (MLE) of the parameter p with respect to n 000, n 00, n 00, n 0, n 00, n 0, n 0, and n. p = 2n 000+n 00+n 0+n 00+n 0+2n 2(n 000+n 00+n 00+n 0+n 00+n 0+n 0+n ) We first write down the likelihood of the training data, T = (Y, X, X ). L = P (Y = y i, X = x i, X 2 = x 2i p, λ) = = ( n000 ( n00 = (y i,x i,x 2i ) (y i,x i,x 2i ) P (Y = y i p, λ)p (X = x i p, λ)p (X 2 = x 2i p, λ) = ) ( n00 ) ( n00 ) ( n0 ) λpp ( λ)( p)( p) λp( p) ( λ)( p)p ) ( n0 ) ( n0 ) ( n ) λ( p)p ( λ)p( p) λ( p)( p) ( λ)pp = = (λ n000+n00+n00+n0 )(( λ) n00+n0+n0+n )(p n000+n00+n0+n )(p n000+n0+n00+n ) (( p) n00+n0+n00+n0 )(( p) n00+n00+n0+n0 ) = = (λ n000+n00+n00+n0 )(( λ) n00+n0+n0+n ) (p 2n000+n00+n0+n00+n0+2n )(( p) 2n00+n00+n0+n00+n0+2n0 ) We then take the logarithm of the likelihood. log(l) = (n 000 + n 00 + n 00 + n 0 ) log(λ) + (n 00 + n 0 + n 0 + n ) log( λ)+ +(2n 000 + n 00 + n 0 + n 00 + n 0 + 2n ) log(p) + (2n 00 + n 00 + n 0 + n 00 + n 0 + 2n 0 ) log( p) 25

We want to take the partial derivative with respect to p and solve for when it is 0 to find the MLE estimate of p. When we do this, the first two terms only depend on λ and not p, so their partial derivative is 0. 0 = p (log(l)) = (2n 000 +n 00 +n 0 +n 00 +n 0 +2n ) p (2n 00 +n 00 +n 0 +n 00 +n 0 +2n 0 ) p Multiplying both sides by (p)( p), we have: 0 = (2n 000 + n 00 + n 0 + n 00 + n 0 + 2n )( p) (2n 00 + n 00 + n 0 + n 00 + n 0 + 2n 0 )p and simplifying: so (2n 000 + n 00 + n 0 + n 00 + n 0 + 2n ) = 2(n 000 + n 00 + n 00 + n 0 + n 00 + n 0 + n 0 + n )p p = 2n 000 + n 00 + n 0 + n 00 + n 0 + 2n 2(n 000 + n 00 + n 00 + n 0 + n 00 + n 0 + n 0 + n ) (b) [2 pts] For each of the following values of λ, p, X, and X 2, classify the value of Y. Hint: No detailed calculation should be necessary. λ p X X 2 Y 3/4 5/8 0 0 0 2/5 4/7 0 For the first case, P (Y = 0, X = 0, X 2 = 0) = λpp and P (Y =, X = 0, X 2 = 0) = ( λ)( p)( p). Since λ > ( λ) and p > ( p), we must have P (Y = 0, X = 0, X 2 = 0) > (Y =, X = 0, X 2 = 0). For the second case, we have P (Y = 0, X =, X 2 = 0) = λ( p)p and P (Y =, X =, X 2 = 0) = ( λ)p( p). Since both expressions have a p( p) term, the question is reduced to λ < ( λ) so P (Y =, X =, X 2 = 0) > P (Y = 0, X =, X 2 = 0). (c) [ pt] For the following value of λ, p, X, and X 2, classify the value of Y. Detailed calculation may be necessary. λ p X X 2 Y 3/5 3/7 0 0 3 3 7 = 27 P (Y = 0, X = 0, X 2 = 0) = λpp = 3 5 7 5 7 7 and P (Y =, X = 0, X 2 = 0) = ( λ)( p)( p) = 2 4 4 5 7 7 = 32 5 7 7. So 27 5 7 7 = P (Y = 0, X = 0, X 2 = 0) < P (Y =, X = 0, X 2 = 0) = 32 5 7 7. (d) [2 pts] Now let s consider a new model M2, which has the same ayes Net structure as M, but where we have a p value for P (X = 0 Y = 0) = P (X = Y = ) = p and a separate p 2 value for P (X 2 = 0 Y = 0) = P (X 2 = Y = ) = p 2, and we don t constrain p = p 2. Let L M be the likelihood of the training data under model M with the maximum likelihood parameters for M. Let L M2 be the likelihood of the training data under model M2 with the maximum likelihood parameters for M2. Which of the following properties are guaranteed to be true? L M L M2 L M L M2 Insufficient information, the above relationships rely on the particular training data. None of the above. M2 can represent all of the same probability distributions that M can, but also some more (when p p 2 ). So in general M2 allows for more fitting of the training data, which results in a higher likelihood. 26

Q0. [0 pts] Perceptron (a) [ pt] Suppose you have a binary perceptron in 2D with weight vector w = r [w, w 2 ] T. You are given w and w 2, and are given that r > 0, but otherwise not told what r is. ssume that ties are broken as positive. an you determine the perceptron s classification of a new example x with known feature vector f(x)? lways Sometimes Never (b) Now you are learning a multi-class perceptron between 4 classes. The weight vectors are currently [, 0] T, [0, ] T, [, 0] T, [0, ] T for the classes,,, and D. The next training example x has a label of and feature vector f(x). For the following questions, do not make any assumptions about tie-breaking. (Do not write down a solution that creates a tie.) (i) [ pt] Write down a feature vector in which no weight vectors will be updated. 0 f(x) = Not possible ny feature vector that points in the direction of w more than any other direction, such that w f(x) > w i f(x) for i. (ii) [ pt] Write down a feature vector in which only w will be updated by the perceptron. f(x) = Not possible (iii) [ pt] Write down a feature vector in which only w and w will be updated by the perceptron. 0 f(x) = Not possible ny feature vector that points in the direction of w more than any other direction, such that w f(x) > w i f(x) for i. (iv) [ pt] Write down a feature vector in which only w and w will be updated by the perceptron. f(x) = 0 Not possible ny feature vector that points in the direction of w more than any other direction, such that w f(x) > w i f(x) for i. The weight vectors are the same as before, but now there is a bias feature with value of for all x and the weight of this bias feature is 0, 2,, for classes,,, and D respectively. s before, the next training example x has a label of and a feature vector f(x). The always bias feature is the first entry in f(x). (v) [ pt] Write down a feature vector in which only w and w will be updated by the perceptron. f(x) = Not possible (vi) [ pt] Write down a feature vector in which only w and w will be updated by the perceptron. 0 f(x) = 0 Not possible ny feature vector that points in the direction of w more than any other direction, such that w f(x) > w i f(x) for i. 27

(c) Suppose your training data is linearly separable and you are classifying between label Y and label Z. The mistake bound ( k δ 2 ) is equal to 3, which is the maximum number of weight vector updates the perceptron might have to do before it is guaranteed to converge. There are 00 examples in your training set. ssume the perceptron cycles through the 00 examples in a fixed order. (i) [ pt] What is the maximum number of classifications the perceptron might make before it is guaranteed to have converged? 300 03 00 3 3 3 00 None of the options The perceptron will make at most 3 mistakes. When it converges, it will be correct for all of the training data. Therefore, in the worst case, it will have to pass through all 00 examples 3 times (with the last mistake being made on the last example in the 3rd pass) before converging. (Note that in this worst case, the algorithm might continue to classify 00 more examples beyond the 300 before knowing that it has converged.) (ii) [2 pts] [true or false] fter convergence, the learned perceptron will correctly classify all training examples. If the data is linearly separable (which it is because the margin is non-zero), perceptrons converge when all of the training examples are correctly classified. 28