Combinatorics on $k$ contiguous numbers Let $U = \lbrace 1, 2, \dotsc, K \rbrace$. Now we take all possible subsets of $U$ of contiguous numbers except the null set and arrange them in $K$ tiers based on the number of elements in them. For example, for $U = \lbrace 1, 2, 3, 4 \rbrace$, we have $4$ tiers as follows:
$T_1: \lbrace 1 \rbrace, \lbrace 2 \rbrace, \lbrace 3 \rbrace$, $\lbrace 4 \rbrace$
$T_2: \lbrace 1, 2 \rbrace, \lbrace 2, 3 \rbrace, \lbrace 3, 4 \rbrace$
$T_3: \lbrace 1, 2, 3 \rbrace$, $\lbrace 2, 3, 4 \rbrace$
$T_4: \lbrace 1, 2, 3, 4\rbrace$,
where index $i$ ($1 \leq i \leq K$) of $T_i$ denotes the number of elements of the sets that are in $T_i$.
Now, suppose Alice chooses set randomly in $T_i$ and Bob we chooses a set randomly in $T_j$ ($1 \leq i \leq K$), what is the probability that there are exactly $k$ elements common between the randomly chosen set in $T_j$ by Bob and the randomly chosen set in $T_i$ by Alice? 
For example, for the test set $\lbrace 1, 2 \rbrace \in T_2$,  $\lbrace 1 \rbrace$ and $\lbrace 2 \rbrace$ in $T_1$ have one element in common with $\lbrace 1, 2 \rbrace$. Similarly, the set $\lbrace 1, 2, 3 \rbrace$ in $T_3$ has two elements common with $\lbrace 1, 2 \rbrace$.
My attempt: The total combinations to choose sets with contiguous numbers is $(K-i+1)(K-j+1)$. Intuitively, the number common elements depends on the relative positions of Alice's and Bob's sequences and their sizes. This leads to multiple combinations. But I am lost in those combinations.
 A: To avoid confusion I take $n=K$. wlog assume $1\le k\le i\le j\le n$. [Obviously if $k>i$ then the chance of an overlap of $k$ is nil.]
Case $k<i$
We deal separately below with the case $k=i$. So assume first that $k<i$. That means that if we fix the run length $j$, then there are at most 2 runs length $i$ which overlap it by $k$. 
Suppose the run length $j$ starts at $y$, then it ends at $y+j-1$.
If $i-k+1\le y\le n+1-j$, then we can start the run length $i$ before the run length $j$. If $1\le y\le n+1-j-(i-k)$, then we can end the run length $i$ after the run length $j$.
So if $n<i+j-k$ there is no chance of an overlap of $k$.
The possible values of $y$ are $1,2,\dots,n-j+1$, and the possible values for the starting point of the $i$-run are $1,2,\dots,n-i+1$. So there are $(n-i+1)(n-j+1)$ possible pairs, all equally likely.
$2(n+1-i-j+k)$ of these pairs give the required overlap. So the probability of the required overlap is $$\frac{2(n+1-i-j+k)}{(n-i+1)(n-j+1)}\quad\text{ or 0 if }\ \ n<i+j-k$$
Case $k=i$
In this case the $i$-run has to be inside the $j$-run to get the required overlap, so the probability is simply $$\frac{j-i+1}{n-i+1}$$
Case $k=0$
The $j-run$ must start at $1,2,\dots,n-j+1$. If it starts at $1,\dots,i$ the $i$-run cannot come before it. If it starts at $i+1$, there is one possible position for the $i$-run before it (namely starting at 1). If it starts at $i+2$, then two possible positions and so on. So in total $1+2+\dots+(n-i-j+1)=\frac{1}{2}(n-i-j+1)(n-i-j+2)$. We get the same number (by symmetry) where the $i$-run comes after the $j$-run, so we get the probability as $$\frac{(n-i-j+1)(n-i-j+2)}{(n-i+1)(n-j+1)}$$
Example: $n=10,i=4,j=5$. We get $\frac{3}{21},\frac{3}{21},\frac{4}{21},\frac{5}{21},\frac{6}{21}$ for $k=0,1,2,3,4$.
