Nonlinear-Cost Random Walk: exact statistics of the distance covered for fixed budget

We consider the Nonlinear-Cost Random Walk model in discrete time introduced in [Phys. Rev. Lett. 130, 237102 (2023)], where a fee is charged for each jump of the walker. The nonlinear cost function is such that slow/short jumps incur a flat fee, while for fast/long jumps the cost is proportional to the distance covered. In this paper we compute analytically the average and variance of the distance covered in $n$ steps when the total budget $C$ is fixed, as well as the statistics of the number of long/short jumps in a trajectory of length $n$, for the exponential jump distribution. These observables exhibit a very rich and non-monotonic scaling behavior as a function of the variable $C/n$, which is traced back to the makeup of a typical trajectory in terms of long/short jumps, and the resulting"entropy"thereof. As a byproduct, we compute the asymptotic behavior of ratios of Kummer hypergeometric functions when both the first and last arguments are large. All our analytical results are corroborated by numerical simulations.


I. INTRODUCTION
Stochastic processes have long been indispensable tools for modeling diverse phenomena spanning a multitude of disciplines, encompassing the realms of biology, finance, engineering, and beyond [1][2][3][4].These processes, whose simplest incarnation is the classical random walk in discrete time, are useful to model systems undergoing transitions between various states, guided by probabilistic rules.Over the past century, scientists have harnessed the power of stochastic modeling to gain insights into complex dynamical systems, where randomness and uncertainty play a major role.
Intriguingly, many of these systems admit a quite natural description in terms of costs (or rewards) associated with the transitions between different states.These cost functions are often governed by nonlinear functions, as argued below.This coupling of stochastic dynamics with nonlinear cost structures has unveiled unexpected and even paradoxical behaviors, giving rise to arXiv:2310.08966v1 [cond-mat.stat-mech]13 Oct 2023 fascinating questions and practical applications.Consider, for instance, the motion of animals in space in the presence of environmental noise.Several animals employ intermittent strategies [5], switching between periods of rapid locomotion and phases of deliberate, slow-paced movement, during which they search locally for food or correct their direction [4,6].The reduced distance covered during these slower intervals can be characterized as an effective nonlinear cost [7].
In the realm of wireless communication, devices can operate in different activity/inactivity states ('off,' 'idle,' 'transmit,' or 'receive') with different levels of energy consumption ('costs') when they undergo transitions between these states [8,9].Even in the complex domain of biochemical reactions, which take place sequentially through a series of intermediate (secondary) states (reactions), it is often convenient to associate a total cost to the primary reaction (e.g. the energy/heat produced or consumed overall) being the sum of the intermediate costs generated by the secondary reactions [10].In the world of finance and risk-management, consider for instance a car driver's insurance premium: in the so-called bonus-malus regime, the number of car accidents caused by the driver within a given insurance window will determine a jump in how much money they will be asked to pay (premium) to insure their vehicle in the future.The premium typically follows a highly non-linear pattern, characterized by a steep increase for reckless drivers, and a long recoil period to get back to a more convenient insurance class after an accident [11].In the context of software development, time-pressured programmers often face a difficult choice between implementing robust designs and safeguards in their code -a preferable but more expensive long-term solution -or adopting an expedient and patchy fix to rush the project forward but incurring in the so-called "technical debt" [12].In all the examples above, the total cost or reward of different trajectories (i.e.sequences of transitions) between the same initial and final states may depend on the precise microscopic arrangement of "cheap" vs. "costly" jumps due to the non-linear nature of the cost function involved.Additionally, in all these examples it is quite interesting and natural to ask how a global budget constraint (for example, fixing the total energy of a foraging animal or a wireless device, or the total amount of resources to dedicate to a task) will impact the number and type (cheap vs. costly) of the allowed transitions that make up a typical trajectory.In this paper, we provide an analytical answer to this question in the context of a model of diffusion in discrete time and continuous space that we introduced in [13].
In the fields of Mathematics and Engineering, the study of stochastic processes entwined with costs has been looked at through the lens of so-called Markov reward models [14][15][16], where a cost/reward is associated to each jump between the states of a Markov process.In [17], a random walk within a Lévy random environment until to a first-passage event was investigated.Considering a nonlinear cost associated to each step, the joint distribution of displacement and total cost was derived.In Refs.[18,19] stochastic systems with resetting where a cost is associated to each restart were investigated.In particular, in Ref. [18], optimal control theory was applied to identify the optimal resetting strategy to minimize a given cost function.In [19], a random walk with constant resetting rate was considered with a space-dependent cost for each resetting event.The statistics of the total cost was computed analytically for a variety of cost functions.In spite of these interesting works, a more thorough exploration of how nonlinear cost functions influence cost fluctuations, both within the typical and large deviation regimes, remains an interesting frontier ripe for further investigation.
In a recent Letter [13], we introduced the Nonlinear-Cost Random Walk (NCRW) model in discrete time, and we used the everyday occurrence of taxi rides and associated fares as a prominent motivation for its study.Taxi journeys through bustling cities often entail a mixture of rapid progress and sluggish segments, dictated by factors such as traffic congestion and traffic lights.
The fare charged to passengers is algorithmically determined on the fly by a device -the taxi meter -that adheres to a rather universal and straightforward recipe [20].Each municipality prescribes a threshold speed, η c , derived from statistical analyses of local traffic patterns.If the taxi surpasses η c , the meter tallies the fare based on the distance covered, while a slower pace results in time-based fare computation.This seemingly fair approach ensures that drivers are compensated even when they face prolonged periods of slow progress.For example, London's Tariff I rate dictates that the meter should charge 20 pence for every 105.4 meters covered or 22.7 seconds elapsed, whichever is reached first [21].The seemingly innocuous structure of the taxi fare calculation conceals a fascinating phenomenon known as the "taxi paradox" [20].This paradox materializes when two taxis commence their journey together from point A and arrive simultaneously at point B, yet levy substantially different fares due to their unique sequences of slow and fast segments during their trajectories.
The NCRW model is a Markov process, where a one-dimensional walker's position X n at discrete time n is a positive random variable evolving according to starting from the origin X 0 = 0.The jumps η n are positive random variables, drawn independently at each time from an exponential pdf p(η) = exp(−η).Each jump incurs a positive cost C n , which also evolves via a Markov jump process described by where h(η) is a non-linear cost function, which we take of the form where θ(x) is the Heaviside step function.This function h(η) mimics the way taxi meters work, since jumps shorter than the critical size η c in one unit of time (slower jumps) incur a unit fee, whereas longer (faster) jumps are more costly, with the fee being proportional to the length (velocity) of the jump.For a typical trajectory of the system, see Fig. 1.Our model has therefore two parameters: b, the cost per unit distance covered at high speed, and η c , the critical jump length (or speed) separating time-like and space-like charges.The position X = n i=1 η i and the cost C = n i=1 h(η i ) after n steps are therefore correlated random variables, whose statistics is of interest.The kind of non-linearity encoded in the "cost function" h(η) has many other interesting incarnations in Physics.Consider for instance the force needed to move a block in contact with a surface.One has first to overcome a threshold force η c due to static friction.Then, applying a force η for a fixed time interval ∆t, the velocity of the block is given by h where b now depends on the block mass and ∆t [22].Assume now that we repeat this experiment many times, drawing the applied force from, say, an exponential probability density function (pdf), p(η) = exp(−η).What would be the average response of the block?It turns out that the mean force per sample (1/n) i η i over n experiments has the same expression as the final position reached by the taxi in n steps, and the mean velocity of the block per sample precisely corresponds to the average fare for a taxi ride [13].Another context where our results could be applied almost directly, is the pinning-depinning transition occurring when an extended object/manifold such as an elastic string or a polymer is driven by a random force η in a spatially inhomogeneous medium [23][24][25].
In our Letter [13], we considered two different ensembles of trajectories of a NCRW: in Ensemble (i), we fixed the total distance X covered by the walker as well as the number n of steps, and studied the average ⟨C⟩ X,n and variance Var(C|X, n) of the total cost charged.In Ensemble (ii), instead, we allowed the number of steps n to reach the target destination X = L to fluctuate, and we focused on the hitting cost C -i.e. the price to pay to reach the destination for the first time -and its distribution P (C|L) for large L. In the former setting [Ensemble (i)], we found a strongly nonmonotonic behavior of the variance Var(C|X, n) as a function of the scaling variable y = X/(nη c ), with a maximum attained at the value y ⋆ = 1.72724... .This non-monotonic behavior was found to reflect a crossover between different phases: (i) a pure phase for small y = X/(nη c ), where a typical trajectory is mostly made up of small/slow jumps, (ii) a mixed phase for intermediate values of In this paper, we consider the NCRW model defined in the equations ( 1), ( 2) and (3) from a completely different but quite natural perspective, namely by considering global constraints on the total budget available, C, and the total number of jumps n to reach a random destination X. Stochastic processes with a global constraint have been investigated in the past, and shown to lead to interesting effects.In [29,30], the distribution of linear statistics of otherwise i.i.d.
random variables -subject to a global constraint on the total "mass" -was shown to undergo an interesting condensation transition, where one of the variables acquires a macroscopic fraction of the total mass.In the context of the pinning-depinning transition described above [23][24][25], fixing C allows to investigate fluctuations of the total force X at fixed velocity C.Moreover, stochastic processes with global nonlinear constraint arise in the context of the discrete nonlinear Schrödinger equation [31] as well, where unexpected localization transitions are observed.In this case, the global constraint enforces the conservation of energy in the system.More generally, random models with global constraints are very useful in a wide range of applications where budget constraints are present.This applies, for instance, to macroeconomics [32,33], where governments have to allocate resources within a total budget, and supply chain management [34], where storage space, time, and budget constraints play a crucial role.
We study the average and variance of the distance covered in n steps, as well as the statistics of the number of long/short jumps in a typical trajectory of size n, for the exponential jump distribution and assuming that the total budget C for the trajectory is fixed.These quantities display an interesting scaling behavior as a function of the cost per step C/n, which we are able to characterize analytically.Furthermore, we find two different regimes, depending on whether bη c > 1 or bη c < 1.In the former case, when bη c > 1, the behavior of the average distance covered as a function of the number of steps n is strongly non-monotonic, which means that actually more steps are needed to cover a shorter distance with the given budget.In the latter case, when bη c < 1, the curves are instead monotonically decreasing.We give later on a detailed and intuitive explanation for the crossover between the two regimes in terms of the makeup of typical trajectories.
In addition, as a byproduct of our derivations, we determine the asymptotic behavior of ratios of Kummer hypergeometric functions when the first and last argument are both large.Our results are verified by Monte Carlo Markov Chain simulations with a constraint implementing the fixed total budget.
The structure of the paper is as follows.In Section II we consider the statistics of the total distance travelled by the walker in n steps and subject to a budget constraint (total cost equal to C): in subsection II A we first compute the pdf P (C|n) of the total cost of a trajectory of n steps (irrespective of the landing spot).This ingredient is needed to compute the constrained average and variance of the final position after n steps, which are tackled in subsections II B and II C, respectively.In Section III, we consider the scaling laws obeyed by the constrained average and variance of the final position in the limit n, C → ∞ with their ratio fixed.In Section IV, we consider the statistics of long (fast) vs. short (slow) jumps that make up a typical trajectory, still under the budget constraint.In Section V, we provide the details of the Monte Carlo scheme we employed to simulate trajectories under the fixed-budget constraint.Finally, in Section VI we offer some concluding remarks.The Appendices are devoted to technical details.

II. STATISTICS OF DISTANCE TRAVELLED WITH FIXED BUDGET
In this section, we focus on ⟨X k ⟩ C,n , the k-th moment of the position reached by the walker after n steps, conditioned on paying a total fare equal to C. This quantity represents the total distance travelled by the random walker when both the total budget and the number of steps are fixed.
Consider first the joint pdf of the position X reached after n jumps, and the associated cost C, in the case of exponential jump distribution where the nonlinear cost function h(η) is given in Eq. ( 3).Taking the double Laplace transform and performing the decoupled η-integrals, we get with Taking the k-th derivative of (5) with respect to λ and setting λ = 0 we get the Laplace transform (in "cost" space) of the k-th moment of the final position as For convenience, let us also define with g 0 (s) = g(0, s), and g(λ, s) given explicitly in (6).Now, from Bayes' theorem, the k-th moment of the final position X after n steps -conditioned on a fixed budget C -is given by where the denominator is simply the marginal pdf of the cost alone after n steps from (5).The numerator of (9) follows by taking the inverse Laplace transform w.r.t.s of Eq. ( 7), which reads using Bromwich formula with g k (s) defined in (8), and Γ a vertical line in the complex plane to the right of all the singularities of the integrand.So, explicitly with G(λ, s) = [g(λ, s)] n and g(λ, s) given in (6).Let us now specialize (12) to the first two moments k = 1 and k = 2, after computing the marginal distribution of the total cost alone in the next sub-section.
A. Calculation of P (C|n) From (10), we need to compute the inverse Laplace transform (over the variable s) of G(0, s) = [g(0, s)] n = e −ns [1 − e −ηc + e −ηc /(1 + bs)] n .We can rewrite where The function G(0, s) can then be easily Laplace-inverted term by term using with θ(x) the Heaviside step function.Using next the identity in terms of a Kummer hypergeometric function, we eventually get The first delta term is easy to understand: a total cost exactly equal to n can be realized by a sequence of n time-like steps, each of which is charged one unit of cost.A trajectory of n time-like steps occurs with probability (1 − e −ηc ) n .A plot of the continuous part of P (C|n) for C > n is included in Fig. 2. Normalization of P (C|n) over C ∈ [n, +∞) can be easily checked using the integral formula after making the change of variables (C − n)/b = x.
B. Average of the position reached after n steps on a fixed budget (finite n) Having computed the denominator of ( 9), we now turn to the calculation of the numerator for k = 1.For convenience, let us denote by the unconstrained average of the final position of the walker after n steps.The calculation from the Laplace transform in Eq. ( 7) for k = 1 is reported in Appendix B and yields eventually where A is given in Eq. ( 14) and Taking the ratio between T 1 (C) in ( 22) and the pdf in (19) gives the average final position after n steps constrained on a fixed cost C (see Eq. ( 9) for k = 1) where A is given in Eq. ( 14) and and the constants K j can be easily reconstructed.This constrained average is plotted as a function of n in Fig. 3 for C = 250 and three different values of b, the cost per unit distance in the "high speed" regime.Quite counter-intuitively, there are parameter choices for which the behavior of the constrained average is strongly non-monotonic as a function of the number of steps n: this means that the walker may actually perform more jumps to cover a shorter distance (on average).The reason is that -at fixed budget C, and with "too many" jumps to perform -the walker is forced to slow its pace down, and burn money on short (time-like) jumps, otherwise the budget would be all spent on "too few" (but large) excursions.
In Fig. 4 we plot ⟨X⟩ C,n for different values of η c and b = 2.It is easy to understand the initial growth of the red and blue curves as a function of n from the following very simple argument, which also shows that there should be a transition at bη c = 1, with the curve for ⟨X⟩ C,n growing with n if bη c > 1 and decreasing if bη c < 1.
Consider increasing n, for fixed but large budget C. We recall that the cost function is given by where When n = 1, we have only one space-like step, hence, we have n = 2, and imagine both jumps are space-like.Then In general, if we have n space-like steps, then given a Thus, we see that if bη c > 1, X will increase with n initially, as long as the jumps are space-like.
Beyond the maximum (when bη c > 1), time-like steps start to kick in and clearly X then have to decrease.This argument explains the non-monotonicity of ⟨X⟩ C,n for bη c > 1.For bη c < 1, when the slope in Eq. ( 31) becomes negative, the curve decreases monotonically instead, since whether the jumps are space or time-like, X always decreases with increasing n for fixed large C.
C. Variance of the position reached after n steps on a fixed budget (finite n) We now turn to the calculation of the numerator of ( 9) for k = 2.For convenience, let us denote by the unconstrained second moment of the final position of the walker after n steps.The calculation is reported in Appendix (C), with the final (long) expression given in Eqs.(C18) and (C15).
The second moment of X -constrained on a fixed budget C -can then be computed by taking the ratio of T 2 (C) in Eq. (C18) to the pdf P (C|n) in Eq. (19).We obtain where A and T2 ( Ĉ) are respectively given in Eqs. ( 14) and (C15), and we defined Here, we are using the convention where ⟨X⟩ C,n and ⟨X 2 ⟩ C,n are given in Eqs. ( 27) and (33).The variance of X is shown in Fig. this non-monotonic behavior is similar to that described in Ref. [13] and is the result of an entropic effect.When n ≪ C, the cost is concentrated in a few "spacelike" fast steps and hence the variance is low.In the opposite limit n ≈ C, most steps are "timelike" (η < η c ).At intermediate values of n, a mixture of the two type of steps is present, leading to a maximum in the variance.The green curve is for bη c < 1 and is therefore monotonically decreasing, as explained in the main text.

III. SCALING LAWS
In this section, we show (analytically and numerically) that the finite n, C results in the previous sections admit nice scaling laws for large n and large C, keeping their ratio n/C fixed.There are two ways to perform this asymptotics: in the next subsection, we work directly in Laplace space, and perform a saddle-point analysis of the ratio of Bromwich integrals in (12) for k = 1.Otherwise, in Appendix D, we directly compute the asymptotics of Eq. ( 27), which in turn involves computing the asymptotics of the ratio of Kummer functions in (28) when two of the arguments are large.
This asymptotic calculation is a nice byproduct of our work.
A. Average of the position reached after n steps on a fixed budget (scaling formula for large n) We start from Eq. ( 12) where G(λ, s) = [g(λ, s)] n , with g(λ, s) given in (6).For k = 1, we therefore need to compute and setting λ = 0 with g k (s) defined in (8).Hence from (12) we have for k = 1 Both the denominator and the numerator can be evaluated by the saddle-point method for large n.Consider first the denominator and rewrite as Setting C/n = z (fixed for large n), the action in the exponent reads The stationary point of the action is determined by whose solution implicitly provides the critical value s = s ⋆ (z).
Consequently, from (40 1 The symbol ≈ denotes asymptotic equality on logarithmic scales. Looking back at (39), since g 1 (s)/g 0 (s) is independent of n, to leading order for large n the numerator will be dominated by the behavior in the vicinity of the very same saddle point as the denominator, namely s ⋆ (z).Therefore, the leading exponential terms will cancel out, and what remains is for large n.
Now, defining r(s) = 1 + bs, we have that g 0 (s) is given by ( 6) as while For the saddle point condition (42) we get which gives the following quadratic equation for r ⋆ = r(s ⋆ ) Its positive root 2 r ⋆ reads Summarizing, from (45), it follows that the average position reached after n steps and constrained on a fixed total budget C has the following scaling form for large n (and noting that where the scaling function 2 Since s > 0, r > 0 as well. with and 0 ≤ y ≤ 1 (as the budget for a ride of n steps can never be smaller than n).We recall that A is defined in Eq. ( 14).The asymptotic behaviors are as follows The 4b(e ηc − 1) .
The value y ⋆ is plotted as a function of η c for b = 3 in Fig. 5, while in Fig. 6 we plot two instances of the scaling curve f (y) (for bη c > 1 and bη c < 1), compared with the finite n, C behavior from Eq. ( 27).We clearly observe once again a different behavior of the curves if bη c > 1 or bη c < 1, as argued at the end of Section II B. This is reflected in the fact that for bη c < 1, the maximum y ⋆ of the curve is reached at the lower edge y = 0.In the inset of Fig. (6) we compare our theoretical result in Eq. (51) with numerical simulations, finding excellent agreement.
B. Variance of the position reached after n steps on a fixed budget Similarly, we could compute the second moment (and thus the variance) of the position reached after n steps on a fixed budget C by setting k = 2 in (12).First, taking a further derivative w.r.t.
λ of (37), we get Setting λ = 0, and using (8), we get Hence from ( 12) While we could again use a saddle-point evaluation of both numerator and denominator for large n, it turns out that it would not be enough to confine the analysis to the leading ∼ n 2 term to extract the leading term of the constrained variance.Extracting the sub-leading term ∼ n requires a careful and very laborious calculation, which would not be rewarded by a particularly illuminating final result.For these reasons, we decided to show the scaling behavior of the constrained variance only numerically in Fig. 7.

IV. STATISTICS OF THE NUMBER OF SHORT/LONG JUMPS
In this section, we consider the statistics of the random variable where θ(x) is the Heaviside step function.The random variable n t counts the number of time-like jumps in a trajectory of length n.The joint pdf of n t , the final position X and the total cost The red crosses correspond to the results of numerical simulations (see Sec. V for the details), while the continuous blue line corresponds to the scaling form in Eq. ( 52).
(budget) C for a trajectory of length n and exponential jump distribution is given by Taking the triple Laplace transform where As for the final position, the k-th moment of n t after n steps, conditioned on the total budget C, is given by where the denominator is simply P (C|n), the marginal pdf of the total cost alone after n jumps, which we computed in Eq. (19).
For the numerator, it is again convenient to take the Laplace transform w.r.t. the total cost, and observe from Eq. (61) that dC e −sC dn t dXn k t P (n t , X, C|n) Limiting ourselves to the first moment (k = 1), we obtain for the Laplace transform of the numerator dC e −sC dn t dXn t P (n t , X, C|n) Using now where A is defined in Eq. ( 14), and expanding using the binomial theorem, we get dC e −sC dn t dXn t P (n t , X, C|n) Using the inverse Laplace transform in Eq. (B12), we get for the numerator dn t dXn t P (n t , X, C|n) = n where we used the identity Eq. (B14) in the last step.Putting everything together, we get The delta contribution is easy to understand: if the total budget C is exactly equal to n, then a trajectory made up of n time-like meets all the constraints.Interestingly, the continuous part (C > n) admits a scaling form for n, C → ∞ such that y = n/C is fixed, namely The monotonically increasing nature of the curve here does not depend on whether bη c > 1 or bη c < 1.
for 0 < y < 1 simply follows from the asymptotics in Eq. (D1) for k = m = 2.We recall that the costant A is defined in Eq. ( 14). from L(y = 0) = 0 to L(y = 1) = 1.This observation agrees with the intuition that increasing the total number of steps at fixed cost leads to more "timelike" steps.

V. NUMERICAL SIMULATIONS
In this section, we describe the constrained Monte Carlo Markov Chain (MCMC) algorithm used to investigate the statistics of the total displacement X with fixed number of steps n and fixed total cost C.We adapt the technique used in Refs.[35][36][37][38] to our problem.For a given initial There are several possible extensions of this work.First of all, it would be interesting to generalize our model to consider other nonlinear cost functions and distributions of the steps of the random walk.For instance, it would be relevant to extend our framework to Lévy walks, where condensation transitions where a single step dominates the whole trajectory can be observed [39].
Furthermore, while our current paper exclusively addresses random walks characterized by positive steps, it would be worth to explore scenarios where both positive and negative step increments are permitted.This would allow to investigate the statistics of extremes and records [40].

FIG. 1 .
FIG. 1.Typical realization of the system with nonlinearity h(η) = 1 + b(η − η c )θ(η − η c ) with b = 2 and η c = 0.7.The cost C k up to step k is a nonlinear function of the position X k of the random walk.Slow (fast) steps with η < η c (η > η c ) are highlited with a green (red) background.

y
= X/(nη c ), characterized by a large "entropy", i.e. a large number of possible arrangements of the slow and fast jumps to reach the destination X, which leads to the strongest fluctuations in the price of the ride, and (iii) again a pure phase for large y = X/(nη c ), where a typical trajectory is mostly made up of large/fast jumps, and cost fluctuations from one trajectory and another are suppressed.In Ensemble (ii), where the number of jumps to reach the destination is allowed to fluctuate, we found that the typical fluctuations of hitting cost C are Gaussian but with left and right large deviation tails that can be characterized analytically.The variance of the hitting cost in the typical regime displays a very rich behavior as a function of b -the cost per unit distanceand η c -the critical changeover speed, with a freezing transition in the large deviation regime for bη c = 1.The resulting giant fluctuations of the hitting cost are once again related to the "entropic" makeup of typical trajectories, in terms of the arrangement of short/slow and long/fast jumps to reach the target, and the associated total cost C.

FIG. 2 .
FIG.2.Probability density function P (C|n) of the total cost after n steps for C > n.The blue line corresponds to the theoretical result in Eq. (19) with n = 30, b = 1, and η c = 2.2.The red crosses are obtained from numerical simulations.

FIG. 3 .
FIG. 3. Average distance ⟨X⟩ C,n covered as a function of the number of jumps n for a fixed total budget C = 250.The critical changeover speed is set at η c = 2.The blue squares are for b = 4, the red triangles are for b = 1, and the green stars are for b = 1/3.We observe that the first two curves are non-monotonic as a function of n, whereas the green curve is monotonically decreasing as bη c < 1.In the region where ⟨X⟩ C,n is decreasing with n, more steps lead to a shorter total distance covered.This effect is a consequence of the non-linearity of the cost function, as explained in the text.

( 7 )
as a function of n/C for b = 1, η c = 2.1 and different values of C. Our analytical result is in good agreement with numerical simulations (see the inset in Fig. (7)).The variance reaches a maximum value at some intermediate value of y = n/C and then decreases for increasing n/C.The origin of

FIG. 4 .
FIG.4.Average distance ⟨X⟩ C,n covered as a function of the number of jumps n for a fixed total budget C = 250.The cost per unit distance in the "high speed" regime is set at b = 2.The blue squares are for η c = 10, the red triangles are for η c = 1, the green stars are for η c = 1/4.The curve with η c = 1 displays the non-monotonic effect described in Fig.3.In the case η c = 10, the probability of a "high speed" step (η > η c ) is extremely low and hence most steps have a unit cost, leading to the observed linear behavior.

FIG. 5 .
FIG. 5. Behavior of y ⋆ = argmaxf (y) in Eq. (55) as a function of η c for b = 3.For η c < 1/b, the maximum is reached at the lower edge y = 0.

FIG. 6 .
FIG. 6. Scaling behavior of the average final position C,n after n steps conditioned on the total cost of the ride.On the vertical axis, we have the quantity ⟨X⟩ C,n /C from Eq. (27).On the horizontal axis, we put y = n/C.We use b = 1, η c = 2, and C = 250 (red triangles) or C = 100 (blue squares).We use instead b = 1, η c = 1/2, and C = 250 (green stars) or C = 100 (magenta circles).We can see that the finite n, C curves nicely collapse onto the scaling function f (y) given in Eq. (52).The scaling curves show a non-monotonic behavior for bη c > 1, and a monotonic (decreasing) behavior for bη c < 1, as explained in the main text.Inset: Average displacement ⟨X⟩ C,n /C as a function of n/C for η c = 2, b = 1, and C = 100.

FIG. 7 .
FIG. 7. Scaling behavior of the variance of the final position Var(X) C,n after n steps conditioned on the total cost of the ride.On the vertical axis, we have the quantity Var(X) C,n /C from Eq. (35).On the horizontal axis, we put y = n/C.We use b = 1, η c = 2.1, and C = 250 (red triangles, joined with a solid line) or C = 100 (blue squares).We can see that the finite n, C curves nicely collapse onto a scaling function, which would be too cumbersome to determine explicitly.Inset: Scaled variance Var(X) C,n /C as a function of n/C.The red crosses are the result of numerical simulations with C = 30, η c = 2, and b = 1.The blue line corresponds to the exact result in Eq. (35).

8 <CFIG. 8 .
FIG. 8. Scaling behavior of the number of time-like steps ⟨n t ⟩ C,n after n steps conditioned on the total cost of the ride.On the vertical axis, we have the quantity ⟨n t ⟩ C,n /C from Eq. (69).On the horizontal axis, we put y = n/C.We use b = 1, η c = 2, and C = 250 (red triangles) or C = 100 (blue squares).We can see that the finite n, C curves nicely collapse onto the scaling function L(y) (solid black line) from Eq. (72).
The scaling function L(y) has asymptotic behaviors ηc − 1)y 2 for y → 0 + ,1 − A(1−y) b for y → 1 − .(73)A plot of the scaling function is provided in Fig.8.The number of time-like steps increases monotonously with n at fixed C. Indeed, for all values of b and η c , the scaling function L(y) grows