1. Textbook example
How to use
Load Textbook example and compare 95 true positives with 495 false positives.
Outcome
The positive predictive value is 95 / 590, about 16.10%.
Elysia Tools
Navigation
Compare prior and posterior probabilities with a hypothetical screening test and an interactive probability area diagram.
Open static visualizationTool usage guide
Load the textbook example and then switch to Higher prevalence. The sensitivity and the false-positive rate stay fixed, while the positive predictive value moves from 16.10% to 67.86%. The expected counts show where the difference comes from.
Let H be the hypothesis and E the evidence. The product P(H)P(E|H) gives the joint probability. Add the other branch, P(¬H)P(E|¬H), to obtain P(E). Dividing the joint probability by P(E) gives the posterior when P(E) > 0.
In the hypothetical population of 10,000, multiply the true-positive and false-positive joint probabilities by 10,000. Their expected counts add to the expected total positives. Keeping the fractions until the final division matters most when the condition is rare.
Zero marginal probability
When both branches make E impossible, P(E) = 0. The denominator is zero and the posterior displays a dash.
Fractional expected counts
Each number is an expectation calculated from a probability. A grid cell can share two colors. The numerical readouts show the contribution of small areas.
How to use
Load Textbook example and compare 95 true positives with 495 false positives.
Outcome
The positive predictive value is 95 / 590, about 16.10%.
How to use
Load Higher prevalence and compare both test rates with the previous example.
Outcome
At 10% prevalence, the positive predictive value is about 67.86%.
How to use
In General Bayes update, load Equally likely evidence.
Outcome
Both evidence rates are 40%. The posterior stays at its 30% prior.
Sensitivity is the proportion of positives among people with the condition. The posterior is the proportion with the condition among those who tested positive. Each uses a different denominator.
At a Glance

Verified Results
Every parameter set and result below is a fixed output of this page's built-in model (each asserted before delivery) and reproduces directly: set the Parameters column in the interactive panel.
| Scenario | Parameters | Result |
|---|---|---|
| Rare condition | P(H) = 0.10%, P(E|H) = 99%, P(E|¬H) = 1% | TP = 9.9, FP = 99.9, P(H|E) ≈ 9.02% |
| Textbook example | P(H) = 1%, P(E|H) = 95%, P(E|¬H) = 5% | TP = 95, FP = 495, P(H|E) ≈ 16.10% |
| Higher prevalence | P(H) = 10%, P(E|H) = 95%, P(E|¬H) = 5% | TP = 950, FP = 450, P(H|E) ≈ 67.86% |
| Evidence favors H | P(H) = 50%, P(E|H) = 80%, P(E|¬H) = 20% | P(E) = 50%, P(H|E) = 80% |
| Equally likely evidence | P(H) = 30%, P(E|H) = 40%, P(E|¬H) = 40% | P(E) = 40%, P(H|E) = 30% |
| Impossible evidence | P(H) = 50%, P(E|H) = 0%, P(E|¬H) = 0% | P(E) = 0%, P(H|E) = — |
Sources
Papers and datasets underlying this visualization - every formula, algorithm, and data anchor on the page traces back to the sources below.
Thomas Bayes (1763). LII. An essay towards solving a problem in the doctrine of chances. By the late Rev. Mr. Bayes, F. R. S. communicated by Mr. Price, in a letter to John Canton, A. M. F. R. S. Philosophical Transactions of the Royal Society of London 53, 370–418.
John Tsitsiklis (2018). Lecture 2: Conditioning and Bayes' Rule. MIT OpenCourseWare, RES.6-012 Introduction to Probability.
Penn State Department of Statistics. Bayes’ Theorem. STAT 414 | Introduction to Probability Theory, Lesson 6.
Gerd Gigerenzer, Ulrich Hoffrage (1995). How to Improve Bayesian Reasoning Without Instruction: Frequency Formats. Psychological Review 102(4), 684–704.
Chris Piech (2016). Medical Tests. Stanford CS109, Probability for Computer Scientists.
Related
Format Conversion
Convert equations between AsciiMath, LaTeX and MathML: auto-detect the input format, produce canonical LaTeX, presentation MathML with an embedded TeX annotation, a best-effort AsciiMath back-translation, a screen-reader aria-label snippet (role=math), and a KaTeX HTML preview.
Math & Numbers
Calculate posterior probability P(A given B) using prior, likelihood, and false-positive rate
AI Tools
Solve math problems from images using AI vision models with step-by-step explanations
Data Visualization
See the Central Limit Theorem in action: draw samples from a non-normal source distribution (uniform, exponential, Poisson, or Bernoulli), plot the histogram of sample means, and overlay the predicted Normal curve N(μ, σ²/n). Compare empirical vs theoretical mean and standard error, and watch convergence tighten as the sample size grows.
Visualize audio, inspect stereo, diagnose signal and timing, and check files before delivery.
Review regular expressions on short, harmless examples. The debugger’s display is a teaching aid, not an internal engine trace. The benchmark’s Python option is simulated, not a run in Python; check results in the intended runtime.
Solve engineering math problems across ODEs, Laplace or Z transforms, convolution, and numerical approximation while checking method fit, units, and initial conditions.
Convert measurements, number bases, fractions, scientific notation, Roman numerals, and byte or bit values with a clear precision check.
Next
Explore ideal zero-order kinetics, depletion and half-life, with comparison curves matched at the initial disappearance rate.
Change the rate constant and initial concentration to compare exponential decay, the semilog line and a sampled population.
Change the rate constant and initial concentration to explore the concentration curve, reciprocal plot and first half-life of a second-order reaction.
Vary temperature, activation energy and the prefactor, then compare k versus T with ln(k) versus 1/T.
Change the two rate constants and the starting mixture to explore net reaction direction, equilibrium composition and relaxation time.
Adjust the two rate constants in A → B → C to explore the height and timing of the intermediate peak and the buildup of product.
Interactive visualization of free radical chain reaction polymerization - Explore initiation, propagation, termination steps, chain growth animation, and molecular weight distribution
Interactive visualization of Le Chatelier's Principle - Explore how changes in concentration, pressure, and temperature affect chemical equilibrium with animated molecular dynamics