Seems very good.

My one concern is: we should check both that X_i is in LHS less than 600 times and in RHS less than 600 times. And the test still does not verify that the data is not biased, actually. For ex. if we want choose randomly a random subset of k numbers the solution of k/2 elements from the beginning and k/2 from the end passes the test. 
What do you think about something like: before every trial(randomSubset call) we pick randomly an index p from (1..n) and X_i =1 iff i-th number is in (p...(p + n/2)) mod n. Then, I think P(X_i = 1) = 0.5 = P(X_i =0) and X_i X_j are still more or less independent. And it's harder to give wrong randomSubset function that passes.