Conditional Probability Playground

Setup: a person either has the condition (C=1) or does not (C=0). The test can come back positive (T=1) or negative (T=0). The arrow C -> T means the true condition affects how likely each test result is.

P(C): Probability the condition is present (C = 1)

CP(C)
00.990
10.010

Conditional P(T | C)

CP(T=1|C)P(T=0|C)
1 0.950 0.050
0 0.050 0.950
0.010
0.950
0.050
1000
Joint table P(C,T)
T=0T=1
C=0 0.941 0.050
C=1 0.001 0.010

Evidence and Posterior

Choose observed evidence for T. Posterior updates by Bayes' rule using the normalizer P(T).

P(T=1) = 0.059
P(T=0) = 0.941
Posterior table P(C | T = observed)
CP(C | T=1)
00.839
10.161
How to read this:
Prior/base rate: starting chance before seeing test data, P(C).
Likelihood/CPT: test behavior given condition, P(T|C).
Evidence: pick observed T.
Posterior: updated belief P(C|T) = (prior x likelihood) / P(T).