I have found two questions that relate to creating a contingency table based on randomness, but not one that requires any amount of correlation. One example is here and the