Bayesian Networks General inference on a general BN

Job ID: 36173525

Budget: $10 – $30 AUD

You are asked in this part to extend the variable elimination algorithm developed in part 2 to
include evidence. For example, assume that we are querying the BNB network presented in
Figure 2 and that we want to know the probability p(J = T rue|N = F alse, O = T rue). The BNs
considered in this section can be any directed acyclic graph (DAG) and the variables are not
restricted to be binary. In other words, a general BN with the only restriction that the variables
are discrete or categorical.
For this task, your system should:
• Read-in a network based on a given specification
• Read the query as user input as in part 1
• Read the evidence as user input (new part): a list of evidence variable names with their
truth values (T/F) after a colon separated by a space (E.g., ‘A:F B:T’)
• Calculate the output taking into consideration the evidence given
• Print the output without further information. Outputs should be formatted as numbers with
5 decimal places.
Note that Variable Elimination algorithm needs an elimination order. Your program needs
to decide a proper order automatically.