Probability Explorer
Probability measures how likely an event is, on a scale from 0 to 1. One way to read it is as a long-run relative frequency: the share of times the event happens when the same trial is repeated again and again. A second skill is reading probabilities from a table of counts, where joint, marginal and conditional probabilities answer 3 different questions about the same data.
The tool opens on a coin. Toss it once to watch it turn, or 10, 100, 1,000 or 10,000 times to see the share of heads wander and then settle. Set the chance of heads away from 0.5 to try a biased coin. The Sample data tab loads probability-basics-data.csv, 100 event registrations with attendance, ticket type and payment method, and turns any 2 of those columns into a probability table.
How it works
Marginal: P(A) = row total / n
Joint: P(A and B) = cell count / n
Addition rule: P(A or B) = P(A) + P(B) − P(A and B)
Conditional: P(B | A) = P(A and B) / P(A)
Independent when P(A and B) = P(A) × P(B)
A worked example from the sample file. Of 100 registrations, 20 hold VIP tickets and 83 attended, and 16 are VIP holders who attended. So P(VIP) = 0.20, P(Attended) = 0.83 and the joint probability P(VIP and Attended) = 0.16. The addition rule gives P(VIP or Attended) = 0.20 + 0.83 − 0.16 = 0.87. The conditional probability P(Attended | VIP) = 0.16 / 0.20 = 0.80, a little below the 0.83 for everyone.
For independent events the joint probability would be 0.20 × 0.83 = 0.166, or 16.6 cases, and the file has 16. The 2 figures are close, so ticket type and attendance look nearly independent in this file. The coin makes the same point from the other side: each toss is independent of the last, so the chance of heads stays the same after any run of tails.
The coin experiment follows John Kerrich, who tossed a coin 10,000 times by hand while interned in Denmark during the Second World War. He counted 502 heads after 1,000 tosses, 2,533 after 5,000 and 5,067 after 10,000, a share of 0.507. Source: Kerrich, J. E. (1946), An Experimental Introduction to the Theory of Probability, Copenhagen: Einar Munksgaard. Press Toss 10,000 to repeat his experiment in a second.
Frequently Asked Questions
What is probability as relative frequency?
The probability of an event is the share of times it happens over a long run of trials. Toss a fair coin 10 times and the share of heads may be 0.3 or 0.7. Toss it 1,000 times and the share sits close to 0.5.
What is the difference between joint, marginal and conditional probability?
A joint probability is the chance that 2 events happen together, such as a VIP ticket holder who attended. A marginal probability is the chance of one event on its own. A conditional probability is the chance of one event given that the other has happened, P(B | A) = P(A and B) / P(A).
How do I check whether 2 events are independent?
Events A and B are independent when P(A and B) equals P(A) times P(B), which is the same as P(B | A) equalling P(B). In real data the 2 sides rarely match exactly, so a chi-square test judges whether the gap is larger than chance would give.
What is the addition rule?
P(A or B) = P(A) + P(B) minus P(A and B). The joint probability is subtracted because cases where both events happen are counted once in P(A) and again in P(B).
After 5 tails in a row, is heads more likely?
No. Each toss is independent, so the chance of heads on the next toss is unchanged. Expecting heads to be due is the gambler's fallacy. The long-run share settles because later tosses outnumber the early run.