Probability Calculator

Give it the chance of a single try, written the way you already say it out loud as 1 in 6, 17% or 0.17, then set how many tries you get. You get the odds of at least one hit, of none at all, of exactly k hits, plus the number of tries needed to pass a 50, 90 or 99 percent chance.

Repeated trial probability worktable

Load an example
Chance it happens at least once0%

It never happens0%Every try misses.
Exactly k hits0%
At most k hits0%
At least k hits0%
Expected hits0
Most likely count0The outcome you see more often than any other.

Where the hits land

Tries needed to pass

At this per-try chance.

TargetTries

The counting behind the numbers

Exact integer values for your current n and k, worked out with big integers rather than floating point.

C(n, k)0Ways to pick which k tries are the hits, order ignored.
P(n, k)0Same picks with the order kept.
n!1Orderings of all n tries.

Four rolls at 1 in 6 is not a 4 in 6 chance

Ask someone the odds of rolling at least one six in four rolls and most people add: four rolls, one in six each, so four in six. Around 67 percent. Follow the same logic to seven rolls and you get more than 100 percent, which is where the method falls apart. Probabilities of separate tries do not add. Two coin flips do not guarantee heads.

Count the misses instead. One roll misses five times in six. Four rolls all miss with probability (5/6)4, which works out to 0.4823. Anything other than four misses is at least one six, so the answer is 1 minus 0.4823, or 51.775 percent. Barely better than a coin flip, not the two thirds people expect. The whole panel above runs on that one subtraction:

P(at least one) = 1 - (1 - p)n

The 63 percent rule worth memorising

When the number of tries matches the denominator of a 1 in N chance, the answer settles close to 63.2 percent every time:

The limit is 1 - 1/e, near 63.212 percent, reached from above as N grows.
Chance per tryTriesAt least one
1 in 101065.132%
1 in 10010063.397%
1 in 1,0001,00063.231%
1 in 100,000100,00063.212%

Keep the number handy as a sanity check. A 1 in 200 event over 200 attempts sits near two in three, nowhere near certain. Pushing the same event to a 99 percent chance takes 918 attempts, and the table on the right of the panel prints that figure for whatever chance you enter.

What each readout means

The six tiles answer different questions, and mixing them up is the second most common mistake after adding probabilities.

  • Exactly k is a single bar of the chart. Ten flips landing exactly five heads happens 24.61 percent of the time, so the most likely outcome of a fair coin is still the outcome you see three runs in four.
  • At least k stacks that bar and everything to its right. It answers "did I clear the bar", which is usually the question you care about.
  • At most k stacks the bar and everything to the left, zero included. At most k and at least k overlap at exactly k, so they sum to more than 100 percent.
  • Expected hits is n times p, an average across many repeats. It is not a prediction of one run and it does not have to be a whole number.
  • Most likely count is floor((n+1)p), the tallest bar. For 10 tries at 25 percent the expected value is 2.5 while the most likely count is 2.

An expected value above 1 is no guarantee. Three tries at 40 percent gives 1.2 expected hits, and yet 21.6 percent of runs end with nothing at all. Averages describe a pile of runs, never the one in front of you.

The chart shades every bar past your k in a lighter tone, so the at-least-k total is the shaded block plus the bar you selected. On wide inputs the chart shows a 41-bar window centred on the average rather than every count from 0 to n, since a chart of 100,000 bars tells you nothing.

Small chances break the obvious formula

Write 1 - Math.pow(1 - p, n) in a spreadsheet and it works fine at 1 in 6. Take p down to 1 in 10 million and the digits fall apart. A 64-bit float stores 1 - p as 0.9999999000000000, dropping the tail of the number you subtracted, and the final subtraction of two numbers close to 1 throws away most of the remaining precision. The answer comes back with three or four believable digits at best.

This page never forms 1 - p in floating point. It computes the log first and exponentiates once:

  • No hits at all uses exp(n × log1p(-p)), where log1p is built to keep precision near zero.
  • At least one hit uses -expm1(n × log1p(-p)), which computes the subtraction from 1 in one accurate step.
  • Exactly k hits runs through log-gamma, so a term like 100000! never has to exist as a number. Direct factorials overflow a double past 170.

Load the lottery example to see the difference. A 1 in 13,983,816 jackpot across 100 tickets returns 7.1512 × 10-6 here, with digits you may check against an exact calculation. Reaching an even 50 percent chance takes 9,692,842 tickets, roughly one ticket for every 1.4 people in London.

Independent tries, and when the assumption fails

Every number on this page assumes two things: tries do not influence each other, and p stays fixed from the first try to the last. Break either one and the results turn optimistic, usually in the direction that flatters your plan.

  • Drawing without replacement. Pulling five cards from a deck changes the odds on every draw. The right model is hypergeometric. The binomial approximation holds up when the population is at least twenty times the sample, so 5 cards out of 52 is a stretch and 5 sampled units out of 5,000 is fine.
  • Correlated failures. Three retries against an API look like a 99.9 percent success rate at 90 percent each. If the failure was the service being down, all three retries fail for one reason and the real number is closer to 90 percent.
  • Drifting rates. Weather, conversion rates and machine failure rates all move over time. A yearly average applied day by day understates the clustering.
  • Selective counting. Rolling until you get a six and then reporting four rolls is not the same experiment as rolling four times. Stopping rules change the distribution.

What this page will not do

Tries are capped at 100,000, which keeps every readout instant. Exact integer output for C(n, k) and P(n, k) switches to scientific notation past 21 digits and past n of 1,200, since a 3,000-digit integer is not something you read off a screen. Conditional probability and Bayes theorem answer a different question, namely how learning one fact shifts the odds of another, and neither is modelled here. Continuous quantities such as heights or wait times need the normal distribution calculator, counts of rare events over a stretch of time fit the Poisson calculator, and anything with rules too tangled to write as a formula belongs in the Monte Carlo simulator.

Questions about repeated trial probability

How the inputs are read, what the readouts mean, and where the model stops applying.

How do I write the chance of a single try?

Six forms work: 1 in 6, the fraction 1/6, a percentage such as 17%, a decimal such as 0.17, odds written 1 to 5 or 1:5, and a bare number above 1 such as 25, which is read as 25 percent. The line under the field repeats how your entry was understood before any result is shown.

Why is rolling a six in four rolls not a 4 in 6 chance?

Probabilities of separate tries do not add. Multiply the misses instead: each roll misses 5 times in 6, four rolls all miss with probability (5/6) to the fourth power, or 48.225 percent. The remaining 51.775 percent covers every outcome with at least one six.

What is the difference between exactly 2 hits and at least 2 hits?

Exactly 2 counts runs that finish with two hits and no more, a single bar of the chart. At least 2 adds every run with 2, 3, 4 or more hits. The at-least figure is always the larger of the two whenever n is above k.

How many tries do I need for a 90 percent chance?

Rearrange the formula: n = log(1 - 0.9) / log(1 - p). At a 1 percent chance per try you need 230 tries, at 5 percent you need 45. The table beside the chart prints the 50, 90, 99 and 99.9 percent thresholds for whatever chance you type in.

Does this handle cards drawn without replacement?

No. Every try here uses the same fixed chance, so drawing without replacement is modelled poorly when the sample is a large share of the pool. Treat the binomial answer as an approximation only when the population is at least twenty times the number of draws.

Does it cover conditional probability or Bayes theorem?

No. Those describe how one event changes the odds of another, while every try on this page carries the same fixed chance and ignores what came before. Use the Monte Carlo simulator when the rules of your problem are too tangled to write as a single formula.

Why does the combination value turn into scientific notation?

Exact integers are shown up to 21 digits and up to n of 1,200. Past either limit the value is computed through log-gamma and printed in scientific form. C(1000, 500) alone runs to 300 digits, which is accurate but unreadable.

What does the expected hits number promise?

Nothing about a single run. It is the long-run average, n times p, across many repeats of the same experiment. An expected value of 1.2 hits still leaves a 21.6 percent chance of zero hits when n is 3 and p is 0.4.

Is my input sent anywhere?

No. The arithmetic runs in your browser and nothing is uploaded, logged or stored. The page keeps working with the network switched off once it has loaded.