The merger of populations, the incidence of marriages, and aggregate unhappiness