The process by which the distinction between males and females is established in a species. It is usually under genetic control. Equal numbers of males and females are produced when sex is determined by sex chromosomes or by a contrasting pair of alleles. In mammals, development of male or female sex organs depends on hormonal signals from the gonads of the early embryo. Embryos having a Y chromosome produce a testis-determining factor, which switches embryonic development to the male pathway. Otherwise, the embryo develops as a female. In some species (e.g. bees) females develop from fertilized eggs and males from unfertilized eggs. This does not produce equal numbers. Environmental factors can also be crucial in governing the sex of developing individuals. For example, temperature can affect the sex ratios of broods of certain turtles. High incubation temperatures (>28°C) produce a preponderance of males, while lower temperatures (<26°C) give rise to more females.