Conditional probability: Refresher

Written by So8res, et al. last updated

⁠⁠⁠⁠⁠⁠⁠

\mathbb P(\text{left} \mid \text{right})
 is the probability that the thing on the left is true assuming the thing on the right is true, and it's defined as 
\frac{\mathbb P(\text{left} \land \text{right})}{\mathbb P(\text{right})}.

Thus, 

\mathbb P(yellow \mid banana)
 is the probability that a banana is yellow ("the probability of yellowness given banana"), while 
\mathbb P(banana \mid yellow)
 is the probability that a yellow object is a banana ("the probability of banana, given yellowness").[1]

\mathbb P(x \land y)
 is used to denote the probability of both 
x
 and 
y
 being true simultaneously (according to some probability_distribution 
\mathbb P
). 
\mathbb P(x\mid y)
, pronounced "the conditional probability of x, given y", is defined to be the quantity

\frac{\mathbb P(x \wedge y)}{\mathbb P(y)}.

For example, in the Diseasitis problem, 

\mathbb P({sick}\mid {positive})
 is the probability that a patient is sick given a positive test result, and it's calculated by taking the 18% patients who are sick and have positive test results, and dividing by all 42% of the patients who got positive test results. That is, 
\mathbb P({sick}\mid {positive})
 
=
 
\frac{\mathbb P({sick} \land {positive})}{\mathbb P({positive})}.

Using a frequency diagram, we can visualize 

\mathbb P(sick \mid positive)
 as the probability of drawing a 
sick
 result from a bag of only those people in the population who got a 
positive
 result.

diseasitis frequency

bag of 18 and 24 patients

The "given" operator in 

\mathbb P(x\mid y)
 tells us to assume that 
y
 is true, to restrict our attention to only possible cases where 
y
 is true, and then ask about the probability of 
x
 within those cases.

Note that 

\mathbb P(positive \mid sick)
 is not the same as 
\mathbb P(sick \mid positive).
 To find the probability that a patient has a positive result given that they're sick, we can visualize taking the 20 sick patients and putting them in a group, and then asking the probability that a randomly selected one will have a positive result, which will be 
\frac{18}{20} = 0.9
 — so 
\mathbb P(positive \mid sick) = 90\%,
 while 
\mathbb P(sick \mid positive) \approx 43\%.
 Mixing up which one is which is an unfortunate source of of many practical errors when you're trying to do these calculations using only the formal notation, at least until you get used to it. Just remember that 
\mathbb P(\text{left} \mid \text{right})
 is the probability of the thing on the left given that the thing on the right is true.

  • ^

    In general, 

    \mathbb P(v)
     is an abbreviation of 
    \mathbb P(V = v)
     for some variable 
    V
    , which is assumed to be known from the context. For example, 
    \mathbb P(yellow)
     might stand for 
    \mathbb P({ColorOfNextObjectInBag}=yellow)
     where 
    ColorOfNextObjectInBag
     is a variable in our probability_distribution 
    \mathbb P,
     and 
    yellow
     is one of the values that that variable can take on.

  • Summaries

    You can edit summaries by clicking on them, reorder them by dragging, or add a new one (up to 3). By default you should avoid creating more than one summary unless the subject matter benefits substantially from multiple kinds of explanation.
  • Summary

    is the probability that the thing on the left is true assuming the thing on the right is true, and it's defined as

    Thus, is the probability that a banana is yellow ("the probability of yellowness given banana"), while is the probability that a yellow object is a banana ("the probability of banana, given yellowness").

  • is the probability that the thing on the left is true assuming the thing on the right is true, and it's defined as

    Thus, is the probability that a banana is yellow ("the probability of yellowness given banana"), while is the probability that a yellow object is a banana ("the probability of banana, given yellowness").[1]

    is used to denote the probability of both and being true simultaneously (according to some probability_distribution ). , pronounced "the conditional probability of x, given y", is defined to be the quantity

    For example, in the Diseasitis problem, is the probability that a patient is sick given a positive test result, and it's calculated by taking the 18% patients who are sick and have positive test results, and dividing by all 42% of the patients who got positive test results. That is,

    Using a frequency diagram, we can visualize as the probability of drawing a result from a bag of only those people in the population who got a result.

    diseasitis frequency

    bag of 18 and 24 patients

    The "given" operator in tells us to assume that is true, to restrict our attention to only possible cases where is true, and then ask about the probability of within those cases.

    Note that is not the same as To find the probability that a patient has a positive result given that they're sick, we can visualize taking the 20 sick patients and putting them in a group, and then asking the probability that a randomly selected one will have a positive result, which will be — so while Mixing up which one is which is an unfortunate source of of many practical errors when you're trying to do these calculations using only the formal notation, at least until you get used to it. Just remember that is the probability of the thing on the left given that the thing on the right is true.

    1. ^︎

      In general, is an abbreviation of for some variable , which is assumed to be known from the context. For example, might stand for where is a variable in our probability_distribution and is one of the values that that variable can take on.

    1.
    ^︎

    In general, is an abbreviation of for some variable , which is assumed to be known from the context. For example, might stand for where is a variable in our probability_distribution and is one of the values that that variable can take on.