Combinations - How to calculate average # of items in a subset, with a given number of items randomly picked out of a set? If I randomly pick $k$ elements form a set $A$ of $n$ elements ($\binom{n}{k}$ combinations).
Assume the random distribution is totally even.
I now examine a given subset $B$ of $m$ elements from set $A$.
How can I calculate the average number $r$ of elements, randomly picked from $A$ that belong to $B$?
My stab at my own answer (with some help) is to first find the probability of finding $i$ elements ($i$ ranging from $0$ to $k$) in $B$ that were chosen in $A$: $P(i) = {\binom{m}{i} \times \binom{n-m}{k-i}\over{\binom{n}{k}}}$.
Then $r = \sum_{i=0}^k{i*P(i)}$.
I know this is wrong but I can't say why.
Any help appreciated.
 A: We describe a quick way to find the expectation.  (Your expression, after the modification, is correct.)
Let our given subset $B$ be $\{b_1,b_2,\dots,b_m\}$. Let $X_i=1$ if $b_i$ is picked among the $k$ elements, and let $X_i=0$ otherwise. Then the amount $Y$ of overlap between the random set and $B$ is given by $Y=X_1+X_2+\cdots+X_m$. Thus by the linearity of expectation, 
$$E(Y)=E(X_1)+E(X_2)+\cdots+E(X_m).$$
The probability that $b_i$ is in our chosen set is $\frac{k}{n}$. Thus $E(X_i)=\frac{k}{n}$, and $E(Y)=\frac{mk}{n}$. 
Remark: We give a quick justification of your method. There are $\binom{n}{k}$ equally likely ways to pick $k$ elements. Now we find the number of ways to do it so there are $i$ from $B$ and therefore $k-i$ from the rest of $A$. This can be done in $\binom{m}{i}\binom{n-m}{k-i}$ ways. So the required probability $P(i)$ is
 given by
$$P(i)=\frac{\binom{m}{i}\binom{n-m}{k-i}}{\binom{n}{k}}.$$
Now use the formula for expectation, as you did, to obtain an expression for the answer. We do indeed sum from $i=0$ to $k$, with the understanding that $\binom{a}{b}=0$ if $0\le a\lt b$.  
With some work, the expression $\sum{i=0}^k iP(i)$ can be simplified to give the simple answer $\frac{mk}{n}$ of the answer above. 
A: You don't need any difficult combinatorics here. Suppose instead of combinations you work with numbered selections (injective maps $\{1,\ldots,k\}\to\{1,\ldots,n\}$, also abusively called permutations); this will not alter the average number of elements that fall within $B$. But each element of $\{1,\ldots,k\}$ now obviously has an expectation of $m/n$ of falling inside the set $B$. The assignments of elements are not independent, but expectation is linear so you can add up nonetheless: the expectation for the total number of elements falling inside$~B$ is $mk/n$. That is precisely the average value you asked for.
