Conditional probability (source code)

= Conditional probability
{title2=$P(A\mid B)$}
{wiki}

For <events> $A,B$ with $\mathbb P(B)>0$, conditional probability is
$$
\mathbb P(A\mid B)=\frac{\mathbb P(A\cap B)}{\mathbb P(B)}.
$$
Restrict attention to the outcomes in $B$, then renormalize their <probability measure> so its total mass becomes one. The resulting rule $A\mapsto\mathbb P(A\mid B)$ is itself a <probability measure>. The definition and its connection to <independent events> are developed in https://ocw.mit.edu/courses/18-05-introduction-to-probability-and-statistics-spring-2022/resources/mit18_05_s22_class03-prep_pdf/[MIT 18.05, Reading 3: Conditional Probability, Independence and Bayes' Theorem].

For the two-dice model, let $A$ mean the sum is at least nine and $B$ mean the first result is six. Of the six outcomes in $B$, four belong to $A$: the second die can be 3, 4, 5, or 6. Thus \b[$\mathbb P(A\mid B)=2/3$]. Reversing the information gives a different answer: four of the ten outcomes in $A$ have first result six, so \b[$\mathbb P(B\mid A)=2/5$]. Both ratios use the same overlap; their denominators describe different information.

\Image[/conditional-probability-dice.png]
{title=Conditioning selects a different denominator in the same dice outcome grid}

The definition requires positive conditioning mass. For a continuously distributed <random variable> $X$, it cannot directly define $\mathbb P(A\mid X=x)$ when $\mathbb P(X=x)=0$. A <regular conditional distribution> or <conditional density> supplies the appropriate extension, with the usual <almost everywhere> qualification. Nor does conditioning by itself justify <causal inference>: changing which outcomes are considered is different from physically changing how the experiment is generated.