If I randomly select subsets $K$ and $R$ of set $N$, what is the expected value of $|K \cap R|$ i.e. the number of elements in both $K$ and $R$?
EDIT: Clarifications: $N$ is finite and of known size, and $K$ and $R$ are uniformly distributed over subsets of given sizes $k$ and $r$. In other words, I'm looking for a function $P(k, r, n)$ that returns $|K \cap R|$.
I initially tried modelling this as a computation. If I select an element from $R$ and try to add it to $K$, the probability that said element is already in $K$ is $\frac{k}{n}$ ($k = |K|$; $n = |N|$; $r = |R|$). So the expected number of elements in $K$ after I add an element from $R$ should be $\frac{k}{n} k + \frac{n - k}{n} \left ( k + 1 \right )$. Following this train of logic gives us the recurrence relation
$P(k, r, n) = \frac{k}{n} P(k, r - 1, n) + \frac{n - k}{n} P(k + 1, r - 1, n)$
with the obvious boundary conditions $\forall k, n: P(k, 0, n) = 1$ and $\forall n, r: P(n, r, n) = 0$. (Finding $P(k, r, n)$ will obviously give us $|K \cup R|$, not $|K \cap R|$, but then $|K \cap R| = |K| + |R| - |K \cup R|$.) But I have no idea how to turn this recurrence relation into a closed-form, and I'm not even fully confident that it's correct in the first place. I would just write a C program to calculate $P(k, r, n)$ for me, but I'm dealing with values of $k$ and $r$ that are large enough (up to $2^{16}$) that I would blow my stack space.