the probability of picking a male freshman is the product of picking a male
and that of picking a freshman.
Suppose there are n sophomore girls, the above becomes:
so we require:
(this assumes that a solution is possible you will need to check that
p(g,c)=p(g)p(c) for the other gender g, and class c combinations)