$25
1. R&N Problem 13.10:
Deciding to put probability theory to good use, we encounter a slot machine with three independent wheels, each producing one of the four symbols ๐ต๐ด๐
, ๐ต๐ธ๐ฟ๐ฟ, ๐ฟ๐ธ๐๐๐, or ๐ถ๐ป๐ธ๐
๐
๐ with equal probability. The slot machine has the following payout scheme for a bet of 1 coin (where “?” denotes that we don’t care what comes up for that wheel): ๐ต๐ด๐
/๐ต๐ด๐
/๐ต๐ด๐
pays 20 coins
๐ต๐ธ๐ฟ๐ฟ/๐ต๐ธ๐ฟ๐ฟ/๐ต๐ธ๐ฟ๐ฟ pays 15 coins
๐ฟ๐ธ๐๐๐/๐ฟ๐ธ๐๐๐/๐ฟ๐ธ๐๐๐ pays 5 coins
๐ถ๐ป๐ธ๐
๐
๐/๐ถ๐ป๐ธ๐
๐
๐/๐ถ๐ป๐ธ๐
๐
๐ pays 3 coins
๐ถ๐ป๐ธ๐
๐
๐/๐ถ๐ป๐ธ๐
๐
๐/? pays 2 coins
๐ถ๐ป๐ธ๐
๐
๐/?/? pays 1 coin
a. Compute the expected “payback” percentage of the machine. In other words, for each coin played, what is the expected coin return?
b. Compute the probability that playing the slot machine once will result in a win.
c. Estimate the mean and median number of plays you can expect to make until you go broke, if you start with 10 coins. You can run a simulation to estimate this, rather than trying to compute an exact answer.
2. R&N Problem 13.13:
Consider two medical tests, A and B, for a virus. Test A is 95% effective at recognizing the virus when it is present, but has a 10% false positive rate (indicating that the virus is present, when it is not). Test B is 90% effective at recognizing the virus, but has a 5% false positive rate. The two tests use independent methods of identifying the virus. The virus is carried by 1% of all people. Say that a person is tested for the virus using only one of the tests, and that test comes back positive for carrying the virus. Which test returning positive is more indicative of someone really carrying the virus? Justify your answer mathematically.
3. Car Diagnosis Bayes Net (Modified from R&N Problem 14.8): Consider the network for car diagnosis shown in Figure 14.21 (reproduced below).
a. Extend the network with Boolean variables IcyWeather and StarterMotor. Sketch the updated Bayesian network with eight nodes.
b. How many independent values are contained in the full joint probability distribution for eight Boolean nodes, assuming that no conditional independence relations are known to hold among them?
c. How many independent probability values do your Bayesian network tables contain?
d. What nodes (if any) are conditionally independent of Starts given Moves and Battery?
4. R&N Problem 14.11:
In your local nuclear power station, there is an alarm that senses when a temperature gauge exceeds a given threshold. The gauge measures the temperature of the core. Consider the Boolean variables A (alarm sounds), ๐น (alarm is faulty), and ๐น (gauge is faulty) and the multivalued nodes ๐บ (gauge reading) and ๐ (actual core temperature).
a. Draw a Bayesian network for this domain, given that the gauge is more likely to fail when the core temperature gets too high.
b. Is your network a polytree? Why or why not?
c. Suppose there are just two possible actual and measured temperatures, normal and high; the probability that the gauge gives the correct temperature is ๐ฅ when it is working, but ๐ฆ when it is faulty.
Give the conditional probability table associated with ๐บ.
d. Suppose the alarm works correctly unless it is faulty, in which case it never sounds. Give the conditional probability table associated with ๐ด.
e. 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 carious conditional probabilities in the network.
5. Simple Bayes Computations: Consider the Bayesian network drawn below. (10 points)
Show your work for the following calculations.
a. Compute P(A = true and B = false and C = false and D = true).
b. Compute P(D = true | A = false and B = true and C = true).
c. Compute P(A = false | B = false and C = true and D = false).
d. Compute P(B = true | A = true and C = false).
e. Compute P(B = false).
6. Exam Bayes Net (15 points): Consider a problem in which a professor wants to determine whether a student has understood material based on an exam score. The below figure illustrates a possible Bayes net that can help answer this question, along with symbol definitions. Associated probabilities are listed below as well.
Intelligent = I, Hard working = H, Doesn’t panic = DP, High Exam Score = Ex,
Knows material = KM, Gains practical skill = PS, Success! =S
Probability data:
P(I) = 0.75; P(H) = 0.6; P(DP)=0.4; P(PS)=0.8
P(KM|I,H)=1.0; P(KM|I,~H)=0.4; P(KM|~I,H)=0.6; P(KM|~I,~H)=0.05
P(S|PS,Ex)=0.8, P(S|~PS,Ex)=0.7, P(S|PS,~Ex)=0.7, P(S|~PS,~Ex)=0.3
P(Ex|DP,KM)=0.85; P(Ex|~DP,KM)=0.7; P(Ex|DP,~KM)=0.2; P(Ex|~DP,~KM)=0.1
a. Given a high exam score (Ex), which variables are conditionally independent of intelligent (I)?
b. Given knows material (KM) as evidence, which node(s) are conditionally independent of success (S)?
c. Given success (S), which node(s) are conditionally independent of high exam score (Ex)?
d. Given no evidence, compute P(KM).
e. Compute P(S | KM), the probability of Success given Knows Material.
f. Compute P(PS | S), the probability of gaining Practical Skill given exam Success.
g. Compute P(KM | S), the probability of Knows Material given exam Success.
7. Bayes Net Exact Inference -- Coding (35 points)
Implement the ENUMERATION-ASK(X, E, BN)function shown in R&N Figure 14.9, reproduced on
the next page, within a program or script that manages a single test case and prints the result to the screen. To simplify code for this problem, assume all nodes are labeled by single characters as in Problem 5 above, and assume all variables have Boolean values T (True), F (False). The Bayes Net (BN) will be defined by file bn.txt. The specific test case query will be defined in file input.txt. Output Q(X) for X=T should be printed to the screen. Examples of each formatted input file are provided below for the Problem 5 Bayes Net. The grader will use one easy Bayes Net and one larger Bayes Net. We will only test polytree cases that run successfully given a correct implementation.
Example bn.txt file:
% Random Variables
A, B, C, D
% Graph Edges (From, To)
A, B
B, D
C, D
% Probability values
P(A=T)=0.4
P(C=T)=0.7
P(B=T|A=F)=0.9
P(B=T|A=T)=0.3
P(D=T|B=F,C=F)=0.8
P(D=T|B=F,C=T)=0.3
P(D=T|B=T,C=F)=0.5
P(D=T|B=T,C=T)=0.1
An example input.txt file for P(D|A=T,C=F):
% Query random variable (print the probability X=T)
D
% Evidence vector (insert blank line when no evidence is given)
A=T, C=F
% End of input