A test is 99% accurate and I tested positive. Am I 99% likely

Back to list2026-04-17
You

A test is 99% accurate and I tested positive. Am I 99% likely to be ill?

ChatGPT

No, and the gap is the whole point of the rule:

\[P(D \mid +) = \frac{P(+ \mid D)\,P(D)}{P(+ \mid D)P(D) + P(+ \mid \lnot D)P(\lnot D)}\]

With a prevalence \(P(D) = 0.001\) and both error rates at 1%, this gives roughly \(0.09\). Nine percent, not ninety-nine, because false positives are drawn from a pool a thousand times larger.

You

Positive expected value means I should take the bet every time?

ChatGPT

Only if you can survive the variance. Repeated multiplicative bets are governed by the geometric mean, not the arithmetic one:

\[g = \prod_i (1 + r_i)^{p_i}\]

A bet with positive arithmetic expectation can still have \(g < 1\), which means certain ruin over enough repetitions. That is the whole content of the Kelly criterion.

You

How long should a random id be to avoid collisions?

ChatGPT

Use the birthday approximation: collisions become likely around \(\sqrt{N}\) draws from a space of size \(N\). For a 64-bit id that is about 4 billion items, for 128 bits it is beyond anything you will generate. The practical answer for most systems is 128 random bits and no coordination.