Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 771 Bytes

montyHall.md

File metadata and controls

23 lines (17 loc) · 771 Bytes

The Monty Hall problem

The Monty Hall problem is a popular thought experiment that exemplifies (in my view) the "strangeness" of statistics and conditional probability.

After reading Steven Pinker's recent book, Rationality, I finally understand why the probability of winning if you swap is 2/3, not 1/2.

The code itself demonstrates how it became clear to me.

If you run the code, you will see a result like this:

// Swapping will win ~66% of the time.
{
  numWinsByStrategyConcise: { stay: 332538, swap: 667462 },
  numWinsByStrategyVerbose: { stay: 334535, swap: 665465 }
}

Thinking on paper