Coin flipping simulates the events of mitosis and the production of sperm. This is because females carry XX chromosomes so all eggs will have a singular X chromosome. It is the sperm that determines the sex of the foetus: males have XY chromosomes and therefore sperm will carry either X or Y chromosomes (a 50/50 chance, just like flipping a coin)