Learning Bayes' theorem by examples