Populations of cells need to express proteins to survive the sudden appearance of stressors. However, these mechanisms may be taxing. Populations can introduce diversity, allowing individual cells to stochastically switch between fast-growing and stress-tolerant states. One way to achieve this is to use genetic networks coupled with noise to generate bimodal distributions with two distinct subpopulations, each adapted to a stress condition. Another survival strategy is to rely on random fluctuations in gene expression to produce continuous, unimodal distributions of the stress response protein. To quantify the environmental conditions where bimodal versus unimodal expression is beneficial, we used a differential evolution algorithm to evolve optimal distributions of stress response proteins given environments with sudden fluctuations between low and high stress. We found that bimodality evolved for a large range of environmental conditions. However, we asked whether these findings were an artifact of considering two well-defined stress environments (low and high stress). As noise in the environment increases, or when there is an intermediate environment (medium stress), the benefits of bimodality decrease. Our results indicate that under realistic conditions, a continuum of resistance phenotypes generated through a unimodal distribution is sufficient to ensure survival without a high cost to the population.