This is one of the programming assignments I did in the Introduction to Artificial Intelligence course (CS4365). It implements two algorithms for performing exact inference given a Bayesian network, namely variable enumeration and variable elimination. These exact inference algorithms produce, well, exact probability distribution over the query variable given the observed evidences, as compared to the method of sampling which gives an approximate result.