Check a sortition [Warning: newbie in stats. It's a practical problem at work, not a homework, I'm not a student.]
I have N entities and a process chooses M randomly (in theory...). M < N
If there are two independent choices of M entities, what is the probability that X entities are in both sets? And the probability there is AT LEAST X entities which are in both sets?
 A: There are N choose M ways for the first set to be chosen, M choose X ways ways for X matches to exist, and N-M chose M-X ways for the non matches of the 2nd set to be chosen.  And there are N choose M ways for each set each of the two sets (hence squared) in the denominator (before simplifying)
I believe the answer for exactly X (including X=0):
$$P(X)=\frac{{N \choose M}{M \choose X}{N-M \choose M-X}}{{N \choose M}^2}$$
$$P(X)=\frac{{M \choose X}{N-M \choose M-X}}{{N \choose M}}$$
I think both the numerator and denominator might also should be divided by two since order isn't important, but they would just cancel.  I tried a quick simulation with N=12 and M=4.  For X = 0, 1, 2, 3, 4 I got 0.141, 0.453, 0.339,  0.065, and 0.0020 (equations) and 0.142, 0.454, 0.335, 0.066, and 0.0022 (simulation) so I think these are probably correct.
Simulation Code:
N = 1 : 12;
M = 4;
sims = 10000;
matches = zeros( 1, sims );
for k = 1 : sims
M1 = [];
M2 = [];

while length(M1) < M

    x = ceil( rand( 1 ) * N( end ) );

    if( isempty( find( M1 == x ) ) )
        M1 = [ M1 x ];
    end

end

while length(M2) < M

    x = ceil( rand( 1 ) * N( end ) );

    if isempty( find( M2 == x ) )
        M2 = [ M2 x ];
    end

end

for n = 1 : M

    if isempty( find( M1 == M2( n ) ) )
        matches( k ) = matches( k );
    else
        matches( k ) = matches( k ) + 1;
    end

end

end
length(find(matches==0))/sims
length(find(matches==1))/sims
length(find(matches==2))/sims
length(find(matches==3))/sims
length(find(matches==4))/sims
