Expected value of hypergeometric distribution There's this derivation of the formula for the expected value of hypergeometric distribution which I'm trying to understand:
$$\begin{align}E(X) & =\sum\limits _{x=0}^{n}xP(x)\\
(1) & =\sum\limits _{x=0}^{n}\dfrac{x\left(_{s}C_{x}\right)\left(_{N-s}C_{n-x}\right)}{_{N}C_{n}}\\
(2) & =\sum\limits _{x=0}^{n}\left(_{N-s}C_{n-x}\right)\dfrac{xs!}{x!(s-x)!}\dfrac{n!(N-n)!}{N!}\\
(3) & =\sum\limits _{x=1}^{n}\left(_{N-s}C_{n-x}\right)\dfrac{s(s-1)!}{(x-1)!(s-x)!}\dfrac{n(n-1)!(N-n)!}{N(N-1)!}\\
(4) & =\dfrac{ns}{N}\sum\limits _{x=1}^{n}\dfrac{\left(_{N-s}C_{n-x}\right)\left(_{s-1}C_{x-1}\right)}{_{N-1}C_{n-1}}\\
(5) & =\dfrac{ns}{N}\dfrac{1}{_{N-1}C_{n-1}}\sum\limits _{x=1}^{n}\left(_{N-s}C_{n-x}\right)\left(_{s-1}C_{x-1}\right)\\
(6) & =\dfrac{ns}{N}\dfrac{1}{_{N-1}C_{n-1}}\sum\limits _{x=0}^{n-1}\left(_{N-s}C_{n-1-x}\right)\left(_{s-1}C_{x}\right)\\
(7) & =\dfrac{ns}{N}\dfrac{_{N-1}C_{n-1}}{_{N-1}C_{n-1}}\\
(8) & =\dfrac{ns}{N}
\end{align}
$$
Could you please explain the transition from (5) to (6) and from (6) to (7)?
I don't understand three things:

*

*Why in (6) the summation limit is from $0$ to $n-1$, why is it possible to do so?

*Why in (6) we have $_{s-1}C_{x}$, not $_{s-1}C_{x-1}$, why we added $1$ to $x$?

*How can we go from (6) to (7), why is $\sum\limits _{x=0}^{n-1}\left(_{N-s}C_{n-1-x}\right)\left(_{s-1}C_{x}\right) = _{N-1}C_{n-1}$?

I appreciate any help.
 A: To do it more clearly and avoid confusion, they could have done the step (5) to (6) this way: introduce the new summation variable $x'$ with $x' = x - 1$. Then,
\begin{align}
(5) & =\dfrac{ns}{N}\dfrac{1}{_{N-1}C_{n-1}}\sum\limits _{x=1}^{n}\left(_{N-s}C_{n-x}\right)\left(_{s-1}C_{x-1}\right)\\
(6) & =\dfrac{ns}{N}\dfrac{1}{_{N-1}C_{n-1}}\sum\limits _{x'=0}^{n-1}\left(_{N-s}C_{n-1-x'}\right)\left(_{s-1}C_{x'}\right)\\
\end{align}
But you see, the way you name the summation label is really irrelevant, it is what we call a "dummy variable", so you can actually relabel it as $x$. They just skipped explaining that step.
For the step from (6) to (7), the following identity
$$(1+z)^{N-1} = (1+z)^{N-s}(1+z)^{s-1}$$
is developed with the binomium of Newton,
$$\sum\limits _{n=0}^{N-1} {_{N-1}C_{n}}z^{n} = \left(\sum\limits _{k=0}^{N-s} {_{N-s}C_{k}}z^{k}\right)\left(\sum\limits _{l=0}^{s-1} {_{s-1}C_{l}}z^{l}\right)$$
You have to work out the product on the right hand and arrange terms such that you regroup terms with the same power, or what is equivalent such that $n=k+l$, so that you can compare with the left hand side. Doing that and appropriate relabeling will give you the formula you're looking after.
