liveBook · Manning

Sample space

As explained in Statistics Every Programmer Needs

A sample space is the set of all possible outcomes of a random experiment or situation.

A sample space is the set of all possible outcomes or events in a random experiment or situation. Conditional information narrows this set, changing the denominator used to calculate probability and often changing the resulting decision. section 3.3 section 3.4

Use a restricted sample space to interpret probability after new information becomes available:

  • Weather: narrow all weather conditions to cloudy and rainy conditions after observing dark clouds or nearby rain. section 3.3.1
  • Medical testing: restrict the population to people with positive test results before assessing disease probability. section 3.3.1
  • Traffic, sports, and investment decisions: condition on an accident, an injured player, or recent market information. section 3.3.1

Contingency-table calculation

A table records symptoms and test results. Among the 50 people with symptoms, 40 test positive, giving 40/(40+10) = 80%. Among the 130 people with positive tests, 40 have symptoms, giving 40/(90+40) ≈ 30.77%. The numerator stays the same while the selected sample space changes. section 3.3.3

How Statistics Every Programmer Needs covers it

How deep it goes
Defines the outcome set and illustrates denominator changes with scenarios and a contingency table, without developing formal probability theory.
Examples
Uses weather, medical testing, traffic, basketball, financial investment, and symptom-test contingency-table examples.
What you can do after
Apply conditional probability by selecting an appropriate restricted denominator and calculating it from a pandas contingency table.
How it connects
Connects sample spaces to conditional probability, events, contingency tables, risk assessment, and decision-making.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Every Programmer Needs. The section links point to the parts of the book it draws on.