Conditioning by throwing runs away
P(A | B) means: among the occasions when B happens, how often does A happen too? A simulation can do that literally. Run the experiment, throw away every run where B is false, and count A among the survivors.
From the slides: Probability and what happens when you learn something and Why should anyone care about chance?.
What to notice
- Conditioning shrinks the sample space: the struck-out runs in each log are the ones that could not have happened, given the information.
- The two pieces of news about the coins sound alike but keep different runs. “The first toss was heads” keeps two of the four outcomes; “at least one toss was heads” keeps three. That is why the answers are 1/2 and 1/3.
- In Bertrand's box, the gold–gold box is twice as likely as the gold–silver box to hand you a gold coin, so seeing gold is evidence for it: 2/3, not 1/2.