liveBook · Manning

Conditional probability

As explained in Build a Robo-Advisor with Python (From Scratch)

Conditional probability is the probability of an event given that another event or condition is known to occur.

Conditional probability measures how likely event A is when event B is known to occur. Unlike unconditional probability P(A), P(A|B) incorporates information about B. Bayes’ rule relates the two conditional probabilities: P(A|B) = P(B|A)P(A) / P(B). section 12.2

Height and professional basketball

For a randomly selected person, the probability of being over six feet tall is about 7%. Given that the person is a professional basketball player, it rises to about 99%. Reversing the condition, Bayes’ rule combines the basketball-player base rate, the 7% height rate, and the 99% conditional rate to estimate a 0.0000193 probability that someone over six feet plays professional basketball. section 12.2

Bayes’ rule uses these probability inputs:

  • P(A): the unconditional probability of the target event. section 12.2
  • P(B): the unconditional probability of the observed condition. section 12.2
  • P(B|A): the condition’s probability when the target event is known. section 12.2

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Defines conditional probability, states Bayes’ rule, and works through population-rate calculations.
Examples
Uses professional basketball, height, and United States population rates as a worked example.
What it assumes
Builds from events and unconditional probabilities while defining conditional probabilities directly.
What you can do after
Evaluate/understand conditional probabilities and calculate a reversed conditional probability with Bayes’ rule.
How it connects
Connects conditional probability with Bayes’ rule and unconditional probability.

Also explained in

Compare how 11 books explain conditional probability →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.