Probability Calculator: P(A and B), P(A or B) & At Least Once

Probability calculator for single events, two events and repeated trials. Find P(A and B), P(A or B), P(A given B) and at least once, with full steps.

Probability Calculator

Work out the probability of a single event, of two independent events, of two dependent events, or of an event repeating across a run of trials. Pick a mode, enter your numbers, and press Calculate for the answer with a full worked solution.

Example: drawing a heart from a deck is 13 favourable out of 52 possible.

Type your numbers into the probability calculator above and it returns the answer with every line of working shown. Below are the formulas, the four situations people actually get stuck on, and worked examples you can check against your own homework.

Probability is the share of outcomes that count as a win, out of every outcome that could happen. It runs from 0 to 1. Zero means impossible, one means certain, 0.5 means an even chance.

What is the probability formula?

The probability formula is P(E) = n(E) / n(S), where n(E) is the number of favourable outcomes and n(S) is the number of outcomes in the whole sample space.

Drawing a heart from a standard deck gives 13 favourable cards out of 52, so P = 13/52 = 0.25, or 25%. Rolling a six on one die gives 1 out of 6, so P = 0.1667, or 16.67%.

That formula only holds when every outcome is equally likely. A die qualifies, a person’s height does not, because heights fall along a continuous curve rather than into six equal slots. For those you read the area under the curve from a z table instead of counting outcomes.

Everything else is built on that one line. Simple probability stops there. The other formulas exist to handle two events at once, or the same event repeated.

How to find probability step by step

Five steps, and they work for any single event.

  1. Count every outcome that could happen. A coin has 2, a die has 6, a deck has 52.
  2. Count the outcomes that count as a win. Hearts in a deck: 13.
  3. Divide the second number by the first. 13 divided by 52 is 0.25.
  4. Multiply by 100 if you want a percentage. 0.25 becomes 25%.
  5. Check the answer sits between 0 and 1. If it does not, you have counted something twice or used the wrong total.

The most common error is at step one. People count the outcomes they care about instead of all the outcomes. A deck has 52 cards, not 4 suits.

How do you find the probability of A and B?

The probability of A and B both happening is P(A and B) = P(A) x P(B), when the two events are independent. Multiply them.

Say the chance of rain tomorrow is 0.3 and the chance your bus runs late is 0.2. Neither one affects the other, so both happening is 0.3 x 0.2 = 0.06. That is a 6% chance of a wet morning and a late bus together.

When the events are dependent, the second probability shifts once the first has happened. Then the formula becomes P(A and B) = P(A) x P(B|A).

Drawing two hearts from a deck without putting the first card back is the standard example. The first draw is 13/52 = 0.25. The second is now 12/51 = 0.2353, because one heart and one card are gone. Both hearts together is 0.25 x 0.2353 = 0.0588, which is roughly 1 in 17.

If you had wrongly treated those draws as independent you would have got 0.25 x 0.25 = 0.0625. Close enough to look right, wrong enough to lose the mark.

How do you find the probability of A or B?

The probability of A or B is P(A or B) = P(A) + P(B) – P(A and B). Add the two, then subtract the overlap once.

Using the same rain and bus numbers: 0.3 + 0.2 – 0.06 = 0.44. There is a 44% chance that at least one of the two things goes wrong.

The subtraction is the part people skip. If you just add 0.3 and 0.2 you get 0.5, and you have counted the mornings where both happen twice, once in the rain figure and once in the bus figure.

When two events cannot both happen, they are mutually exclusive and the overlap is zero. Rolling a 3 and rolling a 5 on the same die cannot both be true, so P(3 or 5) = 1/6 + 1/6 = 0.3333 with nothing to subtract.

How do you find the probability of A given B?

The probability of A given B is P(A|B) = P(A and B) / P(B). This is conditional probability, the chance of A once you already know B has happened. Set the calculator above to the dependent events mode and it works as a conditional probability calculator, including the reverse case.

Knowing B narrows the field. You are no longer looking at every outcome, only at the ones where B is true, so the denominator changes from the whole sample space to P(B).

An example with real numbers. P(A) is 0.3, P(B|A) is 0.6, and P(B) on its own is 0.5. First find the overlap: 0.3 x 0.6 = 0.18. Then reverse it: P(A|B) = 0.18 / 0.5 = 0.36.

That reversal is Bayes’ theorem, written as P(A|B) = P(B|A) x P(A) / P(B). The probability of B given A is a separate figure with its own formula. It matters because P(A|B) and P(B|A) are different numbers and people swap them constantly. The chance a test is positive given you are ill is not the chance you are ill given the test is positive.

The same shape turns up in hypothesis testing. A p value is the probability of seeing your data given that the null hypothesis is true, which is why it does not tell you the probability that the null hypothesis is true.

At least one probability, the odds of something happening at least once

The at least one probability formula is P(at least once) = 1 – (1 – p) to the power of n, where p is the chance in one trial and n is the number of trials.

Work out the one way it never happens, then subtract from 1. Counting every way it could happen once, twice, three times and so on takes far longer and gives the same answer.

A one in five chance, tried five times: P(never) = 0.8 to the power of 5 = 0.3277, so P(at least once) = 1 – 0.3277 = 0.6723. Just under 67%.

Here is what surprises people. Small chances stack up fast.

TrialsChance of at least once (p = 0.2)
120%
236%
348.8%
567.23%
1089.26%
2098.85%

Roll a die four times and the chance of at least one six is 51.77%, slightly better than a coin flip. Flip a coin five times and the chance of at least one head is 96.88%, the same worked result the University of Illinois course notes use to demonstrate the complement rule. Take a 1 in 100 shot 100 times and you still only reach 63.4%, not the 100% most people expect.

Use the Repeated trials option in the probability calculator above and it shows the never case, the at least once case, the every single time case, and the expected number of hits. When the question asks for an exact count instead, such as the chance of exactly 3 hits in 10 tries, the binomial distribution calculator is the tool for that.

Independent or dependent, which formula do you need?

The test is simple. Ask whether the first event changes the odds of the second.

  • Two coin flips: independent. The coin has no memory.
  • Two cards drawn without replacement: dependent. The deck is smaller and one card is gone.
  • Two cards drawn with replacement: independent again, because you put the card back and reshuffled.
  • Rain tomorrow and your bus running late: independent for homework purposes, though a careful person would argue rain makes buses late.

Get this wrong and you use P(A) x P(B) where you needed P(A) x P(B|A), and the answer is off in a way that is hard to spot.

The same rules extend past two. To calculate probability for 3 events all happening, multiply all three. For at least one of three, find the chance none of them happen and subtract from 1.

Converting probability to a percentage and to odds

Multiply by 100 for a percentage. A probability of 0.25 is 25%. That is the same conversion the percentage calculator runs when you ask what percent one number is of another.

Odds are a different thing and the two get confused. Probability compares wins to every outcome. Odds compare wins to losses only.

Drawing a heart: probability is 13/52 = 0.25, but odds in favour are 13 to 39, which simplifies to 1 to 3. Same event, two different numbers. When a sportsbook quotes 3 to 1 it is quoting odds, not a 3 in 1 probability, which would be impossible anyway.

Worked examples you can check by hand

Example 1, a single event. A bag holds 4 red marbles and 6 blue. P(red) = 4/10 = 0.4, or 40%. P(not red) = 1 – 0.4 = 0.6.

Example 2, two independent events. Two dice, both showing a six. P = 1/6 x 1/6 = 1/36 = 0.0278, or 2.78%.

Example 3, two dependent events. Two aces drawn from a deck, no replacement. First ace: 4/52 = 0.0769. Second ace: 3/51 = 0.0588. Both: 0.0769 x 0.0588 = 0.0045, about 1 in 221.

Example 4, either event. A die showing an even number or a number above 4. Evens are 2, 4, 6 so P(A) = 3/6. Above 4 are 5, 6 so P(B) = 2/6. The 6 is in both, so P(A and B) = 1/6. P(A or B) = 3/6 + 2/6 – 1/6 = 4/6 = 0.6667.

Example 5, at least once. A machine fails on 3% of runs. Over 20 runs, P(no failures) = 0.97 to the power of 20 = 0.5438, so P(at least one failure) = 0.4562. Nearly a coin flip, from a 3% risk.

Common mistakes

  • Adding probabilities that should be multiplied. “And” multiplies, “or” adds. The word in the question tells you which.
  • Forgetting to subtract the overlap in P(A or B). This one inflates your answer every time.
  • Treating dependent events as independent. Check whether the first event removes something from the pool.
  • Swapping P(A|B) and P(B|A). They are rarely equal and the mix-up is the single most expensive error in this topic.
  • Getting an answer above 1. That is always a mistake, never a result. Probability cannot exceed certainty.
  • Assuming enough tries guarantees the outcome. A hundred attempts at a 1 in 100 chance gives 63.4%, not 100%. There is no number of trials that makes an uncertain event certain.

Try these next

Frequently Asked Questions (FAQs)

What is the probability formula?

P(E) = n(E) / n(S). Divide the number of favourable outcomes by the total number of possible outcomes. A heart from a deck is 13/52 = 0.25.

Can a probability be more than 1?

No. A probability of 1 means the event is certain, and nothing is more certain than certain. If your answer is above 1 you have added when you should have multiplied, or forgotten to subtract an overlap. Percentages follow the same rule and stop at 100%.

What is the probability of an impossible event?

Zero. An impossible event has no favourable outcomes, so n(E) is 0 and the whole fraction is 0. A certain event has n(E) equal to n(S), which gives 1. Every other probability sits between those two.

How do you add probabilities?

Only when the events cannot both happen. Rolling a 3 or a 5 on one die is 1/6 + 1/6 = 0.3333, because one roll cannot be both. If the events can overlap you must subtract the overlap: P(A or B) = P(A) + P(B) – P(A and B).

What is the difference between odds and probability?

Probability compares wins to all outcomes. Odds compare wins to losses. Drawing a heart has a probability of 13/52 = 0.25, but odds in favour of 13 to 39, or 1 to 3. Bookmakers quote odds, exam questions usually want probability.

How do you find the probability of 3 events?

Extend the same rules. For three independent events all happening, multiply all three: P(A) x P(B) x P(C). For at least one of three happening, it is easier to find the chance none of them happen and subtract from 1.

What does P(A|B) mean?

The probability of A given that B has already happened. The vertical bar reads as “given”. It is calculated as P(A and B) / P(B), and it is usually a different number from P(B|A).

What is the at least once rule?

P(at least once) = 1 – P(never). Rather than counting every way an event could occur one or more times, find the single case where it never occurs and subtract that from 1. For n independent trials each with probability p, that gives 1 – (1 – p) to the power of n.

Is a percentage chance the same as probability?

Yes, written differently. Multiply a probability by 100 to get the percentage. A probability of 0.42 is a 42% chance. The calculator above shows both on every line so you can quote whichever your question asks for.

  • Kushagra Verma

    Researcher | BSc. CS + Financial Math

    Kushagra Verma is a researcher with a BSc in Computer Science and Financial Mathematics, focusing on data-driven analysis and real-world applications.

  • Muhammad Abdullah Arshad

    MPhil Statistics Scholar

    M. Abdullah Arshad is an MPhil Statistics scholar and Google-certified data analyst specializing in statistical analysis, data mining, and time series modeling.