week7
week7
Week 7
1) Problem 1: Markov Networks This problem will give you some practice on com-
puting probabilities given a Markov network. Specifically, given the Markov network
below, we will ask you questions about the probability distribution p(X1 , X2 , X3 ) over
the binary random variables X1 , X2 , and X3 .
1
(c) What is p(X2 = 0)?
2
2) Problem 2: Bayesian Networks Basics
(a) Given the tables above, draw a minimal representative Bayesian network of this
model. Be sure to label all nodes and the directionality of the edges.
(b) Compute the following probabilities: P (+d | + b), P (+d, +a), P (+d | + a).
(c) Which of the following conditional independences are guaranteed by the above
network?
□ X ⊥⊥ B | D □ D ⊥⊥ A | B
(X and B are cond. ind. given D)
□ D ⊥⊥ X | A
□ D ⊥⊥ A | X
3
3) Problem 3: Bayesian Networks Trivia
As the president of the National Trivia Association, you must choose between the
Bayesians and the Markovians, the nation’s top two rival trivia teams, to represent the
US at the World Trivia Olympics. To determine the more popular team, you decide
to model the change in monthly TV viewership using a Bayesian network.
Let Bt and Mt denote the number of TV viewers that the Bayesians and Markovians
have in month t respectively. You have no way of observing these quantities directly,
but you can observe two other quantities which they influence: let St denote the number
of times internet users searched for the Bayesians in month t, and let At denote the
attendance of the friendly match at a neighborhood pub between the Bayesians and
the Markovians in month t.
The viewerships of the two teams evolve according to the following model, where each
month a fan is either gained or lost with equal probability:
1 1
2
if Mt+1 = M t − 1 2 if Bt+1 = Bt − 1
Pr(Mt+1 |Mt ) = 12 if Mt+1 = Mt + 1 Pr(Bt+1 |Bt ) = 12 if Bt+1 = Bt + 1
0 otherwise 0 otherwise
The Bayesian fans like to rewatch their trivia shows by searching the recaps online!
We model the fan’s size’s influence on the number of internet searches by:
0.3 if St = Bt
0.25 if St = Bt − 1
0.2 if S = B − 2
t t
Pr(St |Bt ) =
0.15 if St = Bt − 3
0.1 if St = Bt − 4
0 otherwise
Lastly, because most TV viewers attend each monthly friendly matches (although
sometimes more, and sometimes fewer), we model the influence of the TV viewership
number on the friendly match attendance by:
0.14 if At = Bt + Mt
0.13 if |At − (Bt + Mt )| = 1
0.11 if |At − (Bt + Mt )| = 2
Pr(At |Bt , Mt ) = 0.09 if |At − (Bt + Mt )| = 3
0.06 if |At − (Bt + Mt )| = 4
0.04 if |At − (Bt + Mt )| = 5
0 otherwise
4
At At+1
Mt Mt+1
Bt Bt+1
St St+1
Figure 1: The changing TV viewership count modeled as a dynamic Bayesian network. The
unshaded nodes correspond to the latent/hidden TV viewership counts, and the shaded
nodes correspond to the observable emissions.
5
a. (10 points) Inference
Suppose the Bayesian’s trivia team captain took a nationwide poll in month t that
concluded they had exactly 75 TV viewers. Suppose additionally that in month t + 2,
the search engine reported 73 people search for the Bayesians online. What is the
probability that in month t + 2 the Bayesians have 77 TV viewers?
6
b. (4 points) Extra Practice - Gibbs Sampling
Inference is exhausting; you decide that you’d be satisfied with simply being able to
draw samples from distributions rather than specifying them exactly. In particular,
you want to sample joint assignments to the variables {Bt , Mt , At , St }Tt=1 for some time
horizon T . You decide to implement Gibbs sampling for this purpose, but something’s
not right! What additional information, beyond what we’ve given you, would allow
you to perform Gibbs sampling? Briefly explain.
7
c. (10 points) Particle Filtering
Throughout this problem, you are free to leave quantities in terms of unevaluated
expressions (i.e. you may write 0.75 · 0.5 instead of 0.375).
Computing all of those terms exactly seems tedious, so you instead decide to employ
particle filtering to quickly and painlessly provide you with approximate solutions.
You’re fine with a (very) crude approximation, so you only use two particles.
(i) [2 points] Suppose you begin with the two particles (B1 = 80, M1 = 75) and
(B1 = 82, M1 = 74). You then observe that S1 = 79 and A1 = 154. Compute the
weights that you should assign to the two particles based on this evidence.
(ii) [2 points] Using these weights, we now resample two new particles. Provide this
sampling distribution.
8
(iii) [3 points] Suppose both of our new particles are sampled to be (B1 = 80, M1 = 75).
We now extend these particles using our dynamics models. What is the probability
that a particular one of these two particles is extended to: