The role of tumbling frequency and persistence in optimal run-and-tumble chemotaxis

One of simplest examples of navigation found in nature is run-and-tumble chemotaxis. Tumbles reorient cells randomly, and cells can drift toward attractants or away from repellents by biasing the frequency of these events. The post-tumble swimming directions are typically correlated with those prior, as measured by the variance of the reorientation angle distribution. This variance can range from large, in the case of bacteria, to so small that tumble events are imperceptible, as observed in choanoflagellates. This raises the question of optimality: why is such a range of persistence observed in nature? Here we study persistent run-and-tumble dynamics, focusing first on the optimisation of the linearised chemotactic response within the two-dimensional parameter space of tumble frequency and angular persistence. Although an optimal persistence does exist for a given tumble frequency, in the full parameter space there is a continuum of optimal solutions. Introducing finite tumble times that depend on the persistence can change this picture, illuminating one possible method for selecting tumble persistence based on species-specific reorientation dynamics. Moving beyond linear theory we find that optimal chemotactic strengths exist, and that these maximise reaction when swimming in a wrong direction, but have little or no reaction when swimming with even the slightest projection along the chemoattractant gradient.


Introduction
Chemotaxis, the ability to navigate concentration fields of chemicals, is a ubiquitous feature of the microscopic world. Performed by uni-and multicellular organisms alike, it represents one of the simplest forms of navigation. Within this simplicity, various strategies exist. For instance, certain spermatozoa measure chemoattractant gradients by swimming in helical trajectories and bias the helical axis to move directly towards the chemoattractant (Friedrich & Juicher, 2007;Jikeli et al., 2015). Green algae can swim towards light-intense regions by measuring light source directions as they rotate around their own swimming axis (Yoshimura & Kamiya, 2001;Drescher et al., 2010) and also bias their navigation by switching between synchronous and anti-synchronous beating of their flagella (Polin et al., 2009). The slime mould D. discoideum is large enough to measure directly the spatial concentration gradients in cyclic AMP, along which it navigates (Bonner & Savage, 1947). The epitome of chemotaxis is perhaps the run and tumble of certain peritrichously flagellated bacteria such as E. coli (Berg & Brown, 1972).
Run-and-tumble motion is comprised of approximately straight lines (runs) interrupted by reorientation events (tumbles), as shown in Fig. 1. For example, in peritrichous bacteria, the helical flagella rotate counterclockwise and form a coherent bundle during swimming. A tumble is induced when (some of) the flagella reverse their rotational direction and the bundle is disrupted ( Fig. 1(a)). This creates a large, transient reorientation. Navigation along a gradient of chemoattractant becomes possible if the frequency of tumbling is biased in response to the chemoattractant distribution. This is a type of 'stochastic' navigation in the sense that the organisms that perform it do not swim directly in the desired direction but rather in a random direction and later decide whether such a turn was correct.
The tumbling frequency is modulated through measurements of the variation in concentration of chemoattractants, illustrated by the background of Fig. 2. In an idealized scenario, the reorienting tumbles result in unbiased new directions, uniformly chosen from the unit sphere, but this is not typically the case. Instead, a persistence with the previous direction is present (Berg & Brown, 1972). In fact, for some species, the individual reorientations are so small that they are hardly observable. This is the case in colonies of choanoflagellates (Kirkegaard et al., 2016a), within which the flagella beat independently (Kirkegaard et al., 2016b) and a reorientation event may simply arise from slight modulation of the beating of a single flagellum ( Fig. 1(b)). These smaller tumbles, or directionally persistent tumbles, add up to a smoother swimming while still allowing navigation. Figure 2 shows two realizations of run-andtumble swimming. In blue is the case of full-reorientation tumbles and in red is very persistent tumbles occurring with higher frequency. Over long timescales both of these swimmers perform random walks biased in the direction of the chemoattractant signal.
A strong theoretical understanding of chemotaxis exists (Tindall et al., 2008a,b), including the filtering of chemoattractant signals to which the cells react (Segall et al., 1986;Celani & Vergassola, 2010), the fundamental limits of measurement accuracy of such signals (Mora & Wingreen, 2010) and the limits they impose on navigation (Hein et al., 2016). Theories of chemotaxis are typically developed in the weak-chemotaxis limit (Celani & Vergassola, 2010;Locsei, 2007;Locsei & Pedley, 2009;Reneaux & Gopalakrishnan, 2010;Mortimer et al., 2011), the linear theory of which provides accurate explanations of many experimental observations. Theory (Locsei, 2007) and simulation (Nicolau et al., 2009) of chemotactic bacteria have also showed that for otherwise equal chemotactic parameters directional persistence of tumbles, as observed in experiments, can lead to enhanced chemotaxis.
This raises a more general question: could the effect of changing one parameter, such as directional persistence, be compensated by simultaneously changing another? Here, we address this question THE ROLE OF TUMBLING FREQUENCY AND PERSISTENCE 3 Fig. 2. Run-and-tumble trajectories. Both simulated trajectories drift to the right, starting from the origin. Full tumbles are shown in blue k = 0, λ 0 = 0.1 s −1 and persistent but frequent tumbles, in red k = 10, λ 0 = 2.0 s −1 . Circles indicate tumbles. Shared parameters: of global optimality and examine effects that lead to the existence of optima. For example, in linearized theories, the drift velocities for large chemotactic strength and for steep gradients can become unbounded, and thus the evaluation of one effect is done at fixed chemotactic response. But microorganisms do not have the restrictions that come with choosing theories that are analytically tractable. In real systems, the drift velocity will be limited (trivially) due to the finite swimming speed of the organisms and (more importantly) by uncertainties of measurements in noisy environments combined with diffusion. Throughout this study we optimize for the performance of a single organism, neglecting population effects (Peaudecerf & Goldstein, 2015).

Model
The model of chemotaxis used here assumes that organisms determine concentration gradients by comparing their concentration measurements at different times as they move through the medium, rather than detecting gradients over their own body, as is possible for organisms considerably larger than bacteria (Berg & Purcell, 1977). To be precise, we assume that as a cell swims it measures only the local chemoattractant concentration c(x, t) at its present position x. Moreover, in this section the concentration is taken to be linear in position, c(x) = c 0 + α x, allowing the notation c(t) = c(x(t)) for a given trajectory x(t). Cells are thought to store the history of these measurements and use this to bias their tumbling frequency λ. In the present model, this is embodied by the relationship λ = λ 0 1 + q , where · = max(0, ·). Here, q is the biaser, determined by a linear convolution of c, (2.1) 4 J. B. KIRKEGAARD AND R. E. GOLDSTEIN We take the kernel to be one studied previously and which corresponds well to experimental measurements (Segall et al., 1986;Celani & Vergassola, 2010), where v is the swimming speed and γ is the memory timescale of past measurements. The normalization is chosen such that max |q| = β in the absence of noise, and hence β solely specifies the chemotactic strength. The kernel satisfies κ(t) dt = 0 which gives perfect adaptation to any background chemoattractant concentration. This criterion arises naturally from maximizing the minimum chemotactic efficiency over all chemoattractant profiles (Celani & Vergassola, 2010). In particular, this is an important feature that will not arise from maximizing drift velocity alone and which we thus impose a priori here. We consider cells swimming in two dimensions in an instantaneous direction θ(t) with velocity v and discuss the 3D case in Appendix D. This direction is modulated by both rotational diffusion as d θ = √ 2D r dW, where W is a standard Wiener process, and by tumbles, the size of which is chosen from a von Mises distribution with parameter k, p( θ ) = exp(k cos( θ ))/2π I 0 (k), where I n are the modified Bessel functions of the first kind. Thus, k specifies the persistence of the tumbles, k = 0 corresponding to full tumbles.

Measurement timescale
If the time 1/λ 0 between tumbles is too long compared to the rotational diffusion time 1/D r , the trajectories will be reoriented by rotational diffusion and the organism will have lost the ability to bias its motion in any useful way. Thus, the biasing of tumbles must outcompete rotational diffusion and we expect λ 0 D r . In the absence of measurement noise, and if the organism can make instantaneous measurements (γ → ∞), increasing the chemotactic strength will monotonically increase the chemotactic drift, and in the limit β → ∞ chemotaxis becomes perfect despite the hindering effects of rotational diffusion. But we emphasize that this is only possible in the absence of measurement noise. Here, in contrast, we are interested in the noise-limited situation, and with noise comes another timescale, that over which accurate measurements can be made (see Appendix F for a simple lattice calculation illustrating this point).
To illuminate this situation we perform simulations in which cells are placed in a constant gradient (linear increase) of discrete chemoattractants. In a periodic 2L × 2L box, N molecules are placed, decreasing linearly in concentration from x = 0. This is achieved by choosing each molecule's position as Here, c(t) is then defined to be the number of molecules within a cell's area. This can be evaluated efficiently by storing the molecules in a k-D tree (a data structure for fast neighbour lookups), allowing for simulations with billions of molecules.
For the purposes of the present discussion, we define the chemotactic efficiency proportional to the average value of the concentration experienced by the organism in steady state where P(x) is the steady-state probability distribution. The normalization is chosen such that η = 1 corresponds to perfect chemotaxis. Figure 3 shows η as function of the measurement rate γ for various molecular concentrations. The curves clearly reveal the existence of an optimal γ for each choice of the (average) number of molecules sensed. Choosing γ too low means slow reaction, but with γ too high the organism does not have time to make an accurate measurement before previous information is forgotten. Varying the chemoattractant concentration (but not the gradient) shifts the optimal γ . At higher concentrations, the measurement noise is lower (Mora & Wingreen, 2010), and thus less time is needed to make an accurate measurement. The inset of Fig. 3 shows how the optimal γ varies with the concentration, and further shows that, within the resolution of our simulations, this optimum is independent of the base tumbling frequency λ 0 . This independence means that we can fix γ to its optimal value without specifying the value of λ 0 .
In this noise-dominated regime, γ is thus set by the chemoattractant concentration. If cells are kept in a chemostat with fixed concentration and gradient, as is the case considered here, the optimal γ is thus indicative of the underlying noise levels. In the following sections we fix γ , thus implicitly defining the noise levels. The goal then becomes to find the optimal choice of the remaining parameters for a given γ . Our approach ignores spatial variations in noise, but conclusions made are confirmed by checking them against the full simulation set-up used in this section.

Tumbling frequency and persistence
In earlier theoretical work, persistence of tumbles has been shown to enhance the chemotactic drift velocity (Locsei, 2007;Nicolau et al., 2009). Possible rationalizations for this effect include the idea of information relevance; for persistent tumbles, the gradient information (stored in q, (2.1)) remains more relevant than for full tumbles, where a completely random direction is chosen. It has also been 6 J. B. KIRKEGAARD AND R. E. GOLDSTEIN shown that an optimum base tumbling frequency λ 0 exists (Celani & Vergassola, 2010). Intuitively, in the low-noise limit, this optimum should be set by the rotational diffusion constant D r in order to dominate rotational diffusion but not hinder drift. Intuitively, one expects that introducing persistence, which results in smaller angular deflections from tumbles, would shift the optimal tumble frequency to higher values. So while it is clear that persistence can increase the chemotactic drift for a given base tumble frequency, it is not clear what the effect is if variations in λ 0 are also allowed.
To study this, we simulated cells performing chemotaxis in a constant gradient for various persistence parameters k while varying λ 0 . The results shown in Fig. 4 confirm the intuition outlined above; for large base tumbling frequency λ 0 , increasing the persistence k leads to increased chemotactic drift, as previously found. However, for low values of λ 0 the opposite effect is found. There is thus a trade-off between frequency and persistence of tumbles.
To gain further insight we study the relevant Fokker-Planck equation. As shown previously (Celani & Vergassola, 2010), the dynamics of the biaser q can be made Markovian by introducing three internal variables (moments of c) which obey a coupled system of differential equations It follows that the distribution function P(x, θ , {m j }, t), describing the probability density that a cell at time t is at position x, swimming in direction θ and has internal variables with values {m j }, obeys the 7 Fokker-Planck equation The left-hand side of (4.3) is the advective derivative with v cos θ being the instantaneous velocity in the x-direction. On the right-hand side, the first term describes rotational diffusion. The second term describes tumbling with frequency λ 0 1 + q(t) . The first term in the square bracket describes the probability mass gained by tumbles resulting in final angle θ and the second term describes probability mass lost by tumbles that start with angle θ . Finally, the last term of (4.3) implements the dynamics of the internal variables defined in (4.2). We begin by solving this system analytically for small β. Later we will argue that our conclusions remain qualitatively correct also for large β. In steady state, we find (Appendix A) Note that the only place λ 0 enters is through the quantity λ k , which has the optimal value From this fact, we conclude that the trade-off between tumbling frequency and tumble persistence is perfectly balanced; changes in k can be precisely compensated by changes in λ 0 . Figure 4 shows how this small-β result accurately matches the full numerical results even for β = 1/2. So while persistence can lead to enhanced chemotaxis, we find that this has nothing inherently to do with the persistence of the tumbles themselves, as the same increase can be achieved simply by lowering the base tumbling frequency.
With constant λ 0 , letting k → ∞ results in negligible drift. For large k, [1 − I 1 (k)/I 0 (k)] −1 ∼ 2k. Thus, we see that a continuous version of run and tumble (Kirkegaard et al., 2016a) emerges in the limit k → ∞ if λ 0 is scaled linearly with k, and we conclude that such a strategy is equally optimal to any other persistence of tumbles with the correct choice of tumble frequency. These results arise because we allow λ 0 to be chosen independently of γ . Without persistence, chemotaxis is optimized for λ 0 and γ of similar order. For cells with large persistence, however, optimization leads to λ 0 much larger than γ .
The above conclusions of perfect trade-off between λ 0 and k are made for cos θ using equations where second-order moments are neglected. By considering higher-order closures and by comparing to numerical simulations, we have found that the expansion P(x, θ , {m j }) = a 0 (x, {m j }) + a 1 (x, {m j }) cos θ captures the full steady-state distribution well, without the need for higher-order Fourier terms. The form of λ k can only change if higher-order Fourier modes become important. This is not the case even in the high-β regime, and so these conclusions are also valid there. Second-order effects such as small dependencies of the optimal γ on λ 0 and k could also perturb the result of perfect trade-off between tumble frequency and persistence. Furthermore, although we only considered the steady state here, the conclusions apply to the transient behaviour of the system. Our conclusions also hold in three dimensions as demonstrated in Appendix D.
Real bacteria are observed to have an angular distribution of tumbles with a non-zero mode (Berg & Brown, 1972). To model this, we consider the reorientation distribution g(θ , θ ) = ± e k cos(±μ+θ−θ ) /4π I 0 (k). This results in the substitution I 1 (k)/I 0 (k) → I 1 (k)/I 0 (k) cos μ in (4.5) (see Appendix B), leaving our conclusions unchanged. If the turns are biased in one direction (e.g. turning more clockwise than counterclockwise), such that g(θ , θ ) = e k cos(μ+θ−θ ) /2π I 0 (k), the efficiency can surpass that of unbiased cells. In this case the optimum strategy involves cells that continuously rotate, modulating their rotation speed as they swim (Appendix C). While this is an interesting behaviour, such a bias is a 2D phenomenon, although a related optimality may exist in 3D.
The fact that no single persistence value is globally preferable fits well with the experimental variations seen between biological species. The question still remains, however, if there are other effects that could induce a preferred tumble persistence. So far we have assumed the tumbles to be instantaneous. Including a finite tumble time can change the conclusions. In particular, since the optimal tumbling frequency for persistent tumbles is large, adding a constant time for each tumble results in large amounts of time in which no chemotactic progress is made, hence disfavouring persistence, On the other hand, one would expect a persistent tumble to take less time than a full tumble. The average tumble time τ should depend on the average angle turned. The precise form of this dependence will change with reorientation method. If the tumbling rotation is ballistic, the mean reorientation time should be proportional to the mean angle turned. If, on the other hand, the cell relies on a diffusive method (which includes simply not swimming), the reorientation time will be proportional to the mean of the squared angle. We parametrize this with the exponent ζ , with ζ = 1 for ballistic reorientations and ζ = 2 for diffusive and a mixture for values in-between. The mean tumbling time is thus τ = τ 0 π I 0 (k) π 0 δ ζ e k cos δ dδ. (4.7) The insets of Fig. 5 show trajectories for ballistic diffusive and intermediate exponents. For small chemotactic strength it is easy to incorporate this effect. The fraction of time spent swimming will be 1/(1 + τ λ 0 ), so we find (4.8) Crucially, λ 0 now appears alone, and we thus expect a global optimum to appear. Figure 5 shows cos θ evaluated for various exponents. For ballistic (ζ = 1) we find that full tumbles (k = 0) are optimal. For diffusive ζ = 2, the continuous dynamics (k → ∞) becomes optimal. In between, as shown in Fig. 5(b), a finite k optimum appears. A finite non-zero persistence also appears for diffusive scaling with an added constant, i.e. for (4.7) plus a constant.

Chemotactic strength
We now ask whether optimality exists for the chemotactic strength parameter β. Of course, in models linearized in β no such optimality can appear, and we must seek a different approach. Averaging over many numerical realizations of the model would allow these effects to be captured, but a large number of realizations is needed to gain accurate statistics, rendering parameter space exploration hard. Hence, we begin this section by gaining intuition through a more tractable model, which gives a good qualitative understanding of the problem.
The crucial insight for this simplified model is that in a constant gradient there is nothing to distinguish one value of the position variable x from another. In our full model, the biaser q(t) relaxes to −β times the cell's estimate of cos θ on a timescale ∼ γ . Such a behaviour can be modelled by the Langevin equation where we now consider q as an effective representation of the internal parameters, instead of modelling the dynamics of internal parameters directly (and they, in turn, defining q). The prefactor of 1/4 is chosen so that the effective relaxation time matches that of the kernel κ used in the full model, and we have introduced a noise term (such a noise term plays no role in the linearized system). We can specify this system fully through a Fokker-Planck equation for P(θ , q, t), Again we consider the steady-state behaviour. The optimal behaviour of the original system is well captured by this reduced model (Appendix E). Crucially, (5.2) is simple enough to be solved numerically using a hybrid spectral-finite difference method. We discretize q into {q i } and expand P(θ , q i ) = n a ni cos nθ . The differential q-operators in (5.2) are approximated by fourth-order central-difference schemes, and by orthogonality of cos θ and the linearity of (5.2) we can numerically solve directly for the coefficients a ni . We find that for all parameters the same efficiency ( cos θ ) can be obtained for any k by a simple rescaling of λ 0 . We thus set k = 0 in the remainder of this section without loss of generality. Figure 6(a) shows the resulting chemotactic drift under variation of the chemotaxis strength β and the base tumbling frequency λ 0 . For a given λ 0 , an optimal chemotactic strength does indeed exist. Choosing the chemotactic strength too high, evidently, also results in too many tumbles. Figure 6(a) also shows, however, that under variations of both β and λ 0 the optimal is found for β → ∞. For large β the optimum lies on a straight line (power law) relating β to λ 0 .
To understand what sets the optimal chemotactic strength, we seek an analytical approach, but since there is no perturbative small parameter we examine instead a Fourier-Hermite expansion of the form where H m are the Hermite polynomials. The choice of this expansion arises from the fact that q resembles an Ornstein-Uhlenbeck process, the solution of which is Gaussian, with a scale ζ , which, for a true Ornstein-Uhlenbeck process would be ∼ √ 4σ/γ . Presently, cos θ also contributes to variations in q, and so ζ ∼ √ 1 + 4σ/γ . Here, we truncate at N = M = 1, which while yielding numerically inaccurate results nevertheless reveals the key dynamics. Higher-order terms can easily be calculated, but the expressions become lengthy. Exploiting orthogonality, the steady-state coefficients {a nm } = (a 00 , a 10 , a 01 , a 11 ) are found as the null space of whence cos θ = a 10 /(2 a 00 ). Optimizing this for λ 0 we obtain the dashed white curve in Fig. 6(a). In the limit β → ∞ this has the form Although the expansion does not quite capture the location of the optimum, the correct scaling is obtained. The global optimum is found at β → ∞ and we learn that λ 0 β tends to a finite value in that limit. In detail, the optimization tries to diminish the base tumbling contribution in the expression λ 0 1 + q and the optimum is found in limit where λ 0 1 + q → λ 0 q . Explicitly making this substitution in (5.2) and definingβ = λ 0 β, we obtain a system that has a finite optimal value of chemotactic strength. This is shown in Fig. 6 for various noise strengths σ . To verify our conclusions based on this model we turn to the full simulation. Exactly as in the simplified model, we find optimum behaviour after making the substitution λ 0 1 + q → λ 0 q . This is shown in Fig. 6(c) for various levels of chemoattractant concentrations, confirming our conclusions. It is perhaps surprising that the optimum is found in this limit, since no modulation of tumbling frequency then can occur if q < 0, which is the case when the cell swims just slightly in the correct direction, and thus in the limit of no noise, the angular distribution will be governed simply by rotational diffusion on θ ∈ [−π/2, π/2]. In this optimal limit, the cells have minimized the time they spend swimming in any wrong direction, which, evidently, even though it leads to no active modulation for q < 0, is also the optimum for the total chemotactic drift. For stochastic taxis to work, the modulation must necessarily be a monotonically increasing function of q. Strong reaction when swimming in the wrong direction (q > 0) is thus typically coupled will smaller reaction when swimming in the correct direction (q < 0). Our results show, at least for the presently chosen form of modulation, that with this trade-off the best choice is to react very strongly when swimming in the wrong direction, even though this reduces the effectiveness of chemotaxis while swimming in the right direction.

Conclusions
In this study we have taken an approach to understanding run-and-tumble chemotaxis based on simultaneous parameter optimization. For the specific system studied here, cells in constant gradients, we have focused on the base tumbling frequency λ 0 , tumbling persistence k and chemotactic strength β as key parameters. Varying any one parameter alone, there is a unique value that optimizes the chemotactic drift, but when all parameters are free there is a higher-dimensional optimal locus.
In particular, the trade-off in optimality between the base tumbling frequency and tumble persistence is 'perfect' in the sense that any increase, say, in persistence can be countered by an increase in base tumble frequency. After a persistent tumble, it would seem that the current value of q would stay more relevant than for a full tumble indicating that persistence could lead to enhanced chemotaxis. The intuition behind this argument is based on comparing a 'single' full tumble to a 'single' persistent tumble, but a more appropriate comparison would be to a 'series' of persistent tumbles. And as evident by our calculations, comparing in this way the argument of preservation of information leads to similar behaviour for all persistence parameters. One might also argue for the opposite: after a full tumble (or a series of persistent tumbles) there is a high risk that the new direction is wrong. Therefore, one could argue that keeping q large is a desirable strategy, since it increases the probability of correcting the tumble quickly. Our results show that both of these arguments are incorrect. Although one could imagine a model in which q is explicitly altered after each tumble, say q → a q, the study of this variant would require relaxing the assumption of fixed γ in order to find global optima.
Introducing a finite tumble time moves the model away from the perfect trade-offs described above. We have shown that an optimum persistence emerges that depends on the manner in which the tumble time depends on reorientation angle. For ballistic tumbles, zero persistence is optimal, while continuous tumbling is optimal for diffusive tumbles. A finite persistence emerges for exponents in-between, i.e. for tumbles that are superdiffusive but not ballistic. Such a tumble could simply be a mixture of ballistic and diffusive reorientations that when taken together have a superdiffusive behaviour. Diffusive tumbles are easy to generate: a cell can do so by simply not swimming and more generally by wiggling its flagella in random directions. Ballistic tumbles require directed motion of the flagella (even though the actual direction is chosen randomly). Actual tumbles might be a combination of a fixed tumble time plus a diffusive scaling, which would favour a finite tumble persistence (non-zero and non-infinite). One could furthermore imagine minimizing tumble times by maintaining a finite swimming speed during tumbles, e.g. via polymorphic transformations of the flagella (Goldstein et al., 2000).
In addition to studying the weak chemotaxis limit, we have also investigated the effects of strong chemotaxis. While this is, naturally, dependent on the precise functional form chosen for the biasing of tumbles, we have shown that optima in chemotactic strength can also emerge. Through an analytical approximation we found that the form λ 0 1 + q has an optimal value of β for constant λ 0 . Allowing for variations in λ 0 the optimum shifts to β → ∞, and insteadβ = βλ 0 as β → ∞ has an optimal value. This naturally leads to the question of the optimal form of the modulation. Preliminary results have shown that other simple choices, e.g. λ 0 e q , do not perform better than the form studied here. In general such problems can be considered partially observable Markov decision processes, and a potential optimal functional form could be found by methods such as reinforcement learning. Results from such analysis, however, will probably be strongly dependent on the model set-up, and a form that optimizes for drift in constant gradients will not necessarily do well in other gradients.
Comparing to experimental systems, our result that persistence does not have a unique optimum when allowing for variations in base tumble frequency fits well with the variation that exists between species. The chemotactic strength result that the optimum is found as λ 0 → 0 is a special outcome of maximizing the drift velocity in a constant gradient. In more complex domains, the cells will need to react also to spatial variations (Appendix E) and thus need a finite λ 0 and smaller β. Maximizing the minimum chemotactic efficiency over many chemoattractant profiles reveals the experimental values associated with the kernel κ and base tumbling frequency (Celani & Vergassola, 2010). A linear approach cannot, however, reveal an optimal chemotactic strength. An interesting question for future research is thus: can maximizing the minimum chemotactic efficiency over suitably chosen noise models reveal an optimal finite chemotactic strength? While difficult to tackle analytically, numerical methods may be able to answer such questions. consider the case of a very noisy signal. To simplify further we put the cells and chemoattractants on an equilateral grid. We assume that each measurement carries the same error σ . In reality, the measurement of a concentration c has an error ∝ √ c, but such effects are expected to be second order. Thus, at each grid position i, the cell measures a concentration c i ∼ N (c(x i ), σ 2 ), where c(x i ) is the time average of the signal at that position.
In particular, a cell will swim n lattice points and calculate Q = j k j c i(j) , where k j is some kernel, reminiscent of the continuous kernel used in the main text. In the simplest model, if Q > 0 the cell will keep going in the same direction but turn if Q < 0. We begin by determining the optimal {k j }.

F.2 Chemotaxis in a constant gradient
The probability that Q < 0 after a swim of n lattice points follows a geometric distribution with parameter The efficiency is thus η = 1 − 2q, which is maximized for q → 0, corresponding to n → ∞. This is in the absence of spatial variations and diffusion effects.

F.3 Effective rotational diffusion
We now add the feature that after each jump the particle will flip either because Q < 0 or another process R < 0, which has parameter D r for a single jump. The probability R < 0 after n jumps will thus be r = 1 − (1 − D r ) n . Thus, the probability of a turn after the n jumps isq = q + r − qr when going right and when going leftp = (1 − q) + r − (1 − qr). Calculating the efficiency we thus find where q is defined as in (F.6). This defines an optimal n as shown in Fig. F8. The emergence of an optimal n corresponds to the emergence of an optimum γ in the main text.

F.4 Chemotaxis in a spatially varying gradient
Spatial variation from linear concentration profiles can also affect the optimal choice of n. Consider cells swimming in a gradient being held to a fixed value c 0 > 0 at the origin. The diffusion equation allows To solve this infinite set of equations, we truncate in an appropriate manner at m equations and then let m → ∞. We assume m even and to conserve probability, for finite m set T m−1,m−1 = p and T m,m−1 = q. This leads to 14) where k = m/2 − 2 and A is a normalization constant determined by After a long calculation we find (for q > 1/2 ) in the limit m → ∞, |x| = x n 2 2 − 1 q(n) + 1 2q(n) − 1 .
(F.16) Figure F9 shows a minimum appearing for large noise. Thus, we see that an optimal measurement distance must also be balanced with potential spatial variations not just with rotational diffusion. Fig. F9. Average position |x| for as a function of n, the number of jumps before deciding to change direction, as described by (F16). Chemotaxis is optimal when |x| is minimized, since the chemoattractant concentration decreases from x = 0. Parameters as in Fig. F8.