Probability Calculator - AND, OR, Complement, and Binomial
Enter probabilities as decimals in [0, 1], not percents. Binomial n is an integer 1–200. Default n = 10, k = 3, p = 0.5. Runs in your browser.
Rule and Inputs
Use 0.5 for 50%. Mutually exclusive OR is rejected if the sum exceeds 1. Binomial C(n, k) uses a log-sum product so n = 200 does not overflow.
Computed PCalculated
Default n = 10, k = 3, p = 0.5 → C(10,3)×0.5¹⁰ = 0.1171875
A Probability Calculator for AND, OR, Complements, and Binomial Trials
Probability homework mixes a handful of identities that look similar until you swap AND for OR. This page keeps those identities in separate modes so you cannot accidentally multiply when you meant to add. Every probability input is a decimal in [0, 1]. Type 0.25 for a 25% chance - not 25. Percents belong in other tools; mixing them here would make 1 − P look like −24.
The default mode is binomial because that is a high-volume search: n independent yes/no trials, each with success chance p, and you want P(exactly k successes). With n = 10, k = 3, p = 0.5 you get C(10, 3) × 0.5¹⁰ = 120 / 1024 = 0.1171875. Factorials for C(200, 100) overflow a JavaScript number if you multiply 200! naively. The implementation adds logs of the multiplicative formula for C(n, k) and then exponentiates, which stays finite for n ≤ 200.
Combinatorics that only count arrangements - nPr and nCr without a p^k term - live on the permutation and combination calculator. Turning a raw score into a tail probability under a normal model is a z-score problem. Summarizing a numeric list is the statistics calculator. This page stays with elementary event algebra and the binomial PMF.
How to Use the AND / OR / Binomial Tool
- Pick a rule: complement, independent AND, mutually exclusive OR, general OR (you supply the intersection), or binomial P(X = k).
- Enter decimals in [0, 1]. For binomial, n is an integer from 1 to 200 and k is an integer from 0 through n.
- Read P and the identity that was applied. Binomial also prints C(n, k).
- Copy or Clear. Inputs persist in this browser for 30 days and are not uploaded.
The Five Identities, Written Out
| Mode | Formula | Watch-out |
|---|---|---|
| Complement | 1 − P(A) | Aᶜ is “not A” |
| Independent AND | P(A)P(B) | Needs independence |
| Exclusive OR | P(A)+P(B) | Rejected if sum > 1 |
| General OR | P(A)+P(B)−P(A∩B) | Intersection required |
| Binomial | C(n,k) p^k (1−p)^{n−k} | n ≤ 200, k ∈ 0..n |
Independence means P(A and B) = P(A)P(B). Two coin flips qualify; drawing two cards without replacement does not, unless you use a hypergeometric model instead. Mutually exclusive means P(A and B) = 0, so the addition rule has no overlap to subtract. Exclusive events with positive probability cannot be independent: if A happened, B is impossible, so P(B|A) = 0 ≠ P(B).
General OR needs a legal intersection. P(A∩B) cannot exceed the smaller of P(A) and P(B), and it cannot sit below max(0, P(A)+P(B)−1) (Fréchet bounds). The calculator rejects intersections outside that interval rather than printing a union greater than 1 or less than each singleton.
Binomial worked default
n = 10 fair coin tosses, k = 3 heads. C(10,3) = 120. Each sequence of 3 heads and 7 tails has probability 0.5¹⁰ = 1/1024. Product: 120/1024 = 0.1171875. The same engine handles unfair coins: n = 20, k = 2, p = 0.1 uses C(20,2) = 190 times 0.1² times 0.9¹⁸.
Independent Events Versus Mutually Exclusive Events
Students collapse these two phrases because both sound like “the events do not interfere.” They interfere in opposite ways. Independence is a product rule. Mutual exclusivity is an empty intersection. Rolling a 6 on a die and flipping tails on a coin are independent (different experiments) and not exclusive (both can happen). Drawing a heart and drawing a spade on one card are exclusive and not independent.
“At least one” of several independent trials is usually easier as a complement: 1 − (1 − p)^n, which is 1 minus the binomial P(X = 0). This page’s complement mode does the 1 − P step after you compute P(none) elsewhere, or you can set binomial k = 0 and then take the complement of that result by hand. There is no “at least k” cumulative mode here on purpose - the PMF stays a single k so the factorial identity stays visible.
Conditional probability P(A|B) = P(A and B)/P(B) is not a mode on this calculator. If you already know the joint and the margin you can divide them yourself. Bayes’ theorem and trees are the right picture when those joints are the unknown, not a two-box product.
Binomial Assumptions and Overflow-Safe C(n, k)
A binomial count needs a fixed n, two outcomes per trial, constant p, and independence. Drawing without replacement from a small deck is hypergeometric. A Poisson limit appears when n is large and p is small with λ = np moderate - that approximation is not computed here. n is capped at 200 so the page stays a teaching tool, not a scientific library for n = 10⁷.
C(n, k) = n! / (k!(n − k)!) is computed as the product (n/1) × ((n−1)/2) × … in log space: sum log(n − k + i) − log(i). That avoids 200! which is about 7.9 × 10³⁷⁴. The displayed coefficient is rounded to the nearest integer after exp, which is exact for n ≤ 200 in double precision for practical display. The PMF itself uses the same log-sum plus k log p and (n − k) log(1 − p).
Counting only, without p, is still useful: C(10, 3) = 120 is the number of ways to choose the successful trials. Pair this page with the permutation-combination calculator when the question stops at nCr and never mentions a probability.
Worked AND / OR Numbers You Can Check by Hand
Independent AND: P(rain) = 0.3, P(late train) = 0.2, assumed independent → 0.06 both. Exclusive OR: P(red) = 0.4 and P(blue) = 0.35 on a spinner with no overlap → 0.75. If someone types 0.7 and 0.5 as exclusive, the sum 1.2 is rejected: those events must overlap or the probabilities are wrong. General OR: P(A) = 0.5, P(B) = 0.4, P(A and B) = 0.2 → union 0.7.
Complement: a component fails with P = 0.02, so it survives with 0.98. Five independent components all surviving is 0.98⁵ (independent AND applied repeatedly), and “at least one failure” is the complement of that product. Build it in pieces; this UI does one identity at a time so each step stays inspectable.
Dice, Cards, and Coins - Building AND/OR Without a Tree Diagram
One fair die, P(six) = 1/6 ≈ 0.1667. Complement: P(not six) ≈ 0.8333. Two independent dice, P(both six) = (1/6)(1/6) ≈ 0.0278 in independent-AND mode. P(at least one six) is not 1/6 + 1/6, because double six would be counted twice; that is general OR with P(both) = 1/36, giving 11/36, or easier as the complement of (5/6)². Mutually exclusive OR is the right mode for “odd or even on one roll” (0.5 + 0.5 = 1) and the wrong mode for “six or even,” which overlap on six itself.
A standard deck: P(heart) = 13/52 = 0.25, P(ace) = 4/52 ≈ 0.0769, P(ace of hearts) = 1/52 ≈ 0.0192. General OR for “heart or ace” is 0.25 + 0.0769 − 0.0192 = 16/52 = 4/13. Suit and rank on one complete-deck draw are independent: P(heart|ace) = 1/4 = P(heart), so independent AND of 0.25 × 4/52 matches 1/52. Drawing two hearts without replacement is not independent; do not use this AND mode for that. Hypergeometric counting belongs with combinations: C(13,2)/C(52,2).
Ten coin flips, P(exactly three heads) is the default binomial. P(no heads) is binomial k = 0, which equals (1−p)^n. P(all heads) is k = n. P(at least one head) is the complement of k = 0. This UI will not sum k = 3 through 10 for you; add the PMF values if a worksheet asks for a cumulative tail, or recognize 1 − F(k−1) once you compute each term.
Birthday-style collisions and geometric waiting times are also complements and products, but they need a sequence of changing probabilities. Compute each factor on paper, then use independent AND only when the factors really do not change. A geometric “first success on trial 5” is (1−p)^4 p, which you can view as AND of four failures and one success if trials are independent - still not a binomial P(X = 5) unless you recast X as the count in a fixed n.
What This Calculator Will Not Do (Bayes, Conditional, Normal Tails)
Bayes’ theorem rearranges a joint into P(A|B) when you know P(B|A), P(A), and P(B). That is a different layout (priors and likelihoods) and is easy to fake if stuffed into a two-box AND. Conditional probability given an already observed B needs the joint divided by P(B). Neither identity has a mode here so the product rule cannot be mistaken for a posterior.
Normal-curve tail probabilities from a z, a t, or a chi-square statistic are not binomial. Use the z-score calculator when the model is continuous and approximately Gaussian. A binomial with n large and p not too close to 0 or 1 is sometimes approximated by a normal with mean np and variance np(1−p); that approximation, and any continuity correction, is outside this page’s scope. For n ≤ 200 the exact PMF is the honest number.
Expected value, variance of a binomial (np and np(1−p)), and random-number simulation of trials are also out of scope. The statistics calculator will describe a simulated list after you generate one elsewhere. Combinatoric nPr / nCr without a probability stay on the permutation-combination calculator.
Numerical Checks: Complements, Bounds, and a Larger Binomial
Complement of 0 must be 1; complement of 1 must be 0. Those endpoints are allowed. Independent AND of 0.2 and 0.5 is 0.1. Exclusive OR of 0.2 and 0.5 is 0.7. Exclusive OR of 0.6 and 0.5 is rejected. General OR of 0.6, 0.5, and intersection 0.2 is 0.9. An intersection of 0.55 with those margins is rejected because 0.55 > min(0.6, 0.5). An intersection of 0.05 with P(A)=0.6 and P(B)=0.5 is rejected because 0.6+0.5−1 = 0.1 as a lower bound.
Binomial n = 20, k = 10, p = 0.5 should be C(20,10)/2^20. C(20,10) = 184756, 2^20 = 1,048,576, so P ≈ 0.176197. n = 100, k = 50, p = 0.5 is about 0.0796; the log-sum path is why that does not overflow. n = 200 is the cap: a research Monte Carlo with thousands of trials needs a stats library, not this teaching widget.
Percent entry is the most common silent error. P = 25 with the intent “25%” is rejected as outside [0, 1]. Write 0.25. Odds (3 to 1) are not probabilities; convert odds a:b to a/(a+b) first. Likelihoods in a Bayes table are also not required to sum to 1 until they are normalized - do not paste them into AND/OR as if they were already probabilities.
Another check: independent AND is commutative, so swapping P(A) and P(B) must not change the product. Exclusive OR is also commutative. Complement twice returns the original P. Binomial P(X = k) at p and P(X = n−k) at 1−p are equal - ten trials with three successes at p = 0.5 is the same as seven successes at p = 0.5, and C(10,3) = C(10,7). If those symmetries fail, the implementation is wrong; they hold on this page.
Frequently Asked Questions (FAQ) - Probability
What is the difference between probability AND and OR?
AND is the intersection: both events happen. For independent events, P(A and B) = P(A)P(B). OR is the union: at least one happens. If A and B cannot both occur (mutually exclusive), P(A or B) = P(A)+P(B). In general, P(A or B) = P(A)+P(B)−P(A and B) so the overlap is not counted twice.
What does it mean for two events to be independent?
Events A and B are independent when knowing that A occurred does not change P(B): P(B|A) = P(B). Equivalently, P(A and B) = P(A)P(B). Independent is not the same as mutually exclusive. Mutually exclusive events with positive probability cannot be independent, because if A happens then B is impossible.
How do you calculate binomial probability P(X = k)?
For n independent Bernoulli trials with success probability p, P(X = k) = C(n, k) p^k (1−p)^{n−k}, where C(n, k) = n! / (k!(n−k)!). This calculator accepts n from 1 to 200 and computes C(n, k) with a multiplicative (log-sum) product so large factorials do not overflow. Default n = 10, k = 3, p = 0.5 gives 120 × 0.5^10 = 0.1171875.
What is the complement rule in probability?
The complement of A is “A does not happen,” written Aᶜ or not A. P(Aᶜ) = 1 − P(A). Use it when “at least one” is easier as 1 minus “none,” for example the chance of no sixes in several dice rolls. The input here is a decimal in [0, 1]; 0.2 has complement 0.8.
When are two events mutually exclusive?
Mutually exclusive (disjoint) events cannot occur together, so P(A and B) = 0 and P(A or B) = P(A)+P(B). Drawing a heart and drawing a spade on one card is mutually exclusive. If P(A)+P(B) > 1 they cannot be mutually exclusive; this calculator rejects that pair instead of returning an invalid probability greater than 1.
Does this probability calculator upload my numbers?
No. Every rule runs in your browser with JavaScript. Probabilities, n, k, and p never leave the device. After the page loads, the tool still works if the network drops. Inputs are stored only in localStorage on your computer for up to 30 days.
Why Use This Free Probability Calculator?
Use this page when the question is a single identity: a complement, a product of independent chances, a disjoint union, a union with a known overlap, or one binomial PMF term. That is the opposite of a computer-algebra “probability of anything” box. Constraints are features - n capped at 200, inputs as decimals, exclusive OR rejected above 1 - so a wrong model fails loudly instead of printing 1.2 and calling it a probability.
- Separate modes for complement, AND, exclusive OR, general OR, and binomial so the formula cannot be mixed up.
- Decimals in [0, 1] with a clear rejection of percent-style inputs like 25.
- Overflow-safe C(n, k) for n up to 200.
- Private, copy, clear, fullscreen, split panes on desktop.
Related Tools
Discover more free developer tools that might interest you.
Area Calculator
Calculate area of squares, rectangles, triangles, circles, and more
Use ToolAverage Calculator
Calculate mean, median, mode, and range from a list of numbers
Use ToolBasic Calculator
Add, subtract, multiply, and divide with a free online calculator
Use ToolBig Number Calculator
Add, subtract, multiply, and divide integers too large for a standard calculator
Use ToolBinary Calculator
Add, subtract, and convert binary numbers to decimal and hex
Use ToolCircle Calculator
Find radius, diameter, circumference, area, arc length, and sector area
Use ToolRelated guides
Read the how-to, then come back to this tool when you are ready to run it locally.