Set of Integers, find expectation of twin pairs (defined in description) Consider the set S of integers from 1 to N. Any two integers $1 ≤ a ≤ b ≤ N$ are called a twin pair if they are exactly a distance two apart, i.e., $b − a = 2$. For example, $(1, 3),(2, 4),(5, 7). . .$ are examples of a twin pair. Suppose one chooses a random subset of size $N/4$ from $S$ with all outcomes being equally likely. What is the expected number of twin pairs. You can assume that $N$ is a multiple of $4$
I attempted to solve this using linearity of expectation but couldn't calculate the generalized probability for a set with $N$ numbers
 A: Continuing from the comments:
Let us assume that $N$ is a positive multiple of $4$, i.e. let us set $N=4k$ with $k\in\{1,2,3,\dots\}$.
Let $X$ be the random variable counting the total number of "twinpairs."
For each $i$, let $\chi_i$ be the binary random variable $\chi_i=\begin{cases}1&\text{if both}~i~\text{and}~i+2~\text{are included in our selection}\\0&\text{otherwise}\end{cases}$
Recognize how $X$ relates to our collection of $\chi_i$'s

 $X=\chi_1+\chi_2+\dots+\chi_{(N-2)}$

Let us look at calculating probabilities associated with each of the $\chi_i$'s.  The probability $Pr(\chi_1=1)$ for example is the probability that both $1$ and $3$ are included in our selection.  Using counting methods or using the hypergeometric distribution leads us to:

$Pr(\chi_1=1)=\dfrac{\binom{4k-2}{k-2}}{\binom{4k}{k}}=\dfrac{\frac{(4k-2)!}{(k-2)!(3k)!}}{\frac{(4k)!}{k!(3k)!}}=\dots$

$~$

 $\dots = \dfrac{k!(4k-2)!}{(k-2)!(4k)!}=\dfrac{k(k-1)}{4k(4k-1)}$

The same logic and calculations leads us to the calculation of $Pr(\chi_i=1)$ for each $i\in\{1,2,3,\dots,N-2\}$
Knowing $Pr(\chi_i=1)$ allows us to calculate $E[\chi_i]$.
Combining all of this knowledge leads us to being able to calculate $E[X]$
