Understanding R's Definition In R,
the syntax for the geometric cumulative distribution function is
pgeom(q, prob, lower.tail = TRUE)
q : The number of failures before the first success occurs.
prob : The probability of success in a single trial $(p)$.
lower.tail = TRUE (default) : Calculates the probability of experiencing q or fewer failures before the first success, i.e., P(X <_ q) where X is the number of failures.
This means: Success on the 1st trial = 0 failures (q=0)
Success on the 2nd trial = 1 failure (q=1)
Success on the 3rd trial = 2 failures (q=2)