if we choose a size $25$ subset of the set: $\{1,2,....100\}$ what is the expectancy of the number of sequential pairs in the subset? expectancy still confuses me, can anybody help?
-
$\begingroup$ Related: math.stackexchange.com/questions/1566418/…. $\endgroup$ – StubbornAtom Dec 10 '18 at 18:56
Let $X_i$ be an indicator random variable that $i$ and $i+1$ ($i\in \{1,2,...,99\}$) are in a choosen subset.
Then $$ P(X_i = 1) = {{98\choose 23}\over {100\choose 25}}= {6\over 99}$$ Since $X= X_1+...+X_{99}$ we have $$ E(X) = E(X_1)+...+E(X_{99}) = 99{6\over 99} = 6$$
Let's assign a label $1,2 \dots 25$ (arbitrary order) to each of the selected numbers. Let $A_{i,j}$ with $1\le i<j \le 25$ be $1$ if elements with labels $i,j$ have sequential values, $0$ otherwise.
Then $X = \sum A_{i,j}$ counts the number of sequential pairs, which is what we want, and
$$E(X)=\sum A_{i,j}$$
But $E(X)=\sum E[A_{i,j}]= n_p P(A_{i,j} = 1) = n_p \frac{99}{\binom{100}{2}}$
Where $n_p = \binom{25}{2}=300$ is the number of pairs. Then
$$E(X) = \frac{300 \times 99} { \binom{100}{2}}=6$$