Sale!

SOLVED: CSCI 5512 Homework 1

Original price was: $35.00.Current price is: $30.00.

Download Details:

  • Name: Assignment-1-pn0ihx.zip
  • Type: zip
  • Size: 260.31 KB

Category:

Description

5/5 - (9 votes)

Artificial Intelligence II
1. (5 points) Consider a 3-valued random variable X such that P(X = 1) = 0.4, P(X = 0) =
0.4, and P(X = −1) = 0.2. Assume you have access to a program A that generates a number
in [0, 1] uniformly at random. Describe how you can use A to draw random samples of X.
2. (5 points) An urn has 3 red balls, 4 blue balls, and 5 green balls. Alice draws a ball from
the urn, and then Bob draws a ball. What is the probability that Bob drew a green ball?
3. (15 points) Consider the Car-Starting network in Figure 1 and let B = Battery, F = Fuel,
G = Gauge, T = Turn Over, and S = Start. The conditional probabilities are then given by:
P(B = bad) = 0.02 P(F = empty) = 0.05
P(G = empty |B = good; F = not empty) = 0.04 P(G = empty |B = good; F = empty) = 0.97
P(G = empty |B = bad; F = not empty) = 0.10 P(G = empty |B = bad; F = empty) = 0.99
P(T = false|B = good) = 0.03 P(T = false|B = bad) = 0.98
P(S = false|T = true; F = not empty) = 0.01 P(S = false|T = true; F = empty) = 0.92
P(S = false|T = false; F = not empty) = 1.00 P(S = false|T = false; F = empty) = 0.99
Figure 1: The Car-Starting network.
Calculate P(F = empty |S = false), the probability of the fuel tank being empty conditioned
on the observation that the car does not start.
4. (35 points) In your local nuclear power station, there is an alarm that senses when a temperature gauge exceeds a give threshold. The gauge measures the temperature of the core.
Consider the Boolean variables A (alarm sounds), FA (alarm is faulty), and FG (gauge is
faulty), and the multivalued nodes G (gauge reading) and T (actual core temperature).
1 CSCI 5512
(a) (11 points) Draw a Bayesian network for this domain, given that the gauge is more likely
to fail when the core temperature gets too high.
(b) (8 points) Suppose there are just two possible actual and measured temperatures, normal
and high; the probability that the gauge gives the correct temperature is x when it is
working, but y when it is faulty. Give the conditional probability table associated with
G.
(c) (8 points) Suppose the alarm works correctly unless it is faulty, in which case it never
sounds. Give the conditional probability table associated with A.
(d) (8 points) Suppose the alarm and gauge are working and the alarm sounds. Calculate
an expression for the probability that the temperature of the core is too high, in terms
of the various conditional probabilities in the network.
5. (40 points) [Programming Assignment] Consider the rain network in Figure 2. Assume that
Sprinkler = true and W etGrass = true. For simplicity, we denote these two events by s
and w respectively. Further, let r denote the event Rain = true.
Cloudy
Sprinkler Rain
Wet
Grass
C
T
F
.80
.20
C P(R|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 2: The Rain Network
(a) (15 points) A Gibbs sampler for the problem will need the following conditional probabilities: 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 complements: 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 2 and using the formula for conditional probability of a
variable given its Markov blanket, compute the numeric values of the above conditional
probabilities.
(b) (25 points) Using the above conditional probabilities, estimate P(r|s, w) using Gibbs
sampling for 100 and 10,000 steps.
In addition to the numeric estimates, you have to submit code for GibbsRain implementing
Gibbs sampling for the rain network. The code should take one input argument: numSteps,
2 CSCI 5512
the number of steps, and output an estimate of P(r|s, w). The output should be clearly
displayed on screen after running the program.
Sample input for Python 3.6 for part b when the number of steps is 100:
$python GibbsRain.py 100
Instructions
Please follow these instructions carefully. Code submitted without adhering to these instructions
will not receive any credit.
For each programming assignment, you have to submit the code as required by the problem and
the algorithm must be implemented using a main file as named in the problem (e.g., GibbsRain.py).
Only Python 3.6 will be accepted, any other language will receive zero credit. The program must
run on the CSE labs machines and will not receive credit if it fails this.
3 CSCI 5512