CS 151: Artificial Intelligence
Homework 4
Due date: 10/29/13 by 11:59 pm
|
Written questions [25 points]
Your answers to the following questions should be typed
and submitted as a pdf (e.g. you can type your answers using Word and
print to pdf, or use LaTeX, or write your answers by hand
and then scan your paper).
- [5 points] AIMA 13.8
- [5 points] AIMA 13.15
- [5 points] AIMA 14.4a
- [10 points] Consider the WetGrass Bayesian network shown in
Figure 14.12a in AIMA. Assume we observe
WetGrass=false.
- Compute the exact posterior probabilities
p(Cloudy|WetGrass=false), p(Sprinkler|WetGrass=false), and
p(Rain|WetGrass=false).
- Show how to generate a sample using direct
sampling.
- Generate 10 samples using direct sampling. 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. To generate a random double between [0,1] in
Python use the commands: "import random" and "random.uniform(0,1)"
|
Programming project [75 points]
In this programming project, you will hunt ghosts! At one
point in time, pacmen did not run from ghosts. Ghosts ran from
pacmen. In this assignment, you will use the exact and
approximate inference algorithms we learned about (for both
Bayesian networks and Dynamic Bayesian networks) to locate
ghosts. These are challenging lab assignments so make sure
you're starting early enough to complete
the assignment on time
- You may work in pairs for this assignment! If
you choose to work with someone else, submit only one
directory. Put both of your names at the top of the
bustersAgents.py and inference.py files. You can also put both
of your written assignment pdfs inside this directory.
- So that we're all working with the same version of the
code, download the zipped directory here. If you're ready, click here
to begin.
- Just in case the Berkeley website goes down, a copy of
the assignment can be found here
|
Ungraded optional problems (Solutions to these problems
are already posted)
- A probability distribution over some set of random
variables (X1,...,XN) assigns a real-valued number to each
possible assignment of the random variables. These real-valued
numbers are called "probabilities". What are the constraints
to have a valid probability distribution?
- How many probabilities must you specify for the joint
distribution of n binary random variables? For the joint
distribution of n random variables with domain size d?
- Mathematically define: marginalization,
conditional distribution, product rule, chain rule, Bayes'
rule.
- Derive Bayes' rule using the definition of the conditional
distribution and the product rule
- Explain (in a mathematically precise way) what is meant
by the statement: "The conditional
distribution and the joint distribution are proportional"
- AIMA 13.12
- AIMA 13.17 (Note there is a typo: B should be Y)
- AIMA 13.22 - Naive Bayes model
- Define "Bayesian network". Why are Bayesian networks
useful?
- 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. Determine whether or
not each of the following independencies holds:
- X is independent of W given Y
- X is independent of W given Z
- X is independent of W given {Y, Z}
- Y is independent of Z given {X, W}
Assume X, Y, Z, and W are binary random variables. How many probabilities must be specified
for the conditional distributions of the Bayesian network?
|
Submission Instructions
You'll be turning in the "tracking" directory which should
contain your modified bustersAgents.py file and inference.py
file. Add the pdf of your answers to the written questions
to the "tracking" directory. Give the pdf an intuitive name,
e.g. "hw4_written_questions.pdf". Zip (compress) the
"tracking" directory and upload it using this
URL.
|