A little help goes a long way. Find a tool/

Math FIELD NOTES · 4 MIN READ

How Probability Works

Favorable outcomes over total outcomes: dice and coin formulas, draws without replacement, longest-run expectations, and why the gambler's fallacy fails.

Probability is one of the few branches of mathematics with a one-line definition: the probability of an event is the number of favorable outcomes divided by the number of possible outcomes, on a scale from 0 (never) to 1 (always). Everything else — coins, dice, card draws, streaks, the gambler's fallacy — is bookkeeping for counting those outcomes correctly.

The core ratio

P(event) = favorable outcomes / total outcomes

A fair six-sided die has six equally likely faces, so P(exactly a 6) = 1/6 ≈ 16.7%, which the calculator also expresses as odds: "1 in 6". "At least a 4" has three favorable faces (4, 5, 6), so 3/6 = 50% — the same event family, a different counting line. This ratio is the whole foundation, and it carries a strict rule: probabilities live between 0 and 1, so an answer outside that range means the counting, not the math, went wrong.

Independent events: the coin flip

A fair coin is a two-outcome world, P(heads) = 1/2, and each flip is independent — the coin has no memory. Independent probabilities multiply, so the chance of a specific sequence like H-H-T-H is (1/2)⁴ = 1/16. That gives an exact formula for "exactly k heads in n flips":

P(exactly k heads in n flips) = C(n, k) × (1/2)^n
C(n, k) = n! / (k! × (n − k)!)   ← the number of ways to choose which flips are heads

Worked example: exactly 2 heads in 4 flips. There are C(4,2) = 6 ways to place the two heads among four flips, and 2⁴ = 16 equally likely sequences, so P = 6/16 = 37.5%. That is more likely than most people's intuition, and it is the same combination count that powers lottery odds (see permutations vs combinations for where the C(n,k) comes from).

Without replacement: drawing marbles

Remove items as you draw and the events stop being independent — each draw changes what remains. This is the hypergeometric setting, and it covers card hands, lottery balls, and quality inspections:

P(exactly k successes in n draws)
  = C(K, k) × C(N − K, n − k) / C(N, n)

where N is the total population, K the number of "success" items, n the draws, k the successes wanted. Worked example: a bag holds 10 marbles, 4 of them red; you draw 3 and want exactly 2 red. Ways to pick 2 of the 4 red: C(4,2) = 6. Ways to pick 1 of the 6 others: C(6,1) = 6. Ways to draw any 3 of 10: C(10,3) = 120. So P = (6 × 6)/120 = 36/120 = 30%. The second factor is the quiet part people forget — the "failures" you draw must be counted too.

Streaks and the gambler's fallacy

Independence has an uncomfortable consequence: a fair coin that has landed heads five times in a row still lands heads with probability 1/2 on the sixth flip. Believing tails is "due" is the gambler's fallacy, and it fails because the ratio definition never looks at history — only at the count of favorable and total outcomes for the next trial. Streaks are not evidence of bias either: in 10,000 flips the longest run of identical results is typically around 12–14 (roughly log₂ of the number of flips), so a coin simulator reporting a 13-long heads streak is telling you the coin is behaving, not misbehaving. Over many flips the proportions converge toward 50/50 — the law of large numbers — but convergence is a property of totals, not of a correction owed to the next flip.

Why simulate when you can calculate?

Formulas are exact but require you to count the outcome space correctly — the hard part of the marble problem above. Simulation inverts the workflow: generate thousands of random trials and count how often the event happens. It is slower and approximate, but it validates the formula when the counting is tangled, and it handles problems whose "exact" math has no closed form. The bridge between the two is quality randomness — the simulators here use uniform random draws in the browser, the same machinery discussed in how pseudorandom numbers work. Simulation and sampling are the same idea applied to data rather than dice; see random sampling explained.

Try it yourself

The Probability Calculator computes all three cases above — exactly-k coin outcomes, dice probabilities in exact / at-least / at-most modes, and without-replacement draws — and reports each result as a fraction, a percentage, and "1 in N" odds. The Coin Flip Simulator flips up to 10,000 coins at once and shows heads/tails totals, percentages, and the longest heads and tails runs, so you can watch theory and simulation meet. The Dice Roller rolls any count of dice with any number of sides (seeded rolls reproduce the same sequence — useful for games), reporting totals, average, min, and max.

Frequently asked questions

What does '1 in 100' mean as a probability?
A probability of 1/100 = 0.01, or 1%. It is an average over many trials - roughly one occurrence per 100 trials in the long run - not a guarantee of exactly one in each specific hundred.
Are coin flips independent?
Yes. A fair coin has no memory, so after five heads in a row the next flip is still 50/50. Expecting tails to be 'due' is the gambler's fallacy; streaks are normal, and in 10,000 flips the longest run is typically 12-14.
Why is exactly 2 heads in 4 flips 37.5%?
There are C(4,2) = 6 ways to place the two heads among four flips and 2^4 = 16 equally likely sequences, so the probability is 6/16 = 37.5% - more likely than intuition suggests.
What is the difference between probability and odds?
Probability is favorable outcomes over total outcomes; odds compare favorable to unfavorable. Rolling a six has probability 1/6 (about 16.7%) but odds of 1:5. Calculators usually quote both.