A good introduction to Bayes' theorem: