Assignment 2

Bayesian Networks

Max possible score:



Complete Given Task. The score will only be used if including it will improve your final score.


Task 1:

Max: [4308: 50 Points, 5360: 50 Points]


Earthquake_Burglary Net as discussed in Class

Figure 1: A Bayesian network establishing relations between events on the burglary-earthquake-alarm domain, together with complete specifications of all probability distributions.

For the Bayesian network of Figure 1, implement a program that computes and prints out the JPD value of any combination of events. If the executable is called bnet, here is a example invocation of the program

To print out the probability P(Burglary=true and Earthquake=false and Alarm=false and MaryCalls=false and JohnCalls=true

bnet Bt Ef Af Mf Jt

The implementation should not contain hardcoded values for all combinations of arguments. Instead, your code should use the tables shown on Figure 1 and the appropriate formulas to evaluate the probability of the specified event. It is OK to hardcode values from the tables on Figure 1 in your code, but it is not OK to hard code values for all possible command arguments. More specifically, for full credit, the code should include and use a Bayesian network class. The class should include a member function called computeProbability(b, e, a, j, m), where each argument is a boolean, specifying if the corresponding event (burglary, earthquake, alarm, john-calls, mary-calls) is true or false. This function should return the joint probability of the five events.


How to submit

For each part: Implementations in C, C++, Java, and Python will be accepted. Points will be taken off for failure to comply with this requirement.

Create a ZIPPED directory called <net-id>_proj2.zip (no other forms of compression accepted, contact the instructor or TA if you do not know how to produce .zip files). The zip file should contain: