A previously untested hypothesis is that this reduces inbreeding. However dioecy has been shown to be associated with increased genetic diversity and greater protection against deleterious mutations. Regardless of the evolutionary pathway the intermediate states need to have fitness advantages compared to cosexual flowers in order to survive. Dioecy evolves due to male or female sterility, although it is unlikely that mutations for male and female sterility occurred at the same time. In angiosperms unisexual flowers evolve from bisexual ones. Dioecy occurs in almost half of plant families, but only in a minority of genera, suggesting recent evolution. For 160 families that have dioecious species, dioecy is thought to have evolved more than 100 times. In the family Caricaceae dioecy is likely the ancestral sexual system. From monoecy Dioecious flowering plants can evolve from monoecious ancestors that have flowers containing both functional stamens and functional carpels. Some authors argue monoecy and dioecy are related. In the genus Sagittaria, since there is a distribution of sexual systems, it has been postulated that dioecy evolved from monoecy through gynodioecy mainly from mutations that resulted in male sterility. However, since the ancestral state is unclear, more work is needed to clarify the evolution of dioecy via monoecy. From hermaphroditism Dioecy usually evolves from hermaphroditism through gynodioecy but may also evolve through androdioecy, through distyly or through heterostyly. In the Asteraceae, dioecy may have evolved independently from hermaphroditism at least 5 or 9 times. The reverse transition, from dioecy back to hermaphroditism has also been observed, both in Asteraceae and in bryophytes, with a frequency about half of that for the forward transition. In Silene, since there is no monoecy, it is suggested that dioecy evolved through gynodioecy. In mycology Very few dioecious fungi have been discovered. Monoecy and dioecy in fungi refer to the donor and recipient roles in mating, where a nucleus is transferred from one haploid hypha to another, and the two nuclei then present in the same cell merge by karyogamy to form a zygote. The definition avoids reference to male and female reproductive structures, which are rare in fungi. An individual of a dioecious fungal species not only requires a partner for mating, but performs only one of the roles in nuclear transfer, as either the donor or the recipient. A monoecious fungal species can perform both roles, but may not be self-compatible. Adaptive benefit Dioecy has the demographic