Probability feels intuitive until you actually have to calculate something. I have watched senior engineers confidently state that the probability of two independent events both happening is the sum of their individual probabilities. It is the product. And that single mistake can cascade through an entire risk model.
Where probability goes wrong in practice
The birthday problem is the classic example. In a room of 23 people, there is a greater than 50% chance that two people share a birthday. Most people guess you need around 180 people for even odds. The intuition fails because humans are bad at combinatorics.
This same failure mode shows up in software engineering constantly.
Hash collisions. You have a hash function that produces 2^32 possible values. You are hashing 100,000 items. What is the probability of at least one collision? It is not 100,000 / 2^32 (about 0.002%). Using the birthday problem approximation: 1 - e^(-n^2 / 2m), where n is the number of items and m is the number of possible values. The actual collision probability is about 68%. Most people are shocked by that number.
Retry logic. Your API call has a 5% failure rate. You retry up to 3 times. What is the probability of all 3 failing? It is 0.05^3 = 0.000125, or 0.0125%. But that assumes independence. If failures are correlated (the server is down, not flaky), retries do not help and the failure probability stays at 5%.
Feature flags. You have 3 feature flags, each enabled for 10% of users. What fraction of users sees all 3 features simultaneously? If independent: 0.1^3 = 0.1%. What about at least one? 1 - (0.9)^3 = 27.1%. That is a much larger surface area for interaction bugs than most teams realize.
The formulas you actually need
Independent events both happening (AND): P(A and B) = P(A) * P(B)
Either event happening (OR, mutually exclusive): P(A or B) = P(A) + P(B)
Either event happening (OR, not mutually exclusive): P(A or B) = P(A) + P(B) - P(A and B)
Conditional probability: P(A given B) = P(A and B) / P(B)
Bayes' theorem: P(A given B) = P(B given A) * P(A) / P(B)
Bayes' theorem is where most people's intuition completely breaks down. The classic example: a medical test is 99% accurate. The disease affects 1 in 1,000 people. You test positive. What is the probability you actually have the disease? Most people say 99%. The actual answer is about 9%. The low base rate dominates.
P(disease | positive) = P(positive | disease) * P(disease) / P(positive)
= 0.99 * 0.001 / (0.99 * 0.001 + 0.01 * 0.999)
= 0.00099 / 0.01098
= 0.0902 (about 9%)
Distributions matter more than individual calculations
Knowing that an event has a 5% probability is useful. Knowing the distribution of outcomes over many trials is far more useful. If you flip a coin 100 times, you expect 50 heads. But the standard deviation is 5, so getting 40 or 60 heads is entirely normal. Getting 35 or 65 is unusual. Getting 25 is almost impossible.
The binomial distribution handles this: what is the probability of exactly k successes in n independent trials, each with probability p? The normal approximation handles it for large n. The Poisson distribution handles rare events over a fixed interval.
Choosing the wrong distribution is as damaging as choosing the wrong formula. Modeling server failures as normally distributed when they follow a Poisson process will give you wildly wrong confidence intervals.
Making this practical
I built a probability calculator at zovo.one/free-tools/statistics-probability-calculator that handles these common scenarios: single event probability, combined events (AND/OR), conditional probability, Bayes' theorem, and distribution calculations. You describe the scenario, it gives you the number.
The value is not in avoiding arithmetic. It is in catching the cases where your intuition was wrong before you build a system on top of it.
I'm Michael Lip. I build free developer tools at zovo.one. 500+ tools, all private, all free.
Top comments (0)