The solution absolutely can be generalized. There is no mention in the code of who generated the sperm or the egg and it doesn't matter. Every fertilization event is an independent occurrence. If you run the loop 7.6 billion times, you will see long strings of consecutive boys and long strings of consecutive girls. There is no "organization" between the two that balances them out. It is just that they are both equally likely so they will happen equally as often. You can demonstrate this to yourself by performing the following experiment: run the loop 7.6 billion times as it is. Then switch the values of the constants so that XX=1 and XY=0 and run it 7.6 billion times, again. You will get results with the same statistical properties as before. This symmetry under the switching operation demands that the results we see have the statistical properties we see. And we did not need to enforce any balance, ourselves (nor could we have).
As for the RND command, that is irrelevant to our example. All we need is a command that will produce a 1 as often as it will produce a 0. We could use this instead of RND:
Dim fertilizedEgg As Int = DateTime.Now Mod 2
and the results would have the same statistical properties.
Star-Dust, you are right that the sex split is not perfectly 50/50. Women very slightly outnumber men and you are correct that this is because women slightly outlive men, not that boys and girls are born at different rates. The reason that women slightly outlive men is mostly attributed to the fact that men, on average, engage in much more risky behavior than women. But again, this is a separate issue.