Artificial Intelligence Homework 4
Due: Wednesday 3/8 in class



This assignment will be collected at the beginning of Wednesday's class. Please bring a hard copy to turn in. Your assignments can be hand-written or typed.

  1. AIMA 13.8 (Note: Uppercase words are random variables, lowercase words are values)

  2. AIMA 13.15

  3. AIMA 14.4a (Note: "numerical semantics" means to use the mathematical definition of independence whereas "topological semantics" means to use the d-separation algorithm)

  4. Suppose that the joint probability distribution of four variables {X, Y, Z, W} can be factorized as: p(x,y,z,w) = p(x)p(y|x)p(z|x)p(w|y,z). Draw the Bayesian network that corresponds to this factoring of the joint distribution. Use d-separation to determine whether or not each of the following independencies holds:
    1. X is independent of W given Y
    2. X is independent of W given Z
    3. X is independent of W given {Y, Z}
    4. Y is independent of Z given {X, W}
    5. Assume X, Y, Z, and W are binary random variables. How many probabilities must be specified for the conditional distributions of the Bayesian network?

  5. Consider the WetGrass Bayesian network shown in Figure 14.12a in AIMA. Assume we observe WetGrass=false.
    1. Compute the exact posterior probabilities p(Cloudy|WetGrass=false), p(Sprinkler|WetGrass=false), and p(Rain|WetGrass=false).
    2. Show how to generate a sample using rejection sampling. (In other words, illustrate the different steps required)
    3. Generate 10 samples using rejection sampling. Please show the 10 samples you generated. How many samples do you get where WetGrass=false and how many do you have to reject? Estimate posterior probabilities for Cloudy, Sprinkler, and Rain based on those 10 samples.
    4. Show how to generate a sample using likelihood weighting
    5. Generate 10 samples using likelihood weighting. Show the weights for each sample. Estimate posterior probabilities for Cloudy, Sprinkler, and Rain based on those 10 samples.

    Note: To generate a random double between [0,1] you can either use Java (java.lang.Math or java.util.Random) or you can find an online random number generator.


Last modified: Sun Feb 23 16:21:45 PST 2014