# Expected value of Hypergeometric distribution using indicator random variables

I am trying to understand how to calculate the expected value of a hypergeometric variable using indicator random variables. The derivation that I read in the book (Introduction to Probability Theory, Hoel Port Stone) is as follows:

Assume the population size to be $$r$$, of which $$r_1$$ are of type 1 and $$r-r_1$$ are of type 2. A sample of size $$n$$ is drawn without replacement from this population. Let $$X_1, X_2, ... X_n$$ be indicator random variables where $$X_i = 1$$ if and only if the ith element in the sample is of type 1. Then,

$$E[X_i] = P(X_i = 1) = \frac{r_1}{r}$$

I don't understand how the expectation of $$X_i$$ is the same $$\forall i$$. Since sampling is done without replacement in hypergeometric distribution, the probability of ith element in the sample being type 1 shouldn't be the same $$\forall i$$.

Can someone explain why this is true?

Edit: We can write,

$$P(X_i=1) = \sum_{x_1}\sum_{x_2}...\sum_{x_{i-1}} P(X_1=x_1, X_2=x_2, ... , X_{i-1} = x_{i-1}, X_i=1)$$

where $$x_i$$'s take values $$0$$ or $$1$$.

Can we compute this sum to show $$P(X_i=1) = \frac{r_1}{r}?$$

Since types don't have any preference for positions, the probability that type $$1$$ is at any position will be the same as its being at the start,

i.e. $$\Bbb P(X_i) = \Bbb P(X_1) = \frac {r_1}{r}$$

Now the expectation of an indicator random variable is just the probability of the event it indicates, thus $$\Bbb E[X_i ] = \frac{r_i}{r},$$

and by linearity of expectation, which applies even when the variables are not independent, we can get the final expectation as $$\Bbb E[X] = \Sigma \Bbb E[X_i]$$

• suppose the sample of size n is drawn one by one, then, at the ith draw, the population left is r - i + 1. The probability that ith draw will be of type 1 is still r1/r? Jun 15, 2022 at 17:23
• The whole point in using the expectation route is to find the unconditional probability with no a priori information of picking a type $1$, and use linearity of expectation to get $E[X]$. Jun 15, 2022 at 18:10
• I know this is correct, but I don't get the logic correctly. The fact that Xi denotes the ith sample implies we already know that i-1 samples have been drawn, right? Jun 16, 2022 at 3:30
• Yes, however, it does not denote that we know what they are. Jun 16, 2022 at 5:04
• Suppose there is one type $1$ in $10$. P($1st$ is type $1)$ = $\frac1{10}.$ P($2nd$ is type $1$) = $\frac9{10}\frac19 = \frac1{10}$, etc right upto P($10th$ is type $1$) Then can you see that if, instead there were $3$ type $1's$ in $10$, the probability that a type $1$ is found in any position will be $\frac{3}{10} ?$ Jun 16, 2022 at 6:00

Take a population of size $$52$$, of which $$13$$ are of type heart, and $$52-13$$ are of type not-heart. Draw a sampling of size $$5$$.

$$X_k$$ is the indicator that the k-th sample is of type heart. $$\mathsf P(X_k=1)=13/52$$.

This marginal probability is true for each of the five samples.

Now, it is true that the samples are not independent. However, we are not measuring their joint probability, just the marginals - the probability that a sample is of type-heart without any information on the other samples -- so the dependency has no affect on our calculations.

This is why the Linearity of Expectation has such leverage that we use it often.

$$\mathsf E(X_1+X_2+X_3+X_4+X_5)~{=\mathsf E(X_1)+\mathsf E(X_2)+\mathsf E(X_3)+\mathsf E(X_4)+\mathsf E(X_5)\\=\dfrac{5\times 13}{52}}$$

• I understand the rest of the part clearly. The only problem I am facing is understanding your second statement. Can you expand a bit on that? Can we use the basics to prove the second statement? For example: P(X2=1) = P(X1=0, X2=1) + P(X1=1, X2=1) using this eqn I can see that P(X2=1) is indeed 13/52 (i.e. 1/4) but can we compute the sum for P(Xk=1)? Jun 16, 2022 at 4:22
• Its just the Law of Total Probability $$\mathsf P(X_k=1)=\mathsf P(X_k=1 ,\bigcup_{i=0}^{n-1} \{(\sum_{j=1}^n X_j)-X_k = i\})$$ Jun 16, 2022 at 4:29
• yes, I know that, so can we use the law of total probability to prove the constant probability of Xi's? Jun 16, 2022 at 4:32
• Well, we can, indeed. However, we just need to establish that each item from the population of $52$ has no bias for being selected on sample $k$, and $13$ among them are type-$\heartsuit$. Jun 16, 2022 at 4:40
• Thanks for your answer! I understood the idea, and now your answer makes complete sense to me. Jun 17, 2022 at 12:04

Reading this helped me understand the symmetry in sampling without replacement.