Here, we present the details of our analytic derivations.

### A.1 Probability of fixation

According to [26], the probability of fixation *u*(*s*) of a single allele with selection coefficient *s* is given by

u(s)=\frac{1-{e}^{-2s}}{1-{e}^{-2Ns}}.

(A1)

For *s* ≳ 1/*N*, this expression simplifies to

u(s)=\frac{1}{N}+\frac{N-1}{N}s+\mathcal{O}({s}^{2}),

(A2)

whereas for *Ns* ≫ 1, this expression simplifies to

*u*(*s*) ≈ 1 - e^{-2s}.

### A.2 A single allele drifting to fixation or loss

We first consider a single allele with selective advantage *s* drifting to fixation or extinction, and ask how many mutations this allele generates until it is either fixed or lost. We will treat these two cases separately. Let *n*_{fix}(*s*) be the expected number of mutations generated while the allele drifts to fixation, and let *n*_{loss}(*s*) be the expected number of mutations generated while the allele drifts to extinction. We calculate these two quantities using diffusion theory, by integrating the sojourn times of the allele over all frequencies.

For an allele with selective coefficient *s* and starting at frequency *p* = 1/*N*, [50] calculated its mean sojourn time *τ*(*y*) between frequencies *y* and *y* + *dy* as

*τ*(*y*) = 2[*V*(*y*)*G*(*y*)]^{-1}[*u*_{loss}(1/*N*)*g*(0, *y*)*θ*(1/*N* - *y*) + *u*_{fix}(1/*N*)*g*(*y*, 1)*θ*(*y* - 1/*N*)].

Here,

V(y)G(y)=y(1-y){e}^{-2Nsy}/N,

(A5)

g(a,b)=\frac{{e}^{-2Nsa}-{e}^{-2Nsb}}{2Ns},

(A6)

{u}_{\text{loss}}(p)=\frac{{e}^{-2Nsp}-{e}^{-2Ns}}{1-{e}^{-2Ns}},

(A7)

{u}_{\text{fix}}(p)=1-{u}_{\text{loss}}(p)=\frac{1-{e}^{-2Nsp}}{1-{e}^{-2Ns}},

(A8)

and *θ*(*z*) is the Heaviside step function. We want to integrate expressions involving *τ*(*y*) from *y* = 0 to *y* = 1. Since *y* = 1/*N* corresponds to a single copy of the allele that drifts to fixation, values of *y* less than 1/*N* are not relevant for our analysis. Therefore, we discard the term proportional to *θ*(1/*N* - *y*) in Eq. (A4), and use in what follows

*τ*(*y*) = 2*u*_{fix}(1/*N*)*g*(*y*, 1)/[*V*(*y*)*G*(*y*)] for *y* > 1/*N*.

### A.3 Number of mutations conditional on fixation

For the sojourn time conditional on fixation, *τ*_{fix}(*y*), [50] finds

*τ*_{fix}(y) = *τ*(*y*)*u*_{fix}(*y*)/*u*_{fix}(*p*).

Using this expression, we have

{n}_{\text{fix}}(s)=NU{\displaystyle {\int}_{1/N}^{1}{\tau}_{\text{fix}}(y)ydy}.

(A11)

Plugging the expressions for *V*(*y*)*G*(*y*), *g*(*a*, *b*), *u*_{fix}(*p*), and *τ*(*y*) into *τ*_{fix}(*y*), we arrive at

{\tau}_{\text{fix}}(y)=\frac{1}{s(1-{e}^{-2Ns})}\frac{(1-{e}^{-2Nsy})(1-{e}^{-2Ns(1-y)})}{y(1-y)}.

(A12)

This expression corresponds to the one by [51]. Note that *yτ*_{fix}(*y*) → 0 for *y* → 0. Therefore, we can extend the lower limit of integration to 0 in Eq. (A11), and rewrite *n*_{fix}(*s*) as

{n}_{\text{fix}}(s)=\frac{NU}{s(1-{e}^{-2Ns})}I(2Ns)

(A13)

with

I(a)={\displaystyle {\int}_{0}^{1}\frac{(1-{e}^{-ay})(1-{e}^{-a(1-y)})}{1-y}dy}.

(A14)

The integral *I*(*a*) can be rewritten as

*I*(*a*) = *γ* - Ei(-*a*) + ln(*a*) + *e*^{-a}[*γ* - Ei(*a*) + ln(*a*)],

where *γ* ≈ 0.5772 is the Euler-Mascheroni constant and Ei(*z*) is the exponential integral,

\text{Ei}(z)=-{\displaystyle {\int}_{-z}^{\infty}\frac{{e}^{-t}}{t}dt.}

(A16)

For *s* ≲ 1/*N*, we find

{n}_{\text{fix}}(s)={N}^{2}U+\mathcal{O}({s}^{2}).

(A17)

For *Ns* ≫ 1, we obtain the asymptotic expansion

{n}_{\text{fix}}(s)\approx \frac{NU}{s}[\mathrm{ln}\phantom{\rule{0.5em}{0ex}}(2Ns)+\gamma ],

(A18)

using [52] 5.1.51,

\begin{array}{cc}\text{Ei}(-z)~-\frac{{e}^{-z}}{z}\left(1-\frac{1}{z}+\frac{2}{{z}^{2}}-\frac{6}{{z}^{3}}\right)& \text{forlarge}z.\end{array}

(A19)

### A.4 Number of mutations conditional on extinction

For the sojourn time conditional on extinction, *τ*_{loss}(*y*), [50] finds

*τ*_{loss}(*y*) = *τ*(*y*)*u*_{loss}(*y*)/*u*_{loss}(*p*).

Using this expression, we have

{n}_{\text{loss}}(s)=NU{\displaystyle {\int}_{1/N}^{1}{\tau}_{\text{loss}}(y)ydy}.

(A21)

Plugging the expressions for *V*(*y*)*G*(*y*), *g*(*a*, *b*), *u*_{loss}(*p*), and *τ*(*y*) into *τ*_{loss}(*y*), we find

{\tau}_{\text{loss}}(y)=\frac{1}{s(1-{e}^{-2Ns})}\frac{{e}^{2s}-1}{1-{e}^{-2}(N-1)s}\frac{({e}^{-2Nsy}-{e}^{-2Ns})(1-{e}^{-2Ns(1-y)})}{y(1-y)}.

(A22)

We rewrite *n*_{loss} as

{n}_{\text{loss}}=\frac{NU}{s(1-{e}^{-2Ns})}\frac{{e}^{2s}-1}{1-{e}^{-2(N-1)s}}J(N,s)

(A23)

with

J(N,s)={\displaystyle {\int}_{1/N}^{1}\frac{({e}^{-2Nsy}-{e}^{-2Ns})(1-{e}^{-2Ns(1-y)})}{1-y}dy.}

(A24)

The integral can be rewritten as

*J*(*N*, *s*) = -2*e*^{-2Ns}(*γ* - Chi[2(*N* - 1)*s*] + ln [2(*N* - 1)*s*]),

where Chi(*z*) is the hyperbolic cosine integral,

\text{Chi}(z)=\gamma +\mathrm{ln}\phantom{\rule{0.5em}{0ex}}(z)+{\displaystyle {\int}_{0}^{z}\frac{\mathrm{cosh}\phantom{\rule{0.5em}{0ex}}(t)-1}{t}dt}.

(A26)

For *s* ≲ 1/*N*, we find

{n}_{\text{loss}}(s)=(N-1)U+\mathcal{O}({s}^{2}).

(A27)

For *Ns* ≫ 1, we obtain the asymptotic expansion

{n}_{\text{loss}}(s)\approx \frac{U}{2{s}^{2}}(1-{e}^{-2s}),

(A28)

using

\begin{array}{cc}\text{Chi}(z)\approx \frac{\text{Ei}(z)}{2}\approx \frac{{e}^{z}}{2z}& \text{forlarge}z.\end{array}

(A29)

[This expansion follows directly from the definitions of Chi(*z*), cosh(*z*), and Ei(*z*).]

### A.5 Number of mutations within a given time interval

We now extend the derivations in Section A.3 to calculate the number of mutations to allele 2 generated within a certain time interval *T*, conditional on fixation of allele 1. We assume that *T* is sufficiently large so that allele 1 has time to reach fixation within this interval. We only consider the case conditional on fixation because no new mutations are generated once allele 1 has gone extinct.

We calculate *n*(*s*) = *n*_{fix}(*s*) + *n*_{T}(*s*), where *n*_{T}(*s*) is the total number of mutations generated once the first mutation has reached fixation. We have

*n*_{T}(*s*) = *NU*[*T* - *t*_{fix}(*s*)],

where *t*_{fix}(*s*) is the time to fixation of a mutation with selective advantage *s*. This time is given by the integral over all sojourn times,

{t}_{\text{fix}}(s)={\displaystyle {\int}_{0}^{1}{\tau}_{\text{fix}}(y)dy}=\frac{{I}_{2}(2Ns)}{s(1-{e}^{-2Ns})}

(A31)

with

{I}_{2}(a)={\displaystyle {\int}_{0}^{1}\frac{(1-{e}^{-ay})(1-{e}^{-a(1-y)})}{y(1-y)}dy}.

(A32)

A partial fraction decomposition of the integrand reveals that *I*_{2}(*a*) = 2*I*(*a*), and thus we have

{t}_{\text{fix}}(s)=\frac{2I(2Ns)}{s(1-{e}^{-2Ns})}

(A33)

Combining this result with Eqs. (A13) and (A30), we find

\begin{array}{c}n(s)={n}_{\text{fix}}(s)+{n}_{\text{T}}(s)=NU\left[T-\frac{I(2Ns)}{s(1-{e}^{-2Ns})}\right]\\ =NUT-{n}_{\text{fix}}(s).\end{array}

(A34)

Note that *n*(*s*) = *n*_{fix}(*s*) for *T* = *t*_{fix}(*s*).

For *s* ≲ 1/*N*, we find

n(s)=NU(T-N)+\mathcal{O}({s}^{2}).

(A35)

For *Ns* ≫ 1, using Eqs. (A15) and (A19), we obtain the asymptotic expansion

n(s)\approx NU\left(T-\frac{\mathrm{ln}\phantom{\rule{0.5em}{0ex}}(2Ns)+\gamma}{s}\right).

(A36)

### A.6 *ξ* for *sβ*≪ 1

From Eq. (4), using Eqs. (A27), (A35), and (A2), we obtain to first order in *sβ*

\xi \approx 1+\frac{{e}^{-NUu(s)}-{e}^{-NU(T-N)u(s)}}{{u}_{2}(s,0)}s\beta +\mathcal{O}({s}^{2}{\beta}^{2}).

(A37)

If further *NU*(*T* - *N*)*u*(*s*) ≪ 1, we obtain

\xi \approx 1+N(1-N/T)s\beta +\mathcal{O}({s}^{2}{\beta}^{2}),

(A38)

and for *T* → ∞,

\xi \approx 1+Ns\beta +\mathcal{O}({s}^{2}{\beta}^{2}).

(A39)

### A.7 *ξ* for *Nsβ*≫ 1

For *Nsβ* ≫ 1, only the first term contributes to Eq. (2), and we obtain from Eqs. (A36) and (A3)

{u}_{2}(s,\beta )=(1-{e}^{-2s\beta})\left[1-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}\left(-NU\left[T-\frac{\mathrm{ln}\phantom{\rule{0.5em}{0ex}}(2Ns\beta )+\gamma}{s\beta}\right]\left(1-{e}^{-2s}\right)\right)\right].

(A40)

Likewise, in this limit we can simplify Eq. (3) to

{u}_{2}(s,0)=\frac{N+1}{N}-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}[-NU(T-N)(1-{e}^{-2s})]/N-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}[-NU(1-{e}^{-2s})],

(A41)

giving

\xi \approx \frac{(1-{e}^{-2s\beta})\left[1-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}\left(-NU\left[T-\frac{\mathrm{ln}\phantom{\rule{0.5em}{0ex}}(2Ns\beta )+\gamma}{s\beta}\right]\left(1-{e}^{-2s}\right)\right)\right]}{(N+1)/N-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}[-NU(T-N)(1-{e}^{-2s})]/N-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}[-NU(1-{e}^{-2s})]}.

(A42)

Furthermore, for *T* → ∞, this expression simplifies to

\xi \approx \frac{(1-{e}^{-2s\beta})}{(N+1)/N-\mathrm{exp}\phantom{\rule{0.5em}{0ex}}[-NU(1-{e}^{-2s})]}.

(A43)

If *NU* ≪ 1, then *ξ* → *N* in the limit *s* → ∞.