Skip to content
Science, DecodedContext Jamming

Rosetta Stone · 23 of 30

P(A∣B)P(A \mid B)

Conditional probability

Notation: structural shorthand

In plain English

"The probability of A, given that B is true." The bar means given. You shrink the world to only the cases where B holds, then ask how often A occurs within them. P(A∣B)P(A\mid B) and P(B∣A)P(B\mid A) are generally different. Confusing them (“the prosecutor’s fallacy”) is one of the most common errors in reading evidence. Bayes’ rule converts one into the other.

As code

// P(A|B) = count(A and B) / count(B)
const rows = data.filter((r) => r.B);
const pAgivenB = rows.filter((r) => r.A).length / rows.length;

Where the analogy bends: Counting works with data. In models, conditional probabilities are computed (e.g. a language model outputs P(next token | context)).

See it

Anot Aorange = B
P(A∣B)P(A\mid B) is the share of the B-region that is also A. Conditioning means zooming in on the world where B happened. Note that P(A∣B)≠P(B∣A)P(A\mid B) \ne P(B\mid A) in general.

What it means, field by field

Mathematics

P(A|B) = P(A ∩ B) / P(B); the basis of Bayes’ theorem.

AI / ML

Language models output P(next token | previous tokens); classifiers output P(label | input).

Biology

P(disease | positive test); P(phenotype | genotype); inheritance probabilities.

Epistemics

P(data | hypothesis) is not P(hypothesis | data). p-values are the former.

In a research paper

Bayes’ theorem: medical diagnosis, spam filtering, scientific inference.
P(H∣E)=P(E∣H) P(H)P(E)P(H \mid E) = \frac{P(E \mid H)\,P(H)}{P(E)}

Belief in hypothesis H after seeing evidence E = how well H predicted E, times prior belief in H, normalised.

Common misreadings

  • Swapping the conditional: treating P(positive | disease) as P(disease | positive).

  • Reading the bar as division or as "or".

  • Reading a p-value as the probability that the hypothesis is false.

Connected symbols

Where it appears on this site