# Find expected value of balls sampling [duplicate]

I have a difficulty with understanding following example: We have $N$ balls amongs them there are $b$ white colored. We take from them $n$ balls(we take them without replecments). Let $X$ be a number of white balls we get. Calculate $EX$. Now lets have $X=\sum^{N} X_i$ where $X_i$ is $1$ if we get white ball in $i-th$ sampling and $0$ otherwise. Then we calculte $E X_i=P(X_i=1)=\frac{b}{N}$ And so $E X=\frac{n\cdot b}{N}$. I can agree that if we take one ball probability will be indeed $\frac{b}{N}$, but if we take another there will be one ball less, intuitively that should affect probability.

• Linearity of expectation! – Angina Seng Jun 22 '17 at 5:48
• The conditional probability $P(X_j|X_i), j>i$ of sampling without replacement will be different but the unconditional probabilities $P(X_k) \forall k$ will be same. – Dhruv Kohli - expiTTp1z0 Jun 22 '17 at 5:50
• @Max thanks, that thread was helpful. To clarify : I sample balls but I don't look for each one of them until I have all $n$? – vanHohenheim Jun 22 '17 at 6:22

I can agree that if we take one ball probability will be indeed $b/N$, but if we take another there will be one ball less, intuitively that should affect probability.

Sure, the probability that the second ball is also blue if given that the first ball is blue will be $\bbox[lemonchiffon]{(b-1)/(N-1)}$.   Indisputably.

However, that condition happens with probability of $b/N$ while the first ball will be red with probability of $(N-b)/N$, and too the probability that the second ball will be blue if given the first is red is $\bbox[lemonchiffon]{b/(N-1)}$.   Those are conditional probabilities!

So, the marginal probability that the second ball is blue will be:$${\quad\dfrac{b}{N}\cdotp\dfrac{b-1}{N-1}+\dfrac{N-b}{N}\cdotp\dfrac{b}{N-1} \\[2ex] =\dfrac{b\,(b-1+N-b)}{N\,(N-1)} \\[2ex] = \dfrac{b}{N} }$$

So if $b/N$ is my expectation for the count of blue in the first ball, and it is also my expectation for the count of blue in the second ball, then the expectation for the count of blue among the first two balls is $2b/N$.

$${\mathsf E(X_1+X_2)~}{= {(0{+}0)\mathsf P(X_1{=}0,X_2{=}0)+(1+0)\mathsf P(X_1{=}1,X_2{=}0)+(0+1)\mathsf P(X_1{=}0,X_2{=}1)+(1+1)\mathsf P(X_1{=}1,X_2{=}1)} \\ = {0+\tfrac{b}{N}\tfrac{N-b}{N-1}+\tfrac{N-b}{N}\tfrac{b}{N-1}+2\tfrac{b}{N}\tfrac{b-1}{N-1}}\\ = {(0+\tfrac {b(N-b+b-1)}{N(N-1)})+(0+\tfrac{(N-b+b-1)b}{N(N-1)})}\\={(0+\tfrac bN)+(0+\tfrac bN)}\\={\mathsf E(X_1)+\mathsf E(X_2)}}$$

Does that give you a feel for what is happening?

• Thanks, you saved my day :) – vanHohenheim Jun 22 '17 at 7:26