Exogamy is a social rule or norm that requires people to select mates outside certain groups to which they belong, such as their own family, lineage, clan, or village. The specific groups from which marriage is prohibited vary across cultures. The function of exogamy is often to promote social alliances and cooperation between different groups by creating ties of kinship through marriage. It can also help to prevent incest and maintain genetic diversity within a population. In many societies, the rules of exogamy are deeply embedded in cultural traditions and may be enforced through social sanctions or even legal prohibitions. The definition of the "out-group" for exogamous marriage can range from immediate family members to broader categories of relatives or members of the same local community, depending on cultural norms.