Why Probabilistic Programming? A Journey Through the Monty Hall Problem

Even brilliant minds can be led astray by probability puzzles. When presented with the Monty Hall Problem, renowned mathematician Paul Erdős initially rejected the correct solution – and he wasn’t alone. Thousands of readers, including PhDs in mathematics and statistics, wrote angry letters to Marilyn vos Savant when she published the correct solution in Parade magazine. Their passionate resistance reveals something fascinating about how humans reason about uncertainty.

To explore these ideas hands-on, we’ve created a Jupyter notebook that implements both traditional and probabilistic programming approaches to the Monty Hall Problem. The notebook includes code for simulating the game, modeling player behavior, and analyzing how people learn from experience.

The Puzzle That Reveals How We Think

The setup seems simple: You’re on a game show with three doors. Behind one door is a car; behind the others are goats. You pick a door, hoping to win the car. Then, the host, who knows what’s behind each door, opens one of the remaining doors to reveal a goat. Should you switch to the other unopened door?

The correct answer feels deeply counterintuitive – you should switch, as it doubles your chances of winning. Initially, you have a ⅓ chance of picking the right door. When the host reveals a goat, switching improves your chances to ⅔. Yet even after seeing mathematical proofs or computer simulations, many people remain convinced that switching makes no difference. As Steven Pinker explains, this reveals a fundamental mismatch between our intuitive reasoning and formal probability theory.

Why Do We Resist the Correct Solution?

Our resistance stems from several cognitive biases shaping our thoughts about probability. The first is the equiprobability bias – our tendency to assume outcomes are equally likely when faced with uncertainty. After the host reveals a goat, we see two remaining doors and instinctively conclude it must be a 50/50 chance. This powerful bias blinds us to the crucial information embedded in the host’s constrained choice.

The endowment effect adds another layer of resistance. Once we make our initial door choice, we unconsciously assign it a higher value simply because it’s “ours.” This psychological attachment makes us reluctant to switch doors, even when logic suggests we should.

This illustrates what cognitive scientists call “cognitive tunnels” – mental shortcuts that usually serve us well but lead us astray in probabilistic reasoning. Even mathematicians fall into these tunnels because they operate at a level deeper than formal mathematical knowledge, showing how our intuitive system often overrides our analytical capabilities.

From Simulation to Cognitive Modeling

Our implementation takes a structured approach to understanding the problem. We start with a clean, traditional simulation:

This traditional approach clearly demonstrates the mechanics of the game but doesn’t help us understand how people reason about it.

The Power of Probabilistic Programming

To understand human reasoning, we need tools that can model uncertainty explicitly. Probabilistic Programming Languages (PPLs) shine in this area. Unlike traditional programming, which gives precise instructions, PPLs let us express and reason about uncertainty directly.

Here’s how we model the game using Pyro, a PPL built on PyTorch:

The PPL implementation makes explicit what’s implicit in traditional code: the probabilistic relationships between choices and outcomes.

Modeling Learning and Cognition

Perhaps most fascinating is modeling how people learn during a repeated version of the problem. We’ve implemented two types of learners:

Understanding Different Player Types

Our cognitive model reveals three key aspects of how people think about the problem:

1. Host Awareness: How much they consider the host’s knowledge

2. Switch Bias: Their inherent tendency to switch doors

3. Rationality: How consistently they apply their strategy

We can analyze different player types:

This analysis reveals that “naive” players often have low host awareness but high rationality. They consistently apply a suboptimal strategy because they miss crucial information about the host’s role.

Beyond the Monty Hall Problem

The power of probabilistic programming extends far beyond solving probability puzzles. These tools help us understand how humans reason about uncertainty across many domains:

  • In medicine, modeling how doctors diagnose under uncertainty
  • In economics, understanding decision-making with incomplete information
  • In education, analyzing how students learn complex concepts
  • In AI development, creating systems that reason more like humans

By formally modeling cognitive processes, we can better understand and potentially improve how humans reason about uncertainty in everyday decisions and complex professional judgments.

Our journey through the Monty Hall problem shows how probabilistic programming can bridge the gap between mathematical analysis and cognitive modeling. It helps us understand not just what strategies work but also how people learn and reason about probability.

Find our notebook on github.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *