However, in organisms with more than one set of chromosomes at the main life cycle stage, sex may also provide an advantage because, under random mating, it produces homozygotes and heterozygotes according to the Hardy-Weinberg ratio.