liveBook · Manning

Odds

As explained in Statistics Every Programmer Needs

Odds express the ratio of the probability of an event to the probability of its complement.

Odds express an event through successes relative to failures, while probability expresses successes relative to all possible outcomes. They are related but not interchangeable. section 2.1.2

Use these equivalent forms to move between probability and odds:

  • Odds = successful outcomes / failed outcomes. section 2.1.2
  • Odds = probability of success / probability of failure, where the two probabilities sum to 1. section 2.1.2
  • Probability can be recovered from odds by dividing the odds by one plus the odds. section 2.1.2
  • For a six-sided die, rolling a 4 has probability 1/6 and odds 1/5, or 0.2. section 3.2

Two-dice outcome

The probability that one die shows 1, 2, or 3 and the other shows 4, 5, or 6 is 9/36, or 25%. Its failure probability is 75%, so the odds are 0.25/0.75, or 0.33. section 3.2.3

>>> probability_double_sixes = 1 / 36
>>> probability_double_sixes_percent = probability_double_sixes * 100
>>> print(f'The probability of success equals: '
>>>       f'{probability_double_sixes_percent}%')
The probability of success equals: 2.7777777777777777%

>>> probability_face_card = 12 / 52
>>> probability_face_card_percent = probability_face_card * 100
>>> print(f'The probability of success equals: '
>>>       f'{probability_face_card_percent}%')
The probability of success equals: 23.076923076923077%

Compare probability calculations for a coin flip, double sixes, and a face card before converting selected results into odds. section 2.1.2

How Statistics Every Programmer Needs covers it

How deep it goes
Defines odds, supplies equivalent formulas, converts between odds and probability, and applies the distinction to dice and cards.
Examples
Uses coin flips, face cards, single-die outcomes, and two-dice events involving specified results and sums.
What it assumes
Assumes basic counting and event probabilities while reinforcing success, failure, and total-outcome ratios.
What you can do after
Apply probability formulas to convert between event probability and odds and solve elementary dice and card calculations.
How it connects
Connects probability with complementary events, multiplication rule, and addition rule.

Also explained in

Compare how 3 books explain odds →

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.