Docsity

2 Questions for Assignment 2 - Artificial Intelligence | CS 440, Assignments of Computer Science

Toggle sidebar
bg1
CS 440 - Introduction to Artificial Intelligence
Homework 2
Due Date: Thursday, Sept 14th, 12:30pm
For this homework, you will be using SamIam, a Bayesian networks modelling tool from
Adnan Darwiche’s automated reasoning group at UCLA:
http://reasoning.cs.ucla.edu/samiam/
Download this tool and play around with it (There are tutorials included) to get a feel for
how to use SamIam to design a Bayesian Network and do inference with it.
1. 1D Game of Life
Imagine a 5x1 row of cells as in figure 1. Each cell can be be either alive (grey) or dead
(white) at a particular time step. The value of a cell at a particular time step depends on
the values of its neighbours at the previous time step. This relationship can be modeled as
a noisy OR (Russell & Norvig, pg. 500) with inhibition factor 0.3, where alive is treated
as TRUE. At time step 0, each cell has a probability of 0.5 of being alive. Model the
distribution of the values of each cell over 3 time steps as a Bayesian Network in SamIam.
Then use it to do the following inference tasks:
(a) At time step 2, the state in figure 1 was observed. What was the most likely initial
state S? What is the probability of initial state Sgiven the evidence? You can give
a print-out from SamIam as a “proof” for any part of this question.
(b) Let Xt
ibe the value of the i’th cell at time step t. Use the Bayesian network you have
constructed to explain why P(Xt0
i|Xt0+t
i+d) = P(Xt0
i) if t+dis even.
2. Inference
(a) Use variable elimination to calculate P(Burglary |J ohnCal ls =true, Mary Cal ls =
false) for the network in Figure 14.2 (page 494) in the textbook (Show your compu-
tations). You can check the answer using SamIam. Count the number of arithmetic
operations performed and compare it with the number performed by the enumeration
algorithm.
(b) Suppose a network has the form of a chain: a sequence of Boolean variables X1,...,Xn
where P arents(Xi) = {Xi−1}for i= 2,...,n. What is the complexity of computing
P(X1|Xn=true) using enumeration? Using Variable elimination?
(c) Prove that the complexity of running variable elimination on a polytree network is
linear in the size of the tree for any variable ordering consistent with the network
structure.
Figure 1: A one-dimensional game of life
1

Partial preview of the text

Download 2 Questions for Assignment 2 - Artificial Intelligence | CS 440 and more Assignments Computer Science in PDF only on Docsity!

CS 440 - Introduction to Artificial Intelligence

Homework 2

Due Date: Thursday, Sept 14th, 12:30pm

For this homework, you will be using SamIam, a Bayesian networks modelling tool from Adnan Darwiche’s automated reasoning group at UCLA: http://reasoning.cs.ucla.edu/samiam/ Download this tool and play around with it (There are tutorials included) to get a feel for how to use SamIam to design a Bayesian Network and do inference with it.

  1. 1D Game of Life Imagine a 5x1 row of cells as in figure 1. Each cell can be be either alive (grey) or dead (white) at a particular time step. The value of a cell at a particular time step depends on the values of its neighbours at the previous time step. This relationship can be modeled as a noisy OR (Russell & Norvig, pg. 500) with inhibition factor 0.3, where alive is treated as TRUE. At time step 0, each cell has a probability of 0.5 of being alive. Model the distribution of the values of each cell over 3 time steps as a Bayesian Network in SamIam. Then use it to do the following inference tasks:

(a) At time step 2, the state in figure 1 was observed. What was the most likely initial state S? What is the probability of initial state S given the evidence? You can give a print-out from SamIam as a “proof” for any part of this question. (b) Let Xit be the value of the i’th cell at time step t. Use the Bayesian network you have constructed to explain why P (X it 0 |Xit+^0 +d t) = P (X it 0 ) if t + d is even.

  1. Inference

(a) Use variable elimination to calculate P (Burglary|JohnCalls = true, M aryCalls = f alse) for the network in Figure 14.2 (page 494) in the textbook (Show your compu- tations). You can check the answer using SamIam. Count the number of arithmetic operations performed and compare it with the number performed by the enumeration algorithm. (b) Suppose a network has the form of a chain: a sequence of Boolean variables X 1 ,... , Xn where P arents(Xi) = {Xi− 1 } for i = 2,... , n. What is the complexity of computing P (X 1 |Xn = true) using enumeration? Using Variable elimination? (c) Prove that the complexity of running variable elimination on a polytree network is linear in the size of the tree for any variable ordering consistent with the network structure.

Figure 1: A one-dimensional game of life