Resist or perish: fate of a microbial population subjected to a periodic presence of antimicrobial

The evolution of antimicrobial resistance can be strongly affected by variations of antimicrobial concentration. Here, we study the impact of periodic alternations of absence and presence of antimicrobial on resistance evolution in a microbial population, using a stochastic model that includes variations of both population composition and size, and fully incorporates stochastic population extinctions. We show that fast alternations of presence and absence of antimicrobial are inefficient to eradicate the microbial population and strongly favor the establishment of resistance, unless the antimicrobial increases enough the death rate. We further demonstrate that if the period of alternations is longer than a threshold value, the microbial population goes extinct upon the first addition of antimicrobial, if it is not rescued by resistance. We express the probability that the population is eradicated upon the first addition of antimicrobial, assuming rare mutations. Rescue by resistance can happen either if resistant mutants preexist, or if they appear after antimicrobial is added to the environment. Importantly, the latter case is fully prevented by perfect biostatic antimicrobials that completely stop division of sensitive microorganisms. By contrast, we show that the parameter regime where treatment is efficient is larger for biocidal drugs than for biostatic drugs. This sheds light on the respective merits of different antimicrobial modes of action.


Introduction
Antibiotics and antivirals allow many major infectious diseases to be treated. However, with the increasing use of antimicrobials, pathogenic microorganisms tend to become resistant to these drugs, which then become useless. Understanding the evolution of resistance is of paramount importance in order to fight the major public health issue raised by antimicrobial resistance [1,2].
The evolution of antimicrobial resistance often occurs in a variable environment, as antimicrobial is added and removed from a medium or given periodically to a patient [3,4]. This results into varying patterns of selection, which are known to have a dramatic effect on evolution in other contexts [5][6][7][8][9]. To address how variations of antimicrobial concentration impact resistance evolution, we investigate theoretically the de novo acquisition of resistance in a microbial population in the presence of alternations of phases of presence and absence of antimicrobial. This situation can represent, for example, a treatment where the concentration within the patient falls under the Minimum Inhibitory Concentration (MIC) between drug intakes [10], which is a realistic case [10,11].
We propose a general stochastic model that incorporates variations of both population composition and size, i.e. population genetics and population dynamics. Despite having a common origin in stochastic birth, death and mutation events, and thus being intrinsically coupled, these phenomena are seldom considered together in theoretical studies [12]. However, it is particularly crucial to address both of them when studying the evolution of antimicrobial resistance, because the aim of an antimicrobial treatment is to eradicate a microbial population, or at least to substantially decrease its size, while the evolution of resistance corresponds to a change in the genetic makeup of the population. Our general model allows us to fully incorporate the stochasticity of mutation occurrence and establishment [13][14][15][16][17], as well as that of population extinction, whose practical importance was recently highlighted [18][19][20].
In this framework, we ask whether a microbial population subject to alternations of phases of presence and absence of antimicrobial develops resistance, which corresponds to treatment failure and to rescue of the microbial population by resistance [21,22], or goes extinct, which corresponds to treatment success. In other words, we ask whether the microbial population resists or perishes.
We study both the impact of biocidal drugs, that kill microorganisms, and of biostatic drugs, that prevent microorganisms from growing. We show that fast alternations of phases with and without antimicrobial do not permit eradication of the microbial population before resistant mutants fix, unless the death rate with antimicrobial is large enough. Conversely, intermediate alternation speeds are effective for a wider range of antimicrobial modes of action, but the probability of population extinction and therefore of treatment success, which we fully quantify, is not one, because resistance can rescue the population, and this effect depends on the size of the microbial population. We find that the parameter range where antimicrobial treatment is efficient is larger for biocidal drugs than for biostatic drugs. However, we also show that biocidal and imperfect biostatic antimicrobials permit an additional mechanism of rescue by resistance compared to biostatic drugs that completely stop growth. This sheds light on the respective merits of different antimicrobial modes of action. Finally, we find a population size-dependent critical drug concentration below which antimicrobials cannot eradicate microbial populations.

Model and methods
We consider a microbial population with carrying capacity K, corresponding to the maximum population size that the environment can sustain, given the nutrients available. The division rate of each microorganism is assumed to be logistic, and reads f (1 − N/K), where N represents the total population size, while the fitness f is the maximal division rate of the microorganism, reached when N ≪ K. This model therefore incorporates population size variations, and allows us to include extinctions induced by the antimicrobial drug.
Mutations that confer antimicrobial resistance are often associated with a fitness cost, i.e. a slower reproduction [23][24][25], but this fitness cost can be compensated by subsequent mutations [26][27][28][29]. The acquisition of resistance is therefore often irreversible, even if the antimicrobial is removed from the environment [24,26]. Thus motivated, we consider three types of microorganisms: sensitive (S) microorganisms, whose division or death rate is affected by antimicrobials, resistant (R) microorganisms, that are not affected by antimicrobials but that bear a fitness cost, and resistant-compensated (C) microorganisms that are not affected by antimicrobials and do not bear a fitness cost. In the absence of antimicrobial, their fitnesses (maximal division rates) are denoted by f S , f R and f C , respectively, and their death rates by g S , g R and g C . Values in the presence of antimicrobial are denoted by a prime, e.g. f ′ S . Note that we include small but nonzero baseline death rates, which can model losses or the impact of the immune system in vivo, and allows for population evolution even at steady-state size. Without loss of generality, we set f S = 1 throughout. In other words, the maximum reproduction rate of S microorganisms, attained when population size is much smaller than the carrying capacity, sets our time unit. We further denote by µ 1 and µ 2 the mutation probabilities upon each division for the mutation from S to R and from R to C, respectively. In several actual cases, the effective mutation rate towards compensation is higher than the one towards the return to sensitivity, because multiple mutations can compensate for the initial cost of resistance [27,28,30]. Thus, we do not take into account back-mutations. Still because of the abundance of possible compensatory mutations, often µ 1 ≪ µ 2 [27,31]. We provide general analytical results as a function of µ 1 and µ 2 , and we focus more on the limit µ 1 ≪ µ 2 , especially in simulations.
Our model thus incorporates both population dynamics and population genetics [7,12,32], and is more realistic than descriptions assuming constant population sizes [33], e.g. in the framework of the Moran process [13,34]. Throughout, our time unit corresponds to a generation of sensitive microorganisms without antimicrobial in the exponential phase (reached when N ≪ K).
The action of an antimicrobial drug can be quantified by its MIC, which corresponds the minimum concentration that stops the growth of a microbial population [24]. More precisely, the MIC corresponds to the concentration such that death rate and division rate are equal [18]: in a deterministic framework, above the MIC, the population goes extinct, while below it, it grows until reaching carrying capacity. We investigate the impact of periodic alternations of phases of absence and presence of antimicrobial, at concentrations both above and below the MIC. We consider both biostatic antimicrobials, which decrease the division rate of microorganisms (f ′ S < f S ), and biocidal antimicrobials, which increase the death rate of microorganisms (g ′ S > g S ) [18]. We start from a microbial population where all individuals are S (sensitive), without antimicrobial. Specifically, we generally start our simulations with 10 S microorganisms, thus including a phase of initial growth, which can model the development of an infection starting from the bottleneck at transmission [35]. Our results are robust to variations of this initial condition, since we mainly consider timescales longer than that of the initial growth of the population to its equilibrium size. Note however that if we started with a very small number of S microorganisms (i.e. 1 or 2), we would need to take into account rapid stochastic extinctions (see Fig. S3B).
Antimicrobial both drives the decrease of the population of sensitive microorganisms and selects for resistance. We ask whether resistance fully evolves de novo, leading to the C microorganisms taking over, or whether the microbial population goes extinct before this happens. The first case corresponds to treatment failure, and the second to treatment success. Hence, we are interested in the probability p 0 of extinction of the microbial population before C microorganisms fix in the population, i.e. take over. We also discuss the average time t f ix it takes for the population to fully evolve resistance, up to full fixation of the C microorganisms, and the mean time to extinction before the fixation of the C type t ext .
We present both analytical and numerical results. Our analytical results are obtained using methods from stochastic processes, including the Moran process at fixed population size [13] and birth-death processes with time varying rates [36][37][38][39]. Our simulations employ a Gillespie algorithm [40,41], and incorporate all individual stochastic division, mutation and death events with their exact rates (see Supporting Information, section 5 for details).

Results
Conditions for a periodic presence of perfect biostatic antimicrobial to eradicate the microbial population Do periodic alternations of phases with and without antimicrobial allow the eradication of a microbial population, or does resistance develop? We first address this question in the case of a biostatic antimicrobial sufficiently above the MIC to completely stop the growth of S microorganisms (see Fig. 1A-B). With such a "perfect" biostatic antimicrobial, the fitness of S microorganisms is f ′ S = 0, while without antimicrobial, f S = 1. Here, we assume that the death rate of S microorganisms is not affected by the antimicrobial, i.e. g ′ S = g S , but the case of a biocidal antimicrobial will be considered next. Note that within our logistic growth model, we consider that S microorganisms that cannot divide still consume resources, e.g. nutrients, in order to self-maintain. They may also still grow in size even if they cannot divide [3].
A crucial point is how the duration of a phase with antimicrobial, which corresponds here to the half-period T /2 of alternations, compares to the average time τ S needed for a population of S microorganisms to go extinct in the presence of antimicrobial. Indeed, if T /2 ≫ τ S , one single phase with antimicrobial suffices to eradicate a microbial population in the absence of resistance. An exact first passage time calculation [33,42] (see Supporting Information, section 1.2, Eq. S7) yields where N ≫ 1 represents the number of microorganisms when antimicrobial is first added, i.e. at T /2. If the phase before antimicrobial is added is much longer than the initial growth timescale of the population, i.e. if T /2 ≫ 1/(f S − g S ) (see Supporting Information, section 1.3.1), N can be taken equal to the deterministic equilibrium population size N = K(1 − g S /f S ), obtained by setting the birth rate f S (1 − N/K) equal to the death rate g S . Hence, τ S ≈ log [K(1 − g S /f S )] /g S . Note that in this regime, the initial population size has no impact on τ S , and that the division and death rates are both given by g S . Our simulation results in Fig. 1C display an abrupt increase in the probability p 0 that the microbial population goes extinct before developing resistance for T = 2τ S , in good agreement with our analytical prediction.
For fast alternations satisfying T /2 ≪ τ S , the phases with antimicrobial are not long enough to eradicate the microbial population, yielding a systematic evolution of resistance, and thus a vanishing probability p 0 of extinction before resistance takes over. This prediction is confirmed by our simulation results in Fig. 1C, and an example of resistance evolution in this regime is shown in Fig. 1D. In the limit of very fast alternations, we expect an effective averaging of the fitness of S microorganisms, withf S = 0.5. Thus, an R mutant whose lineage will take over the 3/36 Periodic presence of a perfect biostatic antimicrobial. A: Microbial fitness versus genotype with and without antimicrobial. Genotypes are the following: S: sensitive; R: resistant; C: resistant-compensated. δ represents the fitness cost of resistance. B: Periodic presence of antimicrobial (gray: presence, white: absence), and impact on the fitness of S microorganisms. C: Probability p 0 that the microbial population goes extinct before resistance gets established versus alternation period T , for various carrying capacities K. Markers: simulation results, with probabilities estimated over 10 2 − 10 3 realizations. Horizontal solid lines: analytical predictions from Eq. 1. Dashed lines: T /2 = τ S . D and E: Numbers of S, R and C microorganisms versus time in example simulation runs for K = 1000, with T = 20 and T = 1000 respectively. In D, resistance takes over, while in E, extinction occurs shortly after antimicrobial is first added. Phases without (resp. with) antimicrobial are shaded in white (resp. gray). Parameter values: f S = 1 without antimicrobial, f ′ S = 0 with antimicrobial, f R = 0.9, f C = 1, g S = g R = g C = 0.1, µ 1 = 10 −5 and µ 2 = 10 −3 . All simulations start with 10 S microorganisms. population (i.e. fix) appears after an average timet a R = 1/(Ñ µ 1 g SpSR ) whereÑ µ 1 g S represents the total mutation rate in the population, is the probability that a single R mutant fixes in a population of S microorganisms with constant sizeÑ , calculated within the Moran model [13]. Note that when the effective fitness of S microorganisms isf S , acquiring resistance is beneficial (provided that the fitness cost of resistance is reasonable, namely smaller than 0.5). Subsequently, C mutants will appear and fix, thus leading to the full evolution of resistance in the population. The corresponding average total time t f ix of resistance evolution [33] obtained in our simulations agrees well with the analytical expression oft a R for T /2 ≪ τ S (see Fig. S4C).
Conversely, if T /2 ≫ τ S , the microbial population is eradicated by the first phase with antimicrobial, provided that no resistant mutant preexists when antimicrobial is added to the environment. Indeed, resistance cannot appear in the presence of a perfect biostatic antimicrobial since S microorganisms then cannot divide. Thus, in the absence of existing R mutants, extinction occurs shortly after time T /2 (see Fig. S4B), and the situation is equivalent to adding antimicrobial at T /2 and leaving it thereafter, as exemplified by Fig. 1E. Hence, while they are longer than those usually encountered in periodic treatments, the longest periods considered here are relevant to describe extended continuous treatments. Note that although unlikely, fixation of resistance in the absence of antimicrobial will end up happening by spontaneous fitness valley crossing if the first phase without antimicrobial is long enough. Specifically, is the average valley crossing time by tunneling, which is the relevant process unless populations are very small [17,33,43,44]. Accordingly, our simulation results in Fig.  S4, which includes longer alternation periods than Fig. 1, feature three distinct regimes, and vanishing extinction probabilities are obtained for T /2 ≫ τ V , as well as for T /2 ≪ τ S .
Let us now focus on the regime where antimicrobial treatment can induce extinction of the microbial population, namely τ S ≪ T /2 ≪ τ V , and calculate the extinction probability p 0 . A necessary condition for the population to be rescued by resistance [21] and avoid extinction is that at least one R mutant be present when antimicrobial is added. In the rare mutation regime Kµ 1 ≪ 1, this occurs with probability p where t app R = 1/(N µ 1 g S ) is the average time of appearance of a resistant mutant, while τ d R is the average lifetime of a resistant lineage (destined for extinction without antimicrobial), both calculated in a population of S individuals with fixed size N = K(1 − g S /f S ) [13,33]. Importantly, the presence of R mutants does not guarantee the rescue of the microbial population, because small subpopulations of R microorganisms may undergo a rapid stochastic extinction. The probability p e R (i) of such an extinction event depends on the number of R microorganisms present 4/36 when antimicrobial is added, which is i with a probability denoted by p c R (i), provided that at least one R mutant is present. The probability p 0 that the microbial population is not rescued by resistance and goes extinct can then be expressed as: The probability p c R (i) can be calculated within the Moran model since the population size is stable around N = K(1 − g S /f S ) before antimicrobial is added. Specifically, it can be expressed as the ratio of the average time τ d R,i the lineage spends in the state where i mutants exist to the total lifetime τ d R of the lineage without antimicrobial: p c R (i) = τ d R,i /τ d R (see Supporting Information, section 3.1). Next, in order to calculate the probability p e R (i) that the lineage of R mutants then quickly goes extinct, we approximate the reproduction rate of the R microorganisms by f R (1 − (S(t) + R(t))/K) ≈ f R (1 − S(t)/K), where S(t) and R(t) are the numbers of S and R individuals at time t. Indeed, early extinctions of R mutants tend to happen shortly after the addition of antimicrobials, when S(t) ≫ R(t). Thus motivated, we further take the deterministic approximation S(t) = K(1 − g S /f S )e −gS t , while retaining a stochastic description for the R mutants [36,37]. We then employ the probability generating function φ i (z, t) = ∞ j=0 z j P (j, t|i, 0), where i is the initial number of R microorganisms, which satisfies p e R (i) = lim t→∞ P (0, t|i, 0) = lim t→∞ φ i (0, t). Solving the partial differential equation governing the evolution of φ i (z, t) (see Supporting Information, section 3.2) yields [38,39] with Eq. 1 then allows us to predict the probability that the microbial population goes extinct thanks to the first addition of antimicrobial. Fig. 1C demonstrates a very good agreement between this analytical prediction and our simulation results in the rare mutation regime Kµ 1 ≪ 1, and Fig. S8 further demonstrates good agreement for each separate term of Eq. 1 in this regime. For larger populations, the probability that the microbial population is rescued by resistance increases, and the extinction probability tends to zero for frequent mutations Kµ 1 ≫ 1 because R mutants are then always present in the population, in numbers that essentially ensure their survival (see Fig. 1C). Note that in our simulations presented in Fig. 1, we chose µ 1 = 10 −5 for tractability. With realistic bacterial mutation probabilities, namely µ 1 ∼ 10 −10 [45], the rare mutation regime remains relevant for much larger populations.
Biocidal antimicrobials and imperfect biostatic ones allow an extra mechanism of rescue by resistance How does the mode of action of the antimicrobial impact our results? So far, we considered a perfect biostatic antimicrobial that stops the growth of sensitive microorganisms but does not affect their death rate. Let us now turn to the general case of an antimicrobial that can affect both the division rate and the death rate of sensitive microorganisms, and let us assume that we are above the MIC, i.e. g ′ S > f ′ S . In this section, we present general calculations, but focus most of our discussion on purely biocidal antimicrobials, which increase the death rate of sensitive microorganisms without affecting their growth rate, and compare them to purely biostatic antimicrobials. Again, a crucial point is how the duration T /2 of a phase with antimicrobial compares to the average time τ S needed for a population of S microorganisms to go extinct in the presence of antimicrobial (see Eq. S6). Indeed, our simulation results in Figs. 2A and 2D display an abrupt change in the probability that the microbial population goes extinct before developing resistance for T = 2τ S .
For small periods T /2 ≪ τ S , one phase with antimicrobial is not long enough to eradicate the microbial population. However, the alternations may induce an overall decrease in the population over multiple periods, then leading to extinction. This is the case when the deterministic growth timescale 1/(f S −g S ) is larger than the decay timescale 1/(g ′ S − f ′ S ). Equivalently, in the limit of very fast alternations, there is no nonzero stationary population size wheñ f S = (f S + f ′ S )/2 <g S = (g S + g ′ S )/2, yielding the same condition. For a biostatic drug such that g ′ S = g S , this situation cannot happen if g S < f S /2, which is realistic since baseline death rates are usually small. Conversely, for a biocidal drug such that f ′ S = f S , a systematic evolution of resistance will occur if g ′ S < 2f S − g S , while population decay over several periods and extinction will occur if g ′ S > 2f S − g S . These predictions are confirmed by the  In B, resistance takes over, while in C, extinction occurs shortly after antimicrobial is first added. Phases without (resp. with) antimicrobial are shaded in white (resp. gray). Parameter values in A, B and C: f S = 1, f R = 0.9, f C = 1, g S = 0.1 without antimicrobial, g ′ S = 1.1 with antimicrobial, g R = g C = 0.1, µ 1 = 10 −5 and µ 2 = 10 −3 . All simulations start with 10 S microorganisms. D, E and F: same as A, B and C, but with g ′ S = 2. All other parameters are the same. Here resistance takes over. Phases without (resp. with) antimicrobial are shaded in white (resp. gray). B: Zoom showing the emergence of resistance in this realization: an R mutant appears after antimicrobial is added (gray). At this time, the S population is decreasing due to the antimicrobial-induced high death rate, but the surviving S microorganisms are still able to divide. Parameter values and initial conditions are the same as in Fig. 2A, B and C.
simulation results in Figs which can induce death rates equal to several times the birth rate [46,47]. Note that in Fig. 2A, the extinction probability is not zero for small periods with K = 10 2 : this is because stochastic extinctions can occur before resistance takes over for such a small equilibrium population size. For slower alternations satisfying T /2 ≫ τ S , the microbial population is eradicated by the first phase with antimicrobial, unless resistance rescues it. Extinction then occurs shortly after time T /2 (see Fig. S5B and examples in Fig. 2C and F). Importantly, with a biocidal antimicrobial or with an imperfect biostatic one, the microbial population can be rescued by resistance in two different ways: either if resistant bacteria are present when antimicrobial is added, or if they appear afterwards. This second case is exemplified in Fig. 3. It can happen because even at high concentration, such antimicrobials do not prevent S microorganisms from dividing, contrarily to a perfect biostatic one. Because of this, rescue by resistance can become more likely than with perfect biostatic antimicrobials. Note that, as in the perfect biostatic case, the spontaneous fixation of resistant mutants without antimicrobial will occur Fig. S5).
Let us focus on the regime where the treatment can efficiently induce extinction, namely τ S ≪ T /2 ≪ τ V . The probability p 0 that the microbial population is not rescued by resistance and goes extinct can then be expressed as: Apart from the last term, which corresponds to resistance appearing after antimicrobial is first added, Eq. 4 is identical to Eq. 1. The quantities p R and p c R (i) are the same as in that case, since they only depend on what happens just before antimicrobial is added. While p e R (i) is conceptually similar to the perfect biostatic case, it depends on f ′ S and g ′ S , and its general calculation is presented in Section 3.2 of the Supporting Information. This leaves us with the new case where resistance appears in the presence of antimicrobial. In the rare mutation regime such that N div µ 1 ≪ 1, it happens with probability p a R = N div µ 1 , where is the number of divisions that would occur in a population of S microorganisms between the addition of antimicrobial 7/36 (taken as the origin of time here) and extinction. Employing the deterministic approximation for the number S(t) of S microorganisms (see Eq. S21), the probability that the lineage of an R mutant that appears at time t 0 quickly goes extinct can be obtained in a similar way as for Eq. 2, yielding with We then estimate the probability p e ′ R that the lineage of an R mutant that appears after the addition of antimicrobial quickly goes extinct by averaging p e ′ R (t 0 ) over the time t 0 of appearance of the mutant, under the assumption that exactly one R mutant appears: with Eq. 4 then yields the probability that the microbial population goes extinct thanks to the first addition of antimicrobial. Fig. 2A demonstrates a very good agreement between this analytical prediction and our simulation results in the rare mutation regime Kµ 1 ≪ 1, and Figs. S8A-B, S9 and S10 further demonstrate good agreement for each term involved in Eq. 4 in this regime. The extinction probability p 0 depends on the size of the microbial population through its carrying capacity K and on the division and death rates with antimicrobial. Fig. 4 shows the decrease of p 0 with K, with p 0 reaching 0 for Kµ 1 ≫ 1 since resistant mutants are then always present when antimicrobial is added. Moreover, Fig. 4 shows that p 0 depends on the antimicrobial mode of action, with large death rates favoring larger p 0 in the biocidal case, and with the perfect biostatic antimicrobial yielding the largest p 0 . Qualitatively, the observed increase of p 0 as g ′ S increases with a biocidal drug mainly arises from the faster decay of the population of S microorganisms, which reduces the probability p a R that an R mutant appears in the presence of antimicrobial. Furthermore, one can show that the extinction probability p 0 is larger for a perfect biostatic antimicrobial than for a perfect biocidal antimicrobial with g ′ S → ∞ (see Supporting Information, Section 3.4). Indeed, S microorganisms survive longer in the presence of a perfect biostatic drug, which reduces the division rate of the R mutants due to the logistic growth term, and thus favors their extinction. Such a competition effect is realistic if S microorganisms still take up resources (e.g. nutrients) even while they are not dividing. Besides, a treatment combining biostatic and biocidal effects yields a larger p 0 than a pure biocidal one inducing the same death rate, thereby illustrating the interest of the additional biostatic effect (see Fig. 4). Note that conversely, adding a biocidal to a perfect biostatic slightly decreases p 0 due to the competition effect, as S microorganisms go extinct faster than with the perfect biostatic drug alone.

Sub-MIC drug concentrations and stochastic extinctions
So far, we considered antimicrobial drugs above the MIC, allowing deterministic extinction in the absence of resistance for long enough drug exposure times. However, sub-MIC drugs can also have a major impact on the evolution of resistance, by selecting for resistance without killing large microbial populations, and moreover by facilitating stochastic extinctions in finite-sized microbial populations [18][19][20]. In the sub-MIC regime where f ′ S > g ′ S , the population has a nonzero deterministic equilibrium size in the presence of antimicrobial. Nevertheless, stochastic extinctions can remain relatively fast, especially in the weakly-sub-MIC regime where f ′ S is close to g ′ S , and if K is not very large. The key point is whether resistance appears before the extinction time τ S . The average time of appearance of an R mutant that fixes in a population of N ′ individuals in the presence of sub-MIC antimicrobial is is the fixation probability of an R mutant in a population of S individuals with fixed size N ′ (see Supporting Information, Section 4, and Ref. [48]). Therefore, we expect resistance to take over and the extinction probability p 0 to be very small if t a R ≪ τ S below the MIC, even for large periods such that τ S < T /2. Fig. 5 shows heatmaps of the probability p 0 that the microbial population goes extinct before resistance takes over, in the cases of biostatic and biocidal drugs, plotted versus the period of alternations T and the non- which increases with antimicrobial concentration and is zero at the minimum inhibitory concentration (MIC). In both cases, two main regions are apparent, one with p 0 = 0 and one where p 0 is close to one. The transition between them is well described by the solid line T /2 = τ S such that the time spent with drug is equal to the extinction time τ S of a population of sensitive microbes with drug, except for large periods, where the relevant transition occurs below the MIC (R < 0) and is given by t a R = τ S (dashed line), consistently with our analytical predictions.

A B
ability of extinction p Probability of extinction p All simulations start with 10 S microorganisms.
The ratio R enables us to make a quantitative comparison between biostatic and biocidal drugs. Let us focus first on the transition τ S = t a R . Eq. S6 shows that the average time it takes for the sensitive microorganisms to spontaneously go extinct in the presence of antimicrobial can be written as where Φ is a nondimensional function. Besides, the average fixation time of a R mutant in a population of S individuals can also be expressed as t a where Ψ is a non-dimensional function. Thus, the transition τ S = t a R will be the same for biostatic and biocidal drugs at a given value of R. Conversely, the transition τ S = T /2, i.e. Φ(R)/g ′ S = T /2, depends on g ′ S , and is thus different for biostatic and biocidal drugs at the same value of R. Specifically, for a given value of R, smaller periods T will suffice to get extinction after the first addition of antimicrobial for a biocidal drug than for a biostatic drug, because g ′ S is increased by biocidal drugs, and hence τ S is smaller in the biocidal case than in the biostatic case. This means that the parameter regime where treatment is efficient is larger for biocidal drugs than for biostatic drugs, as can be seen by comparing Fig. 5A and Fig. 5B. Significantly above the MIC, another difference is that biocidal drugs become efficient even for short periods Numerical simulation results agree well with this prediction (dotted line on Fig. 5B).
Importantly, the transition between large and small extinction probability when R (and thus the antimicrobial concentration) is varied strongly depends on population size, specifically on carrying capacity (Figs. 6 and S6), and also depends on antimicrobial mode of action (Fig. 6). For small periods where the relevant transition occurs for T /2 = τ S , concentrations above the MIC (R > 0) can actually be necessary to get extinction because one period may not suffice to get extinction, and moreover, the extinction threshold value R is not the same for biostatic and biocidal antimicrobials (see above and Figs. 6A-B). Conversely, for large periods where the relevant transition occurs for t a R = τ S , and extinction occurs upon the first addition of drug, the extinction threshold is always below the MIC (R < 0) and it is the same for biostatic and biocidal antimicrobials (see above and Fig. 6C). In both cases, the larger the population, the larger the concentration required to get large extinction probabilities. For large periods (Fig. 6C), the transition occurs close to the MIC for large populations, but the smaller the population, the larger the discrepancy between the MIC and the actual transition, as predicted by our analytical estimate based on t a R = τ S (see Fig. S6). This is because in small populations, stochastic extinctions of the population are quite fast at weakly sub-MIC antimicrobial. This is a form of inoculum effect, where the effective MIC depends on the size of the bacterial population [20]. In the large period regime (Fig. 6C), the extinction probability p 0 is well-predicted by Eqs. 1 and 4 for the R values such at most one R mutant can appear before the extinction of the population (as assumed in our calculation of p a R ). In this regime, the extinction time is close to T /2 (see Fig. S7) as extinction is due to the first addition of antimicrobial, while for smaller R values, extinction occurs after multiple periods.
In Figs. 6A-B, transitions between small and large values of p 0 in simulated data are observed for smaller threshold values of R than predicted by T /2 = τ S (this can also be seen in Fig. 5, where the solid white line is somewhat in the blue zone corresponding to large p 0 ). This is because we have employed the average extinction time τ S , while extinction is a stochastic process. Thus, even if T /2 < τ S , upon each addition of antimicrobial, there is a nonzero probability that extinction actually occurs within the half-period. Denoting by p the probability that a given extinction time is smaller than T /2, the population will on average go extinct after 1/p periods, unless resistance fixes earlier. For instance, a population with carrying capacity K = 10 2 submitted to alternations with T = 10 2.5 is predicted to develop resistance before extinction if R < 0.055. However, for R = −0.1, simulations yield a probability p 0 = 0.99 of extinction before resistance takes over (see Fig. 6A). In this case, simulations yield p = 0.3, implying that extinction typically occurs in ∼ 3 periods, thus explaining the large value of p 0 . More generally, the probability distribution function of the extinction time can depend on various parameters, which can impact the discrepancy between the predicted and observed transitions. A more precise calculation would involve this distribution. Note that the distribution of extinction times is known to be exponential for populations with a quasi-stationary state [49,50], but the present situation is more complex because there is no nonzero deterministic equilibrium population size below the MIC, and because the population size at the time when antimicrobial is added is far from the equilibrium value with antimicrobial. Nevertheless, our prediction based on the average extinction time τ S yields the right transition shape (see Fig. 5) and the correct expectations for T /2 ≫ τ S and T /2 ≪ τ S .

Main results
The evolution of antimicrobial resistance often occurs in variable environments, as antimicrobial is added and removed from a medium or given periodically to a patient, e.g. in a treatment by the oral route [3,4]. Alternations of phases of absence and presence of antimicrobial induce a dramatic time variability of selection pressure on microorganisms, and can thus have a strong impact on resistance evolution. Using a general stochastic model which includes variations of both composition and size of the microbial population, we have shed light on the impact of periodic alternations of presence and absence of antimicrobial on the probability that resistance evolves de novo and rescues a microbial population from extinction. The majority of previous studies of periodic antimicrobial treatments [10,[51][52][53][54][55][56] neglect stochastic effects, while they can have a crucial evolutionary impact [13,15], especially on population extinction [18,20]. In addition, established microbial populations are structured, even within a single patient [57], and competition is local, which decreases their effective size, thus making stochasticity relevant. While a few previous studies did take stochasticity into account, some did not include logistic growth or compensation of the cost of resistance [36], while others made specific assumptions on treatments or epidemiology [58,59], focused on numerical results with few analytical predictions [60], or assumed a constant population size [33].  Extinction probability p 0 versus the ratio R = (g ′ S − f ′ S )/g ′ S with biostatic or biocidal antimicrobial, for different carrying capacities K, either in the small-period regime, with T = 10 2.5 (A and B) or in the large-period regime, with T = 10 5 (C). Markers: simulation results, calculated over 10 3 realizations. Vertical dashed lines: predicted extinction thresholds, i.e. values of R such that T /2 = τ S (A and B) or t a R = τ S (C). Solid lines (C): Analytical estimates of p 0 from Eq. 1 (biostatic) or Eq. 4 (biocidal). For K = 10 2 and 10 3 , the analytical predictions in the biostatic and biocidal case are confounded, while for K = 10 4 we used two shades of green to show the slight difference (light: biostatic, dark: biocidal). Parameter values: µ 1 = 10 −5 , µ 2 = 10 −3 , f S = 1, f R = 0.9, f C = 1, g S = g R = g C = 0.1, and g ′ S = 0.1 (biostatic) or f ′ S = 1 (biocidal). All simulations start with 10 S microorganisms. model has the advantage of being quite general while fully accounting for stochasticity and finite-population effects. We showed that fast alternations of presence and absence of antimicrobial are inefficient to eradicate the microbial population and strongly favor the establishment of resistance, unless the antimicrobial increases enough the death rate, which can occur for biocidal antimicrobials at high concentration [46,47]. The corresponding criterion on the death rate g ′ S of sensitive microorganisms with biocidal antimicrobial, namely g ′ S > 2f S − g S , is generally more stringent than simply requiring drug concentrations to be above the MIC during the phases with biocidal antimicrobial, namely g ′ S > f S . Indeed, the population can re-grow without antimicrobial: in this regime, extinction occurs over multiple periods, and involves decaying oscillations. Conversely, for biostatic antimicrobials, as well as for biocidal ones at smaller concentrations, extinction has to occur within a single phase with antimicrobial, and thus the half-period T /2 has to be longer than the average extinction time τ S , which we fully expressed analytically. Importantly, shorter periods suffice for biocidal antimicrobials compared to biostatic ones in order to drive a population to extinction upon the first addition of antimicrobial, at the same value of R = (g ′ S − f ′ S )/g ′ S . Hence, the parameter regime where treatment is efficient is larger for biocidal drugs than for biostatic drugs. If T /2 > τ S , the microbial population goes extinct upon the first addition of antimicrobial, unless it is rescued by resistance. We obtained an analytical expression for the probability p 0 that the population is eradicated upon the first addition 12/36 of antimicrobial, assuming rare mutations. Note that with realistic bacterial mutation probabilities, namely µ 1 ∼ 10 −10 [45], the rare mutation regime remains relevant even for quite large populations. Moreover, real microbial populations are generally structured, which reduces their effective population size. Rescue by resistance can happen either if resistant mutants preexist upon the addition of antimicrobial, or if they appear after antimicrobial is added to the environment, during the decay of the population. Importantly, the latter case is fully prevented by perfect biostatic antimicrobials that completely stop division of sensitive microorganisms. This sheds light on the respective merits of different antimicrobial modes of action. Finally, we showed that due to stochastic extinctions, sub-MIC concentrations of antimicrobials can suffice to yield extinction of the population, and we fully quantified this effect and its dependence on population size. Throughout, all of our analytical predictions were tested by numerical simulations, and the latter also allowed us to explore cases beyond the rare mutation regime, where resistance occurs more frequently.
This work opens many possible theoretical extensions. In particular, it will be very interesting to include effects such as antibiotic tolerance, which tend to precede resistance under intermittent antibiotic exposure [4], as well as to consider the possibility of concentrations above the mutant prevention concentration, such that resistant microbes are also affected by the drug [4,55]. Another exciting extension would be to incorporate spatial structure [61][62][63] and environment heterogeneity, in particular drug concentration gradients. Indeed, static gradients can strongly accelerate resistance evolution [64][65][66][67], and one may ask how this effect combines with the temporal alternationdriven one investigated here. Besides, it would be interesting to explicitly model horizontal gene transfer of resistance mutations, to include realistic pharmacodynamics and pharmacokinetics [10], and also to compare the impact of periodic alternations to that of random switches of the environment [5][6][7][8][9][68][69][70]. Other effects such as single-cell physiological properties [3], phenotypic delay [71] or density dependence of drug efficacy [72] can further enrich the response of microbial populations to variable concentrations of antimicrobials.

Practical relevance
Our results have consequences for actual experimental and clinical situations. First, several of our predictions can be tested experimentally in controlled setups such as that presented in Ref. [3]. This would allow for an experimental test of the transition of extinction probability between the short-period and the long-period regimes, and of the predicted values of this extinction probability for large periods in the rare mutation regime. Second, the situation where the phases of absence and presence of antimicrobial have similar durations, which we considered here, is unfortunately clinically realistic. Indeed, a goal in treatment design is that the serum concentration of antimicrobial exceeds the MIC for at least 40 to 50% of the time [11]. Because bacteria divide on a timescale of about an hour in exponential growth phase, and because antimicrobial is often taken every 8 to 12 hours in treatments by the oral route, the alternation period lasts for a few generations in treatments: this is the same order of magnitude as the transition we found between the short-period and long-period regimes, meaning that this transition is relevant in clinical cases. Note that while this transition timescale depends on the death and birth rates of sensitive microbes in the presence of antimicrobial (see Eq. S6), and therefore on antimicrobial concentration, it does not depend on the value of the mutation rate or on the initial population size (as long as the half-period is longer than the initial population growth timescale, see Supporting Information, section 1.3.1), and it depends only weakly on the carrying capacity, e.g. logarithmically in the perfect biostatic case (see Eq. S7). Given the relevance of this transition between the short-period and the long-period regimes, it would be very interesting to conduct precise measurements of both division rates and death rates [73] in actual infections in order to determine the relevant regime in each case. This is all the more important that in the short-period regime, we showed that only large concentrations of biocidal antimicrobials are efficient, while other antimicrobials systematically lead to the de novo evolution of resistance before eradication of the microbial population. This constitutes a striking argument in favor of the development of extended-release antimicrobial formulations [74]. Conversely, a broader spectrum of modes of action can be successful for longer periods of alternation of drug absence and presence.
Despite the fact that only biocidal antimicrobials at high concentration are efficient for short alternation periods of absence and presence of drug, and the fact that the parameter regime where treatment is efficient is larger for biocidal drugs than for biostatic drugs, biostatic antimicrobials that fully stop division of sensitive microorganisms have a distinct advantage over drugs with other modes of action. Indeed, they prevent the emergence of resistant mutants when drug is present, which is all the more important that such resistant mutants are immediately selected for by the antimicrobial and are thus quite likely to rescue the microbial population and to lead to the fixation of resistance. This argues in favor of combination therapies involving a biostatic and a biocidal antimicrobial. Note however that the combined drugs need to be chosen carefully, because some of them have antagonistic interactions [75], depending on their mode of action.

13/36
Supporting Information 1 Population with a single type of microorganisms

Master equation
Let us first consider the simple case of a microbial population with a carrying capacity K comprising a single type of microorganisms. These microorganisms have a fitness and a death rate denoted by f and g, respectively. Let j be the number of individuals in the population at time t, satisfying 0 ≤ j ≤ K. The master equation describing the evolution of this population reads for all j: Indeed, recall that f (1 − j/K) is the division rate in the logistic model. We can write this system of equations aṡ P = RP, where R is the transition rate matrix: This Markov chain has a single absorbing state, namely j = 0, which corresponds to the extinction of the microbial population.

Average spontaneous extinction time
Let us study the average time it takes for the population to spontaneously go extinct, i.e. the mean first-passage time τ S (j 0 ) to the absorbing state j = 0, starting from j 0 microorganisms at t = 0. It can be expressed using the inverse of the reduced transition rate matrix R, which is identical to R except that the row and the column corresponding to the absorbing state j = 0 are removed [33,42]: Note that more generally, all the moments of the first-passage time can be obtained using the reduced transition rate matrix R: Here, the elements of the inverse of the reduced transition matrix read for all 1 ≤ j ≤ K, Substituting Eq. S5 in Eq. S3 yields If f = 0, e.g. in the presence of a biostatic antimicrobial that perfectly prevents all microorganisms from growing, Eq. S6 simplifies to: Note the formal analogy between Eq. S7 and the unconditional fixation time with biostatic antimicrobial (f = 0) in the Moran process, which corresponds to the extinction of the sensitive microbes in a population of fixed size [33]. Both situations involve the extinction of microorganisms that do not grow. Formally, the master equation of a Moran process describing a microbial population of fixed size N with two types of individuals A and B whose respective fitnesses are f A = 0 and f B = 1, reads: where l denotes the number of A individuals. The master equation for a logistic growth of a population with a single type of individuals (see Eq. S1) with f = 0 is equivalent under the transformation 1/N ← g. Fig. S1 shows how τ S (10) depends on the death rate g and the carrying capacity K. In particular, it shows that when g < f , average extinction times become very long for large values of K, while they are short for all K when g > f . In a deterministic description (valid for very large population sizes), g = f indeed corresponds to the transition between a population that decays exponentially and a population that reaches a steady state size. For finite-sized populations, stochasticity makes this transition smoother.

.1 Deterministic approximation and rise time
In the deterministic regime, for a population with only one type of microorganisms and a carrying capacity K, the number N of individuals at time t follows the logistic ordinary differential equation: where f represents fitness and g death rate. For f = g, the solution reads: where N 0 = N (0) is the initial number of individuals in the population. Note that we recover the usual law of logistic population growth for f > 0 and g = 0 (or for f > g by setting f ← f − g): . (S11) For f > g, the long-time limit of Eq. S10 is K(1 − g/f ). This equilibrium population size can also be found as the steady-state solution of Eq. S9, and corresponds to the birth and death rates being equal. The rise time t r (α), at which a fraction α of this equilibrium population size is reached, is given by: Hence, the initial growth of the population is governed by the timescale 1/(f − g), and features a weaker dependence on carrying capacity K and initial population size N 0 , as illustrated by Fig. S2.

Probability of rapid initial extinction
A microbial population starting with few individuals may go extinct quickly due to stochastic fluctuations, before reaching a substantial fraction of its equilibrium size K(1 − g/f ). Formally integrating the master equationṖ = RP with the initial condition j = j 0 allows to express the probability P 0 (t) that a population starting from j 0 microorganisms at t = 0 is extinct at time t: (S13) Fig. S3 shows the probability P 0 (t r ) that the microbial population goes extinct before the rise time t r versus g for f = 1. We notice that P 0 (t r ) ∼ g/f for small g and/or large K. This result can be proved analytically by assuming that the number of individuals is very small compared to the carrying capacity K and thus grows exponentially, which is relevant when rapid initial extinctions occur. One can then neglect the impact of the carrying capacity K in the master equation Eq. S1, yielding: The solution of this master equation is given by [76]: (S15) In particular, we thus obtain: Rapid initial extinction. A: Probability P 0 (t r ) that extinction occurs before the rise time t r (0.99) (see Eq. S12), when starting from a single microorganism, j 0 = 1, as function of the death rate g with f = 1 for different carrying capacities K. Results come from a numerical computation of Eq. S13. Solid black line: g/f . B: Probability of rapid initial extinction P 0 (100) as a function of the initial number of microorganisms j 0 , for different carrying capacities K. Data points correspond to numerical computations of Eq. S13. Parameter values: f S = 1 and g S = 0.1. Time t = 100 was chosen to evaluate P 0 because it is larger than typical rise times for the parameter values considered (see Fig. S2), but not too long, and thus captures rapid initial extinctions but not long-term ones (see Fig. S1).

19/36
2 Supplementary results on extinction probabilities and extinction and fixation times 2.1 Perfect biostatic antimicrobial analytical predictions for very small T , using the self-averaged fitnessf S (see main text). In panels B and C, markers are averages over 10 2 − 10 3 simulation realizations, error bars (often smaller than markers) represent 95% confidence intervals, and the oblique black line corresponds to T /2. In all panels, colored dashed lines correspond to T /2 = τ S , while black dashed lines correspond to T /2 = τ V . Parameter values: f S = 1 without antimicrobial, f ′ S = 0 with antimicrobial, f R = 0.9, f C = 1, g S = g R = g C = 0.1, µ 1 = 10 −5 and µ 2 = 10 −3 . All simulations start with 10 S microorganisms. Probability p 0 that the microbial population goes extinct before resistance gets established versus alternation period T , for various carrying capacities K. Markers: simulation results, with probabilities estimated over 10 2 − 10 3 realizations. Horizontal solid lines: analytical predictions from Eq. 4. B: Average time t ext to extinction versus alternation period T for various carrying capacities K. Data shown if extinction occurred in at least 10 realizations. C: Average time t f ix to fixation of the C microorganisms versus alternation period T for various carrying capacities K. Data shown if resistance took over in at least 10 realizations. Horizontal solid colored lines: analytical predictions for very small T , using the self-averaged death rateg S (see below). Horizontal solid black line: average spontaneous valley crossing time τ V = (f S − f R )/(µ 1 µ 2 g S ) (see main text). In panels B and C, markers are averages over 10 2 − 10 3 simulation realizations, error bars (often smaller than markers) represent 95% confidence intervals, and the oblique black line corresponds to T /2. In all panels, colored dashed lines correspond to T /2 = τ S , while black dashed lines correspond to T /2 = τ V . Parameter values: f S = 1, f R = 0.9, f C = 1, g S = 0.1 without antimicrobial, g ′ S = 1.1 with antimicrobial, g R = g C = 0.1, µ 1 = 10 −5 and µ 2 = 10 −3 . All simulations start with 10 S microorganisms.
Here, in the limit of very fast alternations, we expect an effective averaging of death rates, withg S = 0.6 for S microorganisms. Then, an R mutant that will fix in the population appears after an average timet a R = 1/(Ñ µ 1gSpSR ) whereÑ µ 1gS represents the total mutation rate in the population, withÑ = K(1 −g S /f S ) the equilibrium population size, and wherep SR = [1 − f S g R /(f RgS )]/[1 − (f S g R /(f RgS ))Ñ ] is the probability that a single R mutant fixes in a population ofÑ microorganisms where all other microorganisms are S. Subsequently, C mutants will appear and fix, thus leading to the full evolution of resistance by the population. The corresponding 21/36 average total time t f ix of resistance evolution [33] agrees well with simulation results for T /2 ≪ τ S (see Fig. S5C).  Let p c R (i) be the probability that exactly i R microorganisms are present when antimicrobial is added, provided that a lineage of R mutants then exists. It can be calculated in the framework of the Moran model, provided that the population size is stable around N = K(1 − g S /f S ) before antimicrobial is added, which is correct for T /2 ≫ t r , where t r is the rise time (see section 1.3.1). Specifically, p c R (i) can be expressed as a ratio of the sojourn time in state i to the total lifetime of the lineage in the absence of antimicrobial:

Population size dependence of the extinction transition
where τ d R is the average lifetime without antimicrobial of the lineage of a resistant mutant, assuming that it is destined for extinction, and τ d R,i is the average time this lineage spends with exactly i R individuals before going extinct. They satisfy τ d R = Note that we consider lineages destined for extinction in the absence of antimicrobial, because we focus on timescales much shorter than the spontaneous valley crossing time. In fact, in this regime, considering unconditional times yields nearly identical values for p c R (i). Employing the master equationṖ = RP that describes the time evolution of the number of R mutants within the Moran model [13,33], where R is the transition rate matrix, we obtain where π i is the probability that the R mutants go extinct, starting from i R mutants [13,33], whileR is the reduced transition rate matrix, which is identical to the transition rate matrix R, except that the rows and the columns corresponding to the absorbing states i = 0 and i = N are removed [33]. Here, we take N = K(1 − g S /f S ), which corresponds to the deterministic equilibrium population size. Finally, we obtain 3.2 Probability of fast extinction of the resistant mutants: p e R (i) Let us consider the beginning of the first phase with antimicrobial, and take as our origin of time t = 0 the beginning of the phase with antimicrobial. Here, we consider the general case of an antimicrobial that may modify both the division rate and the death rate of sensitive microorganisms. Provided that some resistant microorganisms are present at t = 0, how likely is it that they will undergo a rapid stochastic extinction and not rescue the microbial population and lead to the establishment of resistance? Denoting by i > 0 the number of resistant microorganisms at t = 0, let us estimate the probability p e R (i) that the lineage of R mutants then quickly goes extinct. As explained in the main text, we approximate the reproduction rate of the R microorganisms by where S(t) and R(t) are the numbers of S and R individuals at time t. This is appropriate because early extinctions of R mutants tend to happen shortly after the addition of antimicrobials, when S(t) ≫ R(t). Thus motivated, we further employ the deterministic approximation to describe the decreasing number S(t) of S microorganisms: where S 0 = K(1 − g S /f S ) is the number of sensitive microorganisms when antimicrobial is added. Note that if f ′ S = 0 and g ′ S = g S , i.e. in the perfect biostatic case, we obtain

24/36
for the decay of the number of S microorganisms with antimicrobial. However, we retain a stochastic description for the rare R mutants, and employ the probability generating function where i is the initial number of R microorganisms. Indeed, noticing that will enable us to calculate p e R (i) [38,39]. The probability P (j, t|i, 0) of having j R mutants at time t, starting from i R mutants at time t = 0, satisfies the master equation Here, we neglect mutants that appear after the addition of antimicrobial, and we deal with them in the calculation of p a R and p e ′ R . The generating function defined in Eq. S23 satisfies the partial differential equation This first-order nonlinear partial differential equation can be solved using the method of characteristics. For this, we rewrite it as: where implying that φ i is constant along a characteristic curve. Since dφ i /ds = (∂φ i /∂t)(dt/ds) + (∂φ i /∂z)(dz/ds), we obtain the following system of ordinary differential equations along a characteristic curve: (S29) We choose to integrate it as t = s , The second ordinary differential equation can be solved by introducing y = 1/(z − 1), which yields with where we have employed Eqs. S20 and S22. Eq. S31 is the equation of the characteristic line going through the point (0, z 0 ). Because φ i is constant along this line (see Eq. S28), we have φ i (z, t) = φ i (z 0 , 0) = z i 0 along this line, where we have used Eq. S23. Furthermore, for any (z, t) we can find the appropriate z 0 using Eq. S31. This yields the following expression for the generating function: where ρ(t) is given by Eq. S32 and f R (t) by Eq. S20. We can now express the probability p e R (i) from Eqs. S24 and S33: (S34) 25/36

Predicting the extinction probability p 0
Here, we test the analytical predictions for each term involved in the extinction probability p 0 of the population above the MIC, both in the perfect biostatic case (see Eq. 1) and in the biocidal case (see Eq. 4), by comparing them to numerical simulation results. To estimate the probability p R that at least one R mutant is present when antimicrobial is added, and to study the number of R mutants that are then present (Fig. S8A-B), simulations are run starting from j 0 = 10 S microorganisms (and no R) as in the rest of our work. We let the population evolve until a specific time, in practice t = 500, when population size is well-equilibrated around the deterministic stationary value K(1 − g S /f S ) without antimicrobial, and we analyze population composition at this time. To estimate the probability p e R of rapid extinction of the R lineage (Figs. S8C and S10A), we start from a population with i R microorganisms and K(1 − g S /f S ) − i sensitive microorganisms, and we let it evolve with antimicrobial until extinction of the S microorganisms. All these simulations are run with 2 types of microorganisms, S and R (no compensation). In Figs. S8C and S10A, we note that p e R does not seem to depend on K. In fact, our analytical estimate for p e R is fully independent of K because it only involves the ratio S(t)/K (see Eqs. S34, S32 and S20), whose deterministic dynamics is independent of K (see Eq. S9 with N (t) ← S(t)).
The probability p a R that resistance appears in the presence of antimicrobial involves the number of divisions N div and the mean time to extinction τ S of a population of S microorganisms in the presence of antimicrobial (see main text). To estimate these two intermediate quantities, simulations only involving S microorganisms in the presence of antimicrobial, starting from K(1 − g S /f S ) sensitive microorganisms, are performed ( Fig. S9A-B). For p a R itself (Fig. S10B), simulations with S and R microbes (no compensation), also starting from K(1 − g S /f S ) sensitive microorganisms in the presence of antimicrobial, are performed. The time of appearance of R mutants ( Fig. S9C-D) and the number of different lineages that appear during the decay of this population (Fig. S10C) ). B: Probability p c R that exactly i R microorganisms are present when antimicrobial is added, provided that at least one R mutant is present, plotted versus the number i of R mutants, for various carrying capacities K. Markers: simulation results, estimated over 10 4 realizations. Solid lines: analytical prediction in Eq. S19. Analytical prediction lines for K = 10 4 and K = 10 5 are confounded; note that the prediction holds in the weak mutation regime Kµ 1 ≪ 1, and thus fails for K = 10 5 here. C: Probability p e R of rapid extinction of the R lineage, plotted versus the number i of R mutants present when adding antimicrobial, for various different carrying capacities K. Markers: simulation results, with probabilities estimated over 10 4 realizations. Black solid line: analytical prediction from Eq. 2 (see main text).
Parameter values: f S = 1 without antimicrobial, f ′ S = 0 with antimicrobial, f R = 0.9, g S = g R = 0.1 and µ 1 = 10 −5 (A-B) or µ 1 = 0 (C).   Probability density function ℘ a R (t) of the time t of appearance of an R mutant, under the assumption that exactly one R mutant appears between the addition of antimicrobial and the extinction of the population of S microorganisms, for K = 10 3 (C) and K = 10 4 (D). Histograms: simulation results, with 10 3 realizations. Black solid lines: analytical prediction from Eq. 9. Parameter values: f S = 1, g S = 0.1 without antimicrobial, g ′ S = 1.1 with antimicrobial, and in panels C and D, f R = 0.9, g R = 0.1 and µ 1 = 10 −5 .   Fig S10. Biocidal antimicrobial: test of analytical predictions for each term involved in p 0 (see Eq. 4). Note that p R and p c R are the same as in Fig. S8A-B. A: Probability p e R of rapid extinction of the R lineage, plotted versus the number i of R mutants present when adding antimicrobial, for various different carrying capacities K. Markers: simulation results, with probabilities estimated over 10 4 realizations. Black solid line: analytical prediction from Eq. S34. B: Probability p a R that resistance appears in the presence of antimicrobial, plotted versus the carrying capacity K. Red markers: simulation results, with probabilities estimated over 10 4 realizations. Red solid line: analytical prediction, p a R = N div µ 1 with N div in Eq. 5. C: Probability that i distinct lineages of R mutants appear in the presence of antimicrobial, provided that at least one appears, plotted versus the carrying capacity K. Markers: simulation results, with probabilities estimated over 10 3 realizations. Parameter values: f S = 1, f R = 0.9, g S = 0.1 without antimicrobial, g ′ S = 1.1 with antimicrobial, g R = 0.1 and µ 1 = 0 (panel A) or µ 1 = 10 −5 (panels B and C).

29/36
3.4 A perfect biostatic antimicrobial yields a larger p 0 than a perfect biocidal antimicrobial For a perfect biostatic antimicrobial, the extinction probability p 0 upon the first addition of drug is given by Eq. 1: while for a biocidal antimicrobial, the extinction probabilityp 0 upon the first addition of drug is given by Eq. 4: In Eq. S36 we have employed tilde symbols to denote the quantities that differ compared to Eq. S35. Recall that p R and p c R (i) are the same in both cases. Indeed, these quantities characterize the state of the population when the antimicrobial is added, and thus do not depend on the type of treatment subsequently added.
The perfect biocidal antimicrobial corresponds to g ′ S → ∞. Let us prove that lim g ′ S →∞p0 < p 0 . From Eqs. S35 and S36 it is apparent that it suffices to prove that lim g ′ S →∞p e R (i) < p e R (i) for all i. The expression of both p e R (i) andp e R (i) is given in Eq. S34, but it involves the decaying number S(t) of S microorganisms once antimicrobial is added, which is different in these two cases, and is given respectively by Eq. S21 with f ′ S = f S in the biocidal case and by Eq. S22 in the perfect biostatic case.
Taking the limit g ′ S → ∞ in Eq. S34 yields lim g ′ S →∞p e R (i) = (g R /f R ) i , which corresponds to the extinction probability of a population that starts from i R microorganisms, in the absence of any other microorganisms [18]. But for a perfect biostatic antimicrobial, which, using Eq. S34, entails that p e R (i) > (g R /f R ) i , i.e. lim g ′ S →∞p e R (i) < p e R (i) for all i. Therefore, we have shown that lim g ′ S →∞p0 < p 0 : the extinction probability p 0 is larger for a perfect biostatic antimicrobial than for a perfect biocidal antimicrobial.
Importantly, our proof does not rely on the appearance of resistant microorganisms while antimicrobial is present, which cannot happen with a perfect biostatic antimicrobial, and whose probability tends to zero when g ′ S → ∞ with a biocidal antimicrobial. What makes the perfect biostatic antimicrobial more efficient than the perfect biocidal one is that S microorganisms survive for a longer time, thereby reducing the division rate of R microorganisms due to the logistic term, and favoring their extinction. Such a competition effect is realistic if S microorganisms still take up resources (e.g. nutrients) even while they are not dividing.

30/36
In the main text, in our discussion of sub-MIC concentrations of antimicrobials, we employed the fixation probability p SR of an R mutant in a population of S individuals with fixed size N : Here, we briefly justify this formula. Consider a birth-death process in which, at each discrete time step, one individual is chosen with a probability proportional to its fitness to reproduce and another one is chosen with a probability proportional to its death rate to die. Note that at each time step, the total number of individuals in the population stays constant. This model is a variant of the Moran model with selection both on division and on death. Let i be the number of R microorganisms and N − i the number of S microorganisms. At a given time step, the probability T + i that the number of R individuals increases from i to i + 1 satisfies: and similarly, the probability T − i that i decreases by 1 is given by: .
The probability p SR that the R genotype fixes in the population, starting from 1 R microorganism, then satisfies [48]: where We thus obtain the result announced in Eq. S38.

Detailed simulation methods
In this work, the evolution of microbial populations are simulated using a Gillespie algorithm [40,41]. Let us denote by j S , j R and j C the respective numbers of S, R and C individuals. The elementary events that can happen are division with or without mutation and death of an individual microbe of either type: • S k + S − − → 2S: Reproduction without mutation of a sensitive microbe with rate k + S = f e S (1 − (j S + j R + j C )/K)(1 − µ 1 ), with f e S = f S if no antimicrobial is present in the environment or f e S = f ′ S if antimicrobial is present in the environment.
• S kSR −−→ S + R: Reproduction with mutation of a sensitive microbe with rate k SR = f e S (1 − (j S + j R + j C )/K)µ 1 .
• S k − S − − → ∅: Death of a sensitive microbe with rate k − S = g e S , with g e S = g S if no antimicrobial is present in the environment or g e S = g ′ S if antimicrobial is present in the environment.
• R k − R − − → ∅: Death of a resistant microbe with rate k − R = g R .
• C k − C − − → ∅: Death of a resistant-compensated microbe with rate k − C = g C . The total rate of events is given by Simulation steps are as follows: 1. Initialization: The microbial population starts from j S = 10 sensitive microorganisms, j R = 0 resistant mutant and j C = 0 resistant-compensated mutant at time t = 0 without antimicrobial. The next time when the environment changes is stored in the variable t switch , which is initialized at t switch = T /2, the first time when antimicrobial is added.
2. The time increment ∆t is sampled randomly from an exponential distribution with mean 1/k tot , and the next event that may occur is chosen randomly, proportionally to its probability k/k tot , where k is its rate. For instance, division of a sensitive microorganism without mutation is chosen with probability k + S j S /k tot . 3. If t + ∆t < t switch , time is increased to t + ∆t and the event chosen at Step 2 is executed.
4. If t + ∆t ≥ t switch , the event chosen at Step 2 is not executed, because an environment change has to occur before. The environment change is performed: time is incremented to t = t switch , and the fitness and death rate of the sensitive microbes are switched from f S to f ′ S and from g S to g ′ S or vice-versa. In addition, t switch is incremented to t switch + T /2, and thus stores the next time when the environment changes.

We go back to
Step 2 and iterate until the total number of microbes is zero (j S + j R + j C = 0) or there are only resistant-compensated mutants (j S = 0, j R = 0 and j C = 0).