# Calculations in a Bayes Network

I am working through a text book (Probabilistic Graphical Models, Principles and Techniques) to learn BNs, but I am confused as to the accuracy of the example. The text references the figure above. We are told that;

P(l^1) ~ 0.502


Using the tilde instead of equals sign when numbers are given is the source of confusion. If I average the l^1 column, I get 0.5033, which should not by any means round down to 0.502. So, is the answer really 0.503 or am I over simplifying the solution?

Next, the text explains that P(l^1 | i^0) ~ 0.389. Though, I am far from getting anything close to that value given the numbers inthe image. Could someone show me the correct calculations to get 0.389?

I am trying to realize whether I am especially challenged in statistics, or if the text is not explained in the best manner for me to learn.

Just to be complete, here is the example copied from the text;

• Which textbook are you using? It might help to have a reference. Jul 10, 2019 at 19:29

You should not be computing $$P(l^1)$$ by averaging the $$l^1$$ column. Instead, you should write the joint distribution over $$D$$, $$I$$, $$G$$, and $$L$$ as a product of CPD factors using the chain rule for Bayesian networks. Then you should marginalize out $$D$$, $$I$$, and $$G$$ by summing the joint distribution over all possible assignments to these random variables. The result will be the marginal distribution over $$L$$, i.e. two numbers specifying $$P(l^0)$$ and $$P(l^1)$$.
To compute the conditional probability $$P(l^1 | i^0)$$, set $$P(i^0) = 1$$ and ignore the rows in the grade distribution where $$I = i^1$$, then follow the same procedure as above.