Understanding Bayes' theorem