Conditional Probability and Bayes

Procedure

This interactive simulation demonstrates Bayes' Theorem and conditional probability through dynamic probability tree diagrams. The experiment presents real-world scenarios where students must calculate conditional probabilities using visual tree representations.

Step 1: Understanding the Interface

Upon opening the simulation, you will encounter three main sections:

  1. Probability Tree Visualization (left panel): Displays an interactive tree diagram showing the hierarchical structure of conditional probabilities
  2. Controls Section (right panel): Contains the question prompt, answer input field, and navigation buttons
  3. Theory Section (bottom): Provides reference cards explaining key concepts

Step 2: Examining the Scenario

The simulation randomly generates one of three scenarios:

  • Medical Test: Calculating the probability of having a disease given a positive test result
  • Email Spam: Determining the likelihood that an email is spam given it contains certain keywords
  • Weather Prediction: Estimating rain probability based on morning cloud conditions

Each scenario displays:

  • The scenario title with a descriptive icon
  • A probability tree diagram with four main components:
    • Root node representing the entire population
    • First level branches showing the base rates (prior probabilities)
    • Second level branches showing the conditional probabilities
    • Leaf nodes displaying the joint probabilities as percentages

Step 3: Interpreting the Probability Tree

The tree structure follows this pattern:

  • Root Node: "Population" represents the entire sample space
  • Level 1 Nodes: Show the event occurrence (e.g., "Has Disease" vs "No Disease") with their respective base rates
  • Level 2 Nodes: Display the test results (e.g., "Tests Positive" vs "Tests Negative") given each condition
  • Leaf Nodes: Present the final joint probabilities calculated by multiplying along each branch path

Each branch is labeled with its conditional probability, and the leaf nodes show the resulting joint probabilities as percentages. The sum of all leaf node probabilities equals 100%.

Step 4: Interactive Tree Exploration

Click on any leaf node to:

  • Highlight the selected path in yellow
  • View detailed information about that particular probability path
  • See the mathematical formula representing that joint probability
  • Understand the relationship between conditional and joint probabilities

This interaction helps visualize how joint probabilities are calculated by multiplying conditional probabilities along tree branches.

Step 5: Answering Questions

The simulation poses Bayes' Theorem questions in two formats:

  1. Forward Conditional Probability: "What's the probability of having [event] given [test result]?"
  2. Complement Conditional Probability: "What's the probability of not having [event] given [test result]?"

To answer:

  1. Read the question carefully in the blue question box
  2. Analyze the probability tree to identify relevant paths
  3. Enter your answer in the input field as either:
    • A decimal (e.g., 0.25)
    • A percentage (e.g., 25%)
  4. Click "Submit Answer" or press Enter

Step 6: Receiving Feedback

After submitting an answer:

  • Correct Answer: Green feedback box appears with congratulations and the streak counter increases
  • Incorrect Answer: Red feedback box displays the correct answer with explanation
  • The feedback includes the proper mathematical reasoning

Step 7: Viewing Solutions

Click "Show Solution" to access a detailed step-by-step breakdown:

  1. Problem Statement: Restates the question clearly
  2. Formula: Shows the relevant Bayes' Theorem formula
  3. Substitution: Demonstrates how to substitute values into the formula
  4. Calculation: Provides detailed computational steps including:
    • Marginal probability calculation (denominator)
    • Joint probability calculation (numerator)
    • Final Bayes' Theorem application
  5. Final Answer: Presents the solution with proper formatting

The solution modal can be toggled on and off, allowing students to check their understanding at any point.

Step 8: Generating New Scenarios

Click "New Scenario" to:

  • Generate a fresh scenario with different base rates and conditional probabilities
  • Reset the streak counter and clear previous feedback
  • Present a new question type within the same scenario framework

This allows for repeated practice with varying numerical values and contexts.