(Geo for geometric random variable, NB for negative binomial)
Let $X_1,\ldots,X_n\sim\text{Geo}(1/n)$ be i.i.d and let $X=\sum_{i=1}^nX_i$, I saw on wikipedia that $X\sim\text{NB}(n,1/n)$. However, when taking expectations, I have on the one hand that $$\mathbb{E}X=\mathbb{E}\sum_{i=1}^nX_i=\sum_{i=1}^n\mathbb{E}X_i=\sum_{i=1}^n\frac{1}{1/n}=n^2$$ and on the other hand I have that $$\mathbb{E}X=\frac{n\cdot1/n}{1-1/n}=\frac{1}{1-1/n}$$ using the formula for expectation of a negative binomial variable (also from wikipedia).
Clearly there's a mistake somewhere but I'm drawing a blank and would appreciate if anyone could explain whats going wrong.
There are two common variations of the geometric distribution. The first counts the total number of trials until the first success (where the probability of success is $p$). The second counts the number of failures until the first success. The difference is that $0$ is in the support of the second distribution, and its expected value is $(1-p)/p$.
The negative binomial distribution $\text{NB}(r, p)$ counts the number of successes until $r$ failures have occurred. So a $\text{Geo}(p)$ random variable (in the second sense) is the same as a $\text{NB}(1, 1-p)$ random variable (by flipping the meaning of "success" and "failure). So a sum of $n$ $\text{Geo}(1/n)$ random variables (of the second kind) is a $\text{NB}(n, 1-1/n)$ random variable.