# How to demonstrate that the cumulative distribution functions of a binomial and negative binomial variable are complements?

I am struggling with how to properly approach this problem. The wording is as follows:

Suppose that $X$ has a binomial$(n,p)$ distribution and let $Y$ have a negative binomial$(r, p)$ distribution (below) . Show that $F_X (r − 1) = 1 − F_Y (n − r)$.

I have been attempting a solution for several hours, but all of my work seems to basically go in circles without coming up with an actual proof.

My understanding is that $F_X (r - 1)$ is the CDF that demonstrates probabilities that $r-1$ successes have occurred before some amount of trials that have been performed, and $F_Y (n-r)$ is the probability that $n-r$ failures have occurred before a given amount of successes. Together, they add up to the sample space of possibilities, i.e. within $r-1+n-r$ trials (i.e., $n-1$ trials), a given number of successes and failures have occurred, with the $r^\text{th}$ success coming on the $n^\text{th}$ trial. I cannot see how to mathematically demonstrate these two distributions as complements, however.

Consider $n$ trials on which $r-1$ or fewer successes have occurred. This event can be described as $(X\leq r-1)$ and its probability is $P(X\leq r-1) = F_X(r-1)$. But this event can also be described as the event that at least $n-r+1$ failures have occurred before the $r$-th success has been observed, and so its probability can also be expressed as $$P(Y \geq n-r+1) = P(Y>n-r) = 1-F_Y(n-r)$$. Hence we have that $F_X(r-1) = 1-F_Y(n-r)$.