# Expectation of a function of a distribution?

The question I'm looking at involves evaluating:

$$E[\frac{(n-1)}{(n-1+X_n)}]$$ for n >= 2

Xn is a random variable with a negative binomial distribution, equivalent to Binomial(p, -n).

How would I go about evaluating this expectation? I've never dealt with taking the expectation of a function which used the parameter of the number of trials and don't know where to start.

I know that the solution is 1-p, but I do not know how to get there.

• Just do it the standard way; compute$\sum_{i=1}^{\infty}\frac{n-1}{n-1+k}p_k$, where $p_k$ is the probability of $X_n=k$. – R. Feng Nov 5 '17 at 2:05

## 1 Answer

\begin{eqnarray} \sum_{k=0}^\infty \frac{(n-1)}{n-1+k} \binom{n+k-1}{k}p^k(1-p)^n & = & \sum_{k=0}^\infty \binom{n+k-2}{k}p^k(1-p)^n \\ & = & (1-p)\sum_{k=0}^\infty \binom{n+k-2}{k}p^k(1-p)^{n-1} \\ & = & 1-p \end{eqnarray}

Try to fill the missing steps by your own!

• Thank you very much for your response. As for your substitution for p_k - would the exponent of (1-p) be n-k, instead of n? From my notes it seems that this would be the PMF. – L. Wang Nov 5 '17 at 2:30
• @LawrenceWang Isn't the PMF exactly defined as $P(X_n=k), k=1,2,\ldots$? The expectation, by the way, is the weighted average of the PMF. – R. Feng Nov 5 '17 at 2:32
• My confusion stems from the last step, where the summation is equal to one. I assume that this is because the summation expression is the PMF and the summation of all P{X = k} from k = 1 to infinity must equal one. However, the PMF of a negative binomial would have (1-p)^(n-k), would it not? Looking here: link Edit: Ah - were you denoting n as the number of failures, and not the number of trials? If so, that makes sense. – L. Wang Nov 5 '17 at 2:38
• @LawrenceWang Thanks for the reply. I realized that there are alternative formulations of negative binomial distribution, see this link en.wikipedia.org/wiki/Negative_binomial_distribution. My version counts k successes before n failures, while yours counts n trials required given k successes. Using your definition, I failed to calculate the desired result. Is your problem using the same formulation as in your link? – R. Feng Nov 5 '17 at 2:51
• I actually believe that your interpretation is correct and I interpreted it wrong, apologies. I think I understand everything now except for the very first step. In the combination, why do we use (n+k-1) instead of (n+k)? I understand that this allows us to simplify greatly, but if n+k is the total number of trials, is that not what we would take in the top of the combination? Many thanks again for your help. – L. Wang Nov 5 '17 at 2:56