This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSCI 5512: Artificial Intelligence II (Spring’10) Homework 2 (Due Mar 08 at 4pm) 1. (25 points) [Programming Assignment] Consider the rain network in Figure 1. Assume that Sprinkler = true and WetGrass = true . For simplicity, we denote these two events by s and w respectively. Further, let r denote the event Rain = true . Cloudy Rain Sprinkler Wet Grass C T F .80 .20 P(R|C) C T F .10 .50 P(S|C) S R T T T F F T F F .90 .90 .99 P(W|S,R) P(C) .50 .01 Figure 1: The Rain Network (a) (10 points) Estimate P ( r | s,w ) using rejection sampling based on 100 and 10,000 total samples (including rejections). (b) (10 points) Estimate P ( r | s,w ) using likelihood weighting based on 100 and 10,000 sam- ples. (c) (5 points) Which method seems to be making better use of the samples? Explain your answer. In addition to the numeric estimates, you have to submit code for rsRain and lwRain imple- menting the two sampling algorithms. The code for each algorithm should take one input argument: numSample , the number of samples, and output an estimate of P ( r | s,w ). For language specific and general coding instructions, please see detailed instructions at the end of the homework. Please follow these instructions carefully. Code submitted without adhering to these instructions will not receive any credit. 2. (25 points) [Programming Assignment] Consider the rain network in Figure 1. (a) (10 points) A Gibbs sampler for the problem will need the following conditional prob- abilities: P ( c | r,w,s ), P ( c |¬ r,w,s ), P ( r | c,w,s ), and P ( r |¬ c,w,s ), as well as their com- plements: P ( ¬ c | r,w,s ), P ( ¬ c |¬ r,w,s ), P ( ¬ r | c,w,s ), and P ( ¬ r |¬ c,w,s ). Using the numeric values given in Figure 1 and using the formula for conditional probability of a...
View Full Document
This note was uploaded on 10/21/2011 for the course CSCI 5512 taught by Professor Staff during the Spring '08 term at Minnesota.
- Spring '08