ForHosting KIT · Math

Or probability calculator

With P(A) of 0.3, P(B) of 0.4 and an overlap of 0.1, the chance that A or B happens is 0.6: add both, then subtract the overlap once so it is not counted twice. Impossible triples are flagged. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
P a
0.3
P b
0.4
P a and b
0.1
You get
P a or b
0.6

The probability of A or B is the chance that at least one of the two events occurs. In every probability course that identity is written as the addition rule P(A union B) equals P(A) plus P(B) minus P(A intersection B): you add the two individual probabilities and then subtract the intersection so the overlapping region is not counted twice. This or-probability calculator takes those three numbers, checks that each lies in the closed unit interval, and rejects any triple where the intersection exceeds either individual probability, because no event can share more mass than it actually has. When the triple is feasible it returns the union probability, the same figure a Venn diagram would label on the combined region. Mutually exclusive events are just the special case where the intersection is zero and the union collapses to a plain sum.

What P(A or B) means and why you subtract the intersection

In classical probability every event is assigned a number in the closed unit interval that respects countable additivity. The union A or B is the set of outcomes that belong to A, to B, or to both, so its probability is the measure of that combined region.

Adding P(A) and P(B) counts the intersection twice — once as part of A and once as part of B — which is why the addition rule subtracts P(A and B) exactly once: P(A union B) equals P(A) plus P(B) minus P(A intersection B). When the two events cannot happen together they are mutually exclusive, the intersection is empty, its probability is zero, and the union collapses to a plain sum.

That special case is common in exam questions about a single die face or a single card rank, but it is not the default: most real events overlap. The intersection also cannot be smaller than the larger of zero and P(A) plus P(B) minus one, or the union would exceed one. Together those Fréchet–Hoeffding bounds and the addition rule give a complete classroom-grade check for a three-number probability triple without requiring a full sample-space model or a drawn Venn diagram.

Use the returned formula string as a caption next to the number so learners see the identity, not only the decimal.

Where an or-probability calculator earns its keep

Classrooms and tutoring platforms use an or-probability calculator so learners can check the addition rule for arbitrary triples without double-counting the overlap by hand. Exam-prep generators need a deterministic oracle that marks wrong an intersection larger than either event instead of silently returning a union that no probability space can realize. Failed validation does not consume balance, so exploratory scripts and classroom labs stay cheap while learners probe the edges.

Do not confuse this landing with a conditional-probability tool that divides a joint by P(B), or with a Bayes calculator that updates a prior from a likelihood: here you already know both marginals and the intersection and only need the union. Keep requests small, pin the rounded union in tests, and you get reproducible or-probabilities for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.

Always verify that the reported intersection sits inside the feasible interval before trusting a hand calculation that mixed a conditional with a joint.

Exam and LMS auto-grading

Mark addition-rule items with an oracle that rejects an intersection larger than either event and never invents a union above one.

Risk and reliability write-ups

Turn two failure rates and a shared-mode rate into P(A or B) for safety notes without importing a full statistics library.

What formula does the or-probability calculator use?

P(A or B) = P(A) + P(B) − P(A and B). The response also flags mutually exclusive events when the intersection is zero.

Why is an intersection larger than P(A) or P(B) rejected?

The shared region is a subset of each event, so P(A and B) cannot exceed either marginal.

What if A and B are mutually exclusive?

Send intersection 0. The same addition rule still applies.

What does the or-probability calculator cost?

The browser tool is free and runs locally.

Can the overlap be too small?

Yes. The overlap cannot be less than P(A) plus P(B) minus one, or the union would go above 1. Together with the upper limit, this tells you whether your three numbers are possible at all.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/stat/or-probability

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/stat/or-probability \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"p_a":0.3,"p_b":0.4,"p_a_and_b":0.1}'
{
  "p_a": 0.3,
  "p_b": 0.4,
  "p_a_and_b": 0.1
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "stat.or_probability",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What P(A or B) means and why you subtract the intersection

The intersection cannot exceed either marginal, because the shared region is a subset of each event; a joint larger than the smaller of P(A) and P(B) cannot exist in any probability space and this calculator rejects it with invalid_input.

Input contract, response shape, and rejected triples

Classic check: P(A) equals 0.3, P(B) equals 0.4, intersection equals 0.1 yields P(A or B) equal to 0.6. Send a JSON body with three required numeric fields. Field p_a is the probability of event A in the closed interval from zero to one; aliases pA, pa, P_A, and prob_a are accepted. Field p_b is the probability of event B in the same interval; aliases pB, pb, P_B, and prob_b map to the same meaning. Field p_a_and_b is the intersection P(A and B); aliases p_ab, joint, intersection, and pAandB work interchangeably. Each value may arrive as a JSON number or as a numeric string; missing fields, empty strings, non-finite values, and numbers outside the unit interval fail with invalid_input naming the field. On success the body echoes p_a, p_b, and p_a_and_b, returns p_a_or_b as the union rounded to twelve decimal places for stable goldens, a mutually_exclusive flag that is true when the intersection is numerically zero, and a formula string restating the addition rule for captions. Pricing is a flat $0.002 per successful request with unit item.

Where an or-probability calculator earns its keep

Risk and reliability write-ups often quote the chance that fault A or fault B occurs from two failure rates and a shared-mode rate; calling a tiny parse endpoint avoids pulling a full statistics package for three numbers.

Classroom and homework checks

Give students P(A), P(B), and an intersection, then check their union and mutually-exclusive reasoning against a deterministic API or free browser result.

Can the returned union be greater than 1?

No. If the implied union would exceed 1, the intersection sits below the Fréchet lower bound and the request is rejected as invalid_input.

Read the full KIT documentation →