Given question: Consider the following sequence of Bernoulli random variables. Each Bernoulli trial has a probability of success p. Let the random variable X be the number of failures until the rth success where r is a positive integer. For example, if r = 3, and the 3rd success occurs at the 10th trial, then X = 7.
(a) Determine the pmf of X. (b) Determine the expected value of X. Note you’ll need to specify the range of X before you carry out the computation. (c) Determine the moment generating function of X.
I have understood that the question is asking for pmf of negative binomial, but do not know for what limits? How do i proceed?
First find $\mathsf P(X=k;r,p)$
The event $\{X=k\}$ is the event of some arrangement of $r-1$ successes and $k$ failures, then one final success, at success rate $p$. You can derive the probablity for that event from first principles.
Or, indeed, you can just use that you recognise that the distribution of $X$ failures before success $r$, with success rate $p$ is negative binomial with appropriate parameters.