AJ Designer

Probability Calculator

Probability of not A equals one minus probability of A

Solution

Share:

Complement — P(not A)

The probability that event A does not occur. Because every outcome is either in A or not in A, the two probabilities must sum to 1. Useful for converting 'at least one' problems into 'none' problems, where the complement is easier to compute directly.

P(not A) = 1 − P(A)

Joint — P(A and B), independent

The probability that both A and B occur, when the two events are independent (one does not influence the other). For non-independent events, this product underestimates the true joint probability — you must know P(A ∩ B) directly.

P(A and B) = P(A) × P(B)

Union — P(A or B)

The probability that A or B (or both) occurs. The intersection P(A ∩ B) is subtracted so the overlap is not counted twice — this is the inclusion-exclusion principle. For mutually exclusive events, P(A ∩ B) = 0 and the formula simplifies to P(A) + P(B).

P(A or B) = P(A) + P(B) − P(A and B)

Conditional — P(A | B)

The probability that A occurs given that B has occurred. Rearranged, P(A ∩ B) = P(A | B) × P(B), which is the multiplication rule for general (not necessarily independent) events. Bayes' theorem builds on this definition to invert the conditioning direction.

P(A | B) = P(A and B) / P(B)

How It Works

Probability assigns a number between 0 and 1 to each event, where 0 means impossible and 1 means certain. The complement rule gives P(not A) = 1 − P(A) because every outcome is either in A or outside A. The union rule P(A ∪ B) = P(A) + P(B) − P(A ∩ B) — inclusion-exclusion — subtracts the overlap that would otherwise be double-counted. The conditional definition P(A | B) = P(A ∩ B) / P(B) rescales the sample space to only the outcomes where B occurred. Two events are independent when P(A | B) = P(A); equivalently, P(A ∩ B) = P(A) × P(B). Two events are mutually exclusive when P(A ∩ B) = 0, in which case the union collapses to P(A) + P(B). Independence and mutual exclusivity are different concepts — in fact, two events with non-zero probabilities cannot be both.

Example Problem

A factory has two independent production lines. Line A produces a defect-free unit with probability P(A) = 0.6; line B does so with probability P(B) = 0.4. What are the joint, union, and complement probabilities? If we additionally know that P(A ∩ B) = 0.18 (so the lines are not actually independent), what is P(A | B)?

  1. Identify the inputs. P(A) = 0.6, P(B) = 0.4, and (for the conditional case) P(A ∩ B) = 0.18. Independence is given for the first three questions.
  2. Complement: P(not A) = 1 − P(A) = 1 − 0.6 = 0.4. The probability that line A does NOT produce a defect-free unit is 40%.
  3. Joint, assuming independence: P(A and B) = P(A) × P(B) = 0.6 × 0.4 = 0.24. Both lines produce defect-free units 24% of the time.
  4. Union: P(A or B) = P(A) + P(B) − P(A and B) = 0.6 + 0.4 − 0.24 = 0.76. At least one line produces a defect-free unit 76% of the time.
  5. Conditional, using the given P(A ∩ B) = 0.18: P(A | B) = P(A ∩ B) / P(B) = 0.18 / 0.4 = 0.45. Given that line B produced a defect-free unit, the probability that line A also did is 45%.
  6. Sanity check: 0.45 ≠ 0.6 = P(A), so under the observed joint probability the lines are NOT independent. Independent lines would have given P(A | B) = P(A) = 0.6.

The canonical case P(A and B) = 0.24, P(A or B) = 0.76, P(not A) = 0.4, and P(A | B) = 0.45 (with P(A ∩ B) = 0.18, P(B) = 0.4) is the verified baseline used by the calculator's tests.

Key Concepts

A few definitions tie the formulas together. The complement of A is the event 'A does not occur' and has probability 1 − P(A). The intersection A ∩ B is the event 'both A and B occur'; its probability equals P(A) × P(B) only when the events are independent. The union A ∪ B is 'A or B or both' and follows the inclusion-exclusion identity P(A) + P(B) − P(A ∩ B). The conditional P(A | B) = P(A ∩ B) / P(B) measures the probability of A inside the restricted sample space where B has already occurred. Two events are independent when knowing one tells you nothing about the other — equivalently, P(A | B) = P(A) and P(A ∩ B) = P(A) × P(B). Two events are mutually exclusive when they cannot both occur — P(A ∩ B) = 0 — so the union simplifies to P(A) + P(B). Independence and mutual exclusivity describe orthogonal relationships and (for non-trivial events) cannot both hold. Finally, Bayes' theorem inverts the conditioning direction: P(A | B) = P(B | A) × P(A) / P(B). It is the cornerstone of every test-interpretation, spam-filter, and updating-belief calculation.

Applications

  • Insurance pricing — actuaries combine independent loss probabilities with the multiplication rule and union for portfolio-wide claim risk
  • Medical test interpretation — Bayes' theorem inverts P(positive | disease) into P(disease | positive), preventing base-rate neglect
  • Risk analysis and reliability engineering — series and parallel system reliability use P(A and B) and P(A or B) on component failure probabilities
  • Weather forecasting — chance-of-rain aggregates conditional probabilities across atmospheric scenarios using the law of total probability
  • Quality control — joint and conditional probabilities model defects across multiple production lines or inspection stages
  • Gambling and game design — payout tables and house-edge calculations rely on accurate union and intersection probabilities for compound events
  • Spam filtering and search ranking — naive Bayes classifiers use conditional independence assumptions to compute P(spam | features)

Common Mistakes

  • Treating independent events as mutually exclusive (or vice versa). Independent means P(A | B) = P(A); mutually exclusive means P(A ∩ B) = 0. For events with positive probability, both cannot be true.
  • Forgetting to subtract the intersection in the union formula. P(A or B) is NOT P(A) + P(B) unless the events are mutually exclusive — otherwise you double-count the overlap.
  • Confusing P(A | B) with P(B | A). The two are equal only when P(A) = P(B). Use Bayes' theorem to convert: P(A | B) = P(B | A) × P(A) / P(B).
  • Base-rate neglect — ignoring the prior P(A) when interpreting a conditional. A 99%-accurate test for a rare disease still produces mostly false positives because the prior P(disease) is so small.
  • The gambler's fallacy — assuming past independent trials influence future ones. If P(heads) = 0.5 on a fair coin, the probability of heads on the next flip remains 0.5 regardless of how many tails just came up.
  • Adding probabilities that exceed 1. If P(A) + P(B) > 1, the events cannot be mutually exclusive — there must be a non-zero intersection.

Frequently Asked Questions

What is probability?

Probability is a number between 0 and 1 that quantifies how likely an event is to occur. A probability of 0 means the event is impossible and a probability of 1 means the event is certain. Probabilities can be interpreted as long-run relative frequencies (the fraction of trials in which the event happens over many repetitions) or as degrees of belief (Bayesian interpretation).

How do you calculate P(A and B)?

When events A and B are independent, multiply their individual probabilities: P(A and B) = P(A) × P(B). For example, two independent coin flips landing heads gives P = 0.5 × 0.5 = 0.25. When the events are not independent, use the multiplication rule with a conditional: P(A and B) = P(A | B) × P(B). You cannot just multiply marginals if the events influence each other.

How do you calculate P(A or B)?

Use the inclusion-exclusion rule: P(A or B) = P(A) + P(B) − P(A and B). The intersection is subtracted so the overlap is not counted twice. For mutually exclusive events, P(A and B) = 0 and the formula simplifies to P(A) + P(B). Example: if P(A) = 0.6, P(B) = 0.4, and P(A ∩ B) = 0.24, then P(A or B) = 0.6 + 0.4 − 0.24 = 0.76.

What is the difference between independent and mutually exclusive events?

Independent events do not influence each other — knowing one occurred tells you nothing about the other, so P(A | B) = P(A) and P(A ∩ B) = P(A) × P(B). Mutually exclusive events cannot both occur — P(A ∩ B) = 0, so if you know B happened, A definitely did not. For any two events with non-zero probabilities, both cannot be true simultaneously: independence requires P(A ∩ B) = P(A) × P(B) > 0, while mutual exclusivity requires P(A ∩ B) = 0.

What is conditional probability?

Conditional probability P(A | B) is the probability that event A occurs given that event B has occurred. It is defined as P(A | B) = P(A ∩ B) / P(B), which rescales the sample space to only the outcomes where B happened. For independent events, conditioning has no effect: P(A | B) = P(A). The conditional definition is the foundation of Bayes' theorem and most modern statistical inference.

What is Bayes' theorem?

Bayes' theorem inverts the conditioning direction: P(A | B) = P(B | A) × P(A) / P(B). It lets you update a prior belief P(A) into a posterior P(A | B) after observing evidence B. The classic application is medical testing: P(disease | positive test) = P(positive | disease) × P(disease) / P(positive). Even a 99%-accurate test can produce mostly false positives for a rare disease because the prior P(disease) is so small.

How do you convert probability to odds?

Odds in favor of A are P(A) / (1 − P(A)). For P(A) = 0.75, the odds in favor are 0.75 / 0.25 = 3, usually written as 3 : 1. Odds against are the reciprocal: (1 − P(A)) / P(A) = 1/3, or 1 : 3. To convert odds back to probability, use P(A) = odds / (1 + odds) — e.g., 3 : 1 odds give P = 3 / 4 = 0.75.

Can a probability be greater than 1 or less than 0?

No. By definition every probability lies in the closed interval [0, 1]. Values outside this range are mathematically invalid and usually indicate an error in setup — for example, summing the probabilities of non-mutually-exclusive events without subtracting the intersection. This calculator returns no result when any input falls outside [0, 1] or when the inputs are mutually inconsistent (for instance, P(A ∩ B) > min(P(A), P(B)), which is impossible in any valid probability space).

Reference: Standard introductory probability definitions: complement, joint, union (inclusion-exclusion), conditional probability, independence, mutual exclusivity, and odds. Canonical case P(A and B) = 0.24, P(A or B) = 0.76, P(not A) = 0.4, P(A | B) = 0.45 verified arithmetically and via round-trip identities in Calculator.test.ts.

Probability Formulas

Four core operations on event probabilities P(A), P(B), and their intersection P(A ∩ B). Every probability lies in the closed interval [0, 1].

P(not A) = 1 − P(A)
P(A and B) = P(A) × P(B) (independent)
P(A or B) = P(A) + P(B) − P(A ∩ B)
P(A | B) = P(A ∩ B) / P(B)

Where:

  • P(A) is the probability that event A occurs
  • P(B) is the probability that event B occurs
  • P(A ∩ B) is the joint probability that both A and B occur — also written P(A and B)
  • P(A ∪ B) is the union — A or B (or both) — also written P(A or B)
  • P(A | B) is the conditional probability of A given that B has occurred
Two-circle Venn diagram for probability — A, B, intersection A ∩ B, and union A ∪ BABA ∩ BUnion A ∪ B = everything inside either circle

Two events A and B. The shaded lens is the intersection P(A ∩ B); the union P(A ∪ B) covers everything inside either circle.

Worked Examples

Two Dice Rolls

Two fair dice are rolled. What is the probability that both show a 6?

Each die roll is independent, so multiply the marginal probabilities.

  • P(A) = P(first die shows 6) = 1/6 ≈ 0.1667
  • P(B) = P(second die shows 6) = 1/6 ≈ 0.1667
  • Independent events: P(A and B) = P(A) × P(B) = 1/6 × 1/6 = 1/36
  • Decimal: 1/36 ≈ 0.0278 (about 2.78%)

P(both sixes) ≈ 0.0278 (2.78%)

Card Draw

Drawing one card from a 52-card deck — what is the probability the card is a heart OR a face card?

These events overlap (the J, Q, K of hearts), so apply inclusion-exclusion.

  • P(heart) = 13/52 = 0.25
  • P(face card) = 12/52 ≈ 0.2308
  • Intersection P(heart AND face card) = 3/52 ≈ 0.0577
  • P(heart or face) = 0.25 + 0.2308 − 0.0577 = 0.4231

P(heart or face card) ≈ 0.4231 (42.31%)

Medical Test Interpretation

Of patients with a confirmed flu (event B), 90% test positive (event A). Given P(A ∩ B) = 0.18 and P(B) = 0.4, what is P(A | B)?

Use the definition of conditional probability — restrict the sample space to outcomes where B occurred.

  • Inputs: P(A ∩ B) = 0.18, P(B) = 0.4
  • Formula: P(A | B) = P(A ∩ B) / P(B)
  • Substitute: P(A | B) = 0.18 / 0.4
  • Divide: 0.18 / 0.4 = 0.45

P(A | B) = 0.45 (45%)

Related Calculators

Related Sites