The file diseaseNet.mat contains the potentials for a disease bi-partite belief network, with 20 diseases d1, …, d20 and 40 symptoms, s1, …, s40. The disease variables are numbered from 1 to 20 and the Symptoms from 21 to 60. Each disease and symptom is a binary variable, and each symptom connects to 3 parent diseases.

1. Using the BRMLtoolbox, construct a junction tree for this distribution and use it to compute all the marginals of the symptoms, p(si = 1).

2. Explain how to compute the marginals p(si = 1) in a more efficient way than using the junction tree formalism. By implementing this method, compare it with the results from the junction tree algorithm.

3. Symptoms 1 to 5 are present (state 1), symptoms 6 to 10 not present (state 2) and the rest are not known. Compute the marginal p(di = 1|s1:10) for all diseases.