  Environmental variability greatly influences the eco-evolutionary dynamics of
a population, i.e. it affects how its size and composition evolve. Here, we
study a well-mixed population of finite and fluctuating size whose growth is
limited by a randomly switching carrying capacity. This models the
environmental fluctuations between states of resources abundance and scarcity.
The population consists of two strains, one growing slightly faster than the
other, competing under two scenarios: one in which competition is solely for
resources, and one in which the slow ("cooperating") strain produces a public
good that benefits also the fast ("freeriding") strain. We investigate how the
coupling of demographic and environmental (external) noise affects the
population's eco-evolutionary dynamics. By analytical and computational means,
we study the correlations between the population size and its composition, and
discuss the social-dilemma-like "eco-evolutionary game" characterizing the
public good production. We determine in what conditions it is best to produce a
public good; when cooperating is beneficial but outcompeted by freeriding, and
when the public good production is detrimental for cooperators. Within a linear
noise approximation to populations of varying size, we also accurately analyze
the coupled effects of demographic and environmental noise on the size
distribution.
