An analysis of sex in random environments, I