Bayesian Monte Carlo of Let's Make a Deal
This code illustrates Bayes' Theorem in action on the Monty Hall problem, which several authors have used to illustrate Bayes' Theorem. (It's easy to search the internet for further explanation.)
Run with the -audit switch to audit up to the first 100 games. Once the number of games gets into 10s of millions the audit option becomes noticeably slower. Running without audit is faster and can simulate a couple billion games.