This code implements the Variable ELimination algorithm to do Inference in the following Bayes Net.

Bayes Net.