Skip to content
QuantMax
QuantMax
  • Overview
  • Curriculum
    • FLUMental maths and numerical fluency
    • COMBCounting and combinatorics
    • PROBProbability
      • 1Conditioning and Bayes

        • Conditional probability and Bayes
      • 2Distributions

        • The distributions you have to know cold
      • 3Expectation, variance and the big tricks

        • Linearity of expectation
        • Conditioning: the tower property
        • Recursive expected value and the re-roll family
      • 4Random walks and Markov chains

        • Random walks and gambler’s ruin
        • Markov chains: states, transitions and hitting times
      • 5Order statistics and extremes

        • Order statistics: maxima, minima and the gaps between
      • 6Simulation and Monte Carlo

        • Simulation: making randomness you want out of randomness you have
    • GAMEGames, decision theory and puzzles
    • MMMarket making
    • MKTMarkets and products

Practise

  • Question bank
  • Mental arithmetic
  • Market simulator
  • Arbitrage trees
  • Horse racing
  • Bid book
  • Screening tests
  • Mock papers

Reference

  • Formula reference
  • Search

Your record

  • Review queue
  • Progress
  • Leaderboard
  • Profile
  • Invite friends
AccountSend feedback
  1. Curriculum
  2. /Trading and market making
  3. /Probability
  4. /Conditioning and Bayes

Conditional probability and Bayes

PROB · Chapter 1·12 min read·Asked at Jane Street, SIG, Optiver, Citadel

After this lesson you should be able to

  • Apply Bayes’ theorem without memorising it, by writing the joint probability two ways.
  • Explain why a reliable test for a rare condition still produces mostly false positives.
  • Spot the questions that are really about conditioning on the right event.

Bayes is not a formula to recall — it is what you get by writing the probability of two things happening in the two orders available and setting them equal. Every classic trap in this area comes from ignoring the base rate, and every fix comes from counting the cases.

Equation 1.1

Conditional probability

The fraction of the world in which BBB happens that also has AAA in it. Everything else follows from this one definition.

Pr⁡(A∣B)=Pr⁡(A∩B)Pr⁡(B)\Pr(A \mid B) = \frac{\Pr(A \cap B)}{\Pr(B)}Pr(A∣B)=Pr(B)Pr(A∩B)​
Pr⁡(A∩B)\Pr(A \cap B)Pr(A∩B)
Both happen.
Pr⁡(B)\Pr(B)Pr(B)
The event you are conditioning on; it must have positive probability.

Derivation 1.2

Bayes in two lines

The intersection is symmetric, so expand it both ways and rearrange.

  1. Pr⁡(A∣B)Pr⁡(B)=Pr⁡(A∩B)=Pr⁡(B∣A)Pr⁡(A)\Pr(A \mid B)\Pr(B) = \Pr(A \cap B) = \Pr(B \mid A)\Pr(A)Pr(A∣B)Pr(B)=Pr(A∩B)=Pr(B∣A)Pr(A)
  2. Pr⁡(A∣B)=Pr⁡(B∣A)Pr⁡(A)Pr⁡(B)\Pr(A \mid B) = \frac{\Pr(B \mid A)\Pr(A)}{\Pr(B)}Pr(A∣B)=Pr(B)Pr(B∣A)Pr(A)​
  3. Pr⁡(B)=Pr⁡(B∣A)Pr⁡(A)+Pr⁡(B∣Ac)Pr⁡(Ac)\Pr(B) = \Pr(B \mid A)\Pr(A) + \Pr(B \mid A^{c})\Pr(A^{c})Pr(B)=Pr(B∣A)Pr(A)+Pr(B∣Ac)Pr(Ac)

    The law of total probability, which is almost always how you get the denominator.

Pr⁡(A∣B)=Pr⁡(B∣A)Pr⁡(A)Pr⁡(B∣A)Pr⁡(A)+Pr⁡(B∣Ac)Pr⁡(Ac)\Pr(A \mid B) = \frac{\Pr(B \mid A)\Pr(A)}{\Pr(B \mid A)\Pr(A) + \Pr(B \mid A^{c})\Pr(A^{c})}Pr(A∣B)=Pr(B∣A)Pr(A)+Pr(B∣Ac)Pr(Ac)Pr(B∣A)Pr(A)​
TermNameUsually the easy part?
Pr⁡(A)\Pr(A)Pr(A)PriorYes — the base rate
Pr⁡(B∣A)\Pr(B \mid A)Pr(B∣A)LikelihoodYes — the stated accuracy
Pr⁡(B)\Pr(B)Pr(B)EvidenceNo — build it from total probability
Pr⁡(A∣B)\Pr(A \mid B)Pr(A∣B)PosteriorThe answer
Table 1.3 · What the pieces are called.

Example 1.4

The taxicab problem

A taxi was involved in a hit-and-run. 85%85\%85% of the city’s taxis are green and 15%15\%15% are blue. A witness says the taxi was blue, and tests show they identify a colour correctly 80%80\%80% of the time. What is the probability the taxi was blue?

Show the worked solutionHide the worked solution

Worked solution

  1. Formula
    Pr⁡(B∣"blue")=Pr⁡("blue"∣B)Pr⁡(B)Pr⁡("blue"∣B)Pr⁡(B)+Pr⁡("blue"∣G)Pr⁡(G)\Pr(B \mid \text{"blue"}) = \frac{\Pr(\text{"blue"} \mid B)\Pr(B)}{\Pr(\text{"blue"} \mid B)\Pr(B) + \Pr(\text{"blue"} \mid G)\Pr(G)}Pr(B∣"blue")=Pr("blue"∣B)Pr(B)+Pr("blue"∣G)Pr(G)Pr("blue"∣B)Pr(B)​
  2. Substitute
    =0.8×0.150.8×0.15+0.2×0.85= \frac{0.8 \times 0.15}{0.8 \times 0.15 + 0.2 \times 0.85}=0.8×0.15+0.2×0.850.8×0.15​
  3. Solve
    =0.120.12+0.17= \frac{0.12}{0.12 + 0.17}=0.12+0.170.12​
    The witness is right about a blue cab in 12% of cases and wrong about a green one in 17%.
  4. =0.120.29= \frac{0.12}{0.29}=0.290.12​
  5. Answer
    Pr⁡≈0.41\Pr \approx 0.41Pr≈0.41

Sanity check. Below one half, despite an 80%80\%80% accurate witness — because green cabs are so much more common that the witness’s mistakes about them outnumber their correct calls on blue ones.

The base rate does the work. Think in counts rather than percentages. Out of a hundred cabs, fifteen are blue and the witness correctly calls twelve of them; eighty-five are green and the witness wrongly calls seventeen of them blue. Twenty-nine "blue" calls, twelve of them right. Nothing about that requires a formula, and expressing it this way is usually the fastest route to the answer under pressure.

1,000 peopleHas the condition0.1%Tests positive100%1 personDoes not have it99.9%Tests positive5%50 peopleTests negative95%949 people
Figure 1.5 · Where the positives come from. Both highlighted paths end in a positive test. The test is doing its job on each branch; what decides the answer is how many people started down each one.

The rest of this lesson is in Premium

You have read the opening. 13 more sections follow, including 5 worked examples and 3 quick checks.

Start the free 7-day trialSign in

Nothing is charged for 7 days, and you can cancel before then. Or read Arithmetic that survives a clock in full, free.

The distributions you have to know cold →
On this page
  • Conditional probability
  • Bayes in two lines
  • What the pieces are called
  • Worked example — the taxicab problem
  • Where the positives come from

QuantMax · 141 lessons · 1342 questions · c5c0caa

  • Premium
  • Arbitrage trees
  • Horse racing
  • Invite friends
  • Account
  • About QuantMax

Firm names identify publicly reported question patterns and nothing more. QuantMax is not affiliated with, endorsed by, or recruiting for any firm named in the curriculum. Everything you do in lessons and the question bank is kept to your account.