The chance your first win comes after exactly x misses.
dgeom(x, prob)
Key idea
Start from the story, not the formula: you keep trying and STOP the instant you win. "First win on the 3rd try" can only be one story — lose, lose, win. (e.g. try 3 → ✗ ✗ ✓)
Why must you lose first? Winning on the 3rd try automatically means you did NOT win on tries 1 and 2 — a win sooner would have ended the game. (e.g. win on try 3 = no win on 1 or 2)
Why multiply? The misses and the win must all happen in a row (miss AND miss AND win). "AND" means multiply — like a combination lock where every digit has to be right. (e.g. 0.8 × 0.8 × 0.2)
R counts the misses (failures) before the first win, so x can be 0 (win on the very first try). (e.g. x = 0 means win first try)
It is largest at x = 0 and shrinks as x grows, because a quick win is the single most likely outcome. (e.g. dgeom(1,0.5) = 0.25)
"But surely more tries means a bigger chance?" Right — but that is a DIFFERENT question. "Win EXACTLY on try x" (this chart) shrinks; "won AT LEAST ONCE by try x" grows toward 1. Both are correct. (e.g. exactly ↓ vs by-then ↑)
That growing, cumulative chance is what pgeom gives: 1 minus the chance of always losing — after x tries it is 1 − (1−p)ˣ, which climbs toward 1 the more you try. (In R, pgeom counts misses, so for x tries you call pgeom(x − 1, p).) (e.g. 1 − 0.8⁴ = 0.59)
So the formula just shortens the picture: x misses each with chance (1−p), then one win with chance p. (e.g. 0.8ˣ × 0.2)
The number of ✗ marks is x, and there is always exactly one ✓ at the end — so P(X = x) = 0.8ˣ × 0.2.
Definition
P(X=x)=(1−p)xp
x
number of misses before the first win
p
chance of success each try
q
1 − p, the chance of a miss
T
the try the first win lands on (T = x + 1)
(1−p)x
x misses in a row
In plain words
Picture Chad playing a game and stopping the instant he wins. If he wins on the 3rd try, the only possible story is lose → lose → win: the two earlier tries MUST be losses, because winning sooner would have ended the game. So x just counts those losses before the one win. Quick check: if his first win is on the 5th try, the run is ✗ ✗ ✗ ✗ ✓ — and 0.8⁴ × 0.2 is simply that picture written short, not a scary new thing.
Where you'd use it
Rolling a die, a six has chance 1/6 each try. The chance you miss exactly twice and then roll your first six on the third try is dgeom(2, 1/6) ≈ 12%.
A salesperson closes 20% of cold calls. The chance the first sale comes after exactly 3 misses (on the fourth call) is dgeom(3, 0.2) ≈ 10%.
Flipping a fair coin (prob = 0.5), the chance of exactly 2 tails before your first heads is dgeom(2, 0.5) = 0.125, since a quick win is always the most likely outcome.
Worked example 7
A fair coin (prob = 0.5). The chance of 2 misses before your first heads is 0.125.
Frequently asked questions
What does dgeom count?
The number of failures before the first success (starting at 0) — one less than the trial number used in many textbooks.