Optimal gut size of small birds and its dependence on environmental and physiological parameters.

Most optimal foraging models assume that the foraging behaviour of small birds depends on a single state variable, their energy reserves in the form of stored fat. Here, we include a second state variable— the contents of the bird’s gut—to investigate how a bird should optimise its gut size to minimise its long-term mortality, depending on the availability of food, the size of meal and the bird’s digestive constraints. Our results show that (1) the current level of fat is never less important than gut contents in determining the bird’s survival; (2) there exists a unique optimal gut size, which is determined by a trade-off between the energetic gains and costs of maintaining a large digestive system; (3) the optimal gut size increases as the bird’s digestive cycle becomes slower, allowing the bird to store undigested food; (4) the critical environmental factor for determining the optimal gut size is the mass of food found in a successful foraging effort (“meal size”). We ﬁnd that when the environment is harsh, it is optimal for the bird to maintain a gut that is larger than the size of a meal. However, the optimal size of the gut in rich environments exactly matches the meal size (i.e. the mass of food that the optimal gut can carry is exactly the mass


Introduction
The fat levels of small birds in winter have been the subject of both theoretical and empirical investigation. The theoretical work is based on the idea that fat has costs and benefits ( Lima, 1986 ;Witter and Cuthill, 1993 ). The benefit is a reduction in the rate of starvation and the cost is an increase in the rate of death as a result of being killed by predators. The rate of mortality from predation is liable to increase with increasing fat reserves for two reasons; fat individuals may be less manoeuvrable and hence less liable to survive a predator attack, and fat individuals expend more energy while active which means they must forage more and hence expose themselves to predators for longer Hedenström, 1992;Gosler et al., 1995 ).
A bird has to survive the winter in order to reproduce. This means that sufficiently far back from the end of winter, the actions that maximise lifetime reproductive success coincide with the actions that minimise mortality rate. This occurs because the stochasticity in reserve levels for a small bird produce a "mixing" effect over time ( McNamara, 1990;Houston and McNamara, 1999 ). Thus for the "small bird in winter" (e.g. Houston et al., 1988;Houston and McNamara, 1993 ) or "little bird in winter" (e.g. Brodin, 2007 ) paradigm one need not explicitly consider reproduction although it is implicit.
Several models that analyse optimal fat levels within this paradigm characterize the bird in terms of a single state variable, the amount of energy stored as fat reserves ( Lima, 1986 ;Houston and McNamara, 1993;Houston et al., 1997;Clark and Mangel, 20 0 0 ;see Brodin, 2007 , for a review). For these models, a strategy specifies how the foraging behaviour depends on fat reserves; i.e. on state. The optimal strategy is found by dynamic programming. Following this strategy over time ("forward iteration"; e.g. Clark and Mangel,20 0 0 ) then gives the expected behaviour and mean level of reserves of a population following the strategy.
Some models have in addition to energy reserves considered the amount of food hoarded Hitchcock and Houston, 1994;Brodin and Clark, 1997;Pravosudov and Lucas, 2001a, b ). Body temperature is also considered as an additional state variable ( Brodin et al., 2017;McNamara et al., 2004 ). One limitation of these models is that they ignore the fact that a bird's ingestion might be limited by the contents of its digestive system ("gut"). There is a growing awareness that foraging strategies are determined not only by the metabolizable energy content of the food but also by the digestive constraints of the foragers ( Karasov et al., 1986;Carpenter et al., 1991;Prop and Vulnik, 1992;Jeschke et al., 2002;Van Gils et al. , 2005;Heath et al., 2010;Quaintenne et al., 2010;Santini et al., 2014 ). To investigate this constraint, Bednekoff and Houston (1994) include a second state variable, the amount of food in a bird's gut and assume that the bird cannot eat when its gut is full and there is a limit to the rate at which food in the gut can be converted into fat stores. Bednekoff and Houston (1994) consider a day-night cycle in their model and focus on the daily routine of foraging. In this paper, we ignore the day-night cycle and focus on the optimal size of the gut and its dependence on environmental parameters and the physiological parameters that describe the rate of food processing by the gut and the costs of having a larger gut.
Introducing the contents of the digestive system as a second state variable raises several questions. Firstly, how should the bird's foraging behaviour depend on the two state variables, fat reserves and contents of the gut? Secondly, what are the relative contributions of food in the gut versus fat levels to the bird's expected lifetime reproductive success ( McNamara and Houston, 1986 ;Houston and McNamara, 1999 )? Finally, we ask what size of gut will maximise the bird's chances of surviving the winter and how this optimal gut size depends on environmental and physiological parameters. Many animals change their physiology or morphology on a regular basis ( Piersma and Drent, 2003;Piersma and Van Gils, 2010 ). The morphology of the digestive system of the red knot ( Calidris canutus ) depends on its diet ( Dekinga et al., 2001 ) and the gut size of the white-throated sparrow ( Zonotrichia albicollis ) depends on the energy demands imposed by temperature regulation ( McWilliams and Karasov, 2014 ). Here, we consider another environmental factor: the size and variability of food available to the bird. The advantage of having a large gut is that the bird is usually able to process gluts of food. One disadvantage is that the gut increases the mass of the bird and hence the rate of energy expenditure while active. A second disadvantage is that maintaining a large gut is energetically costly. We consider a range of gut sizes. For each gut size, we assume that the bird adopts the appropriate optimal strategy. From this strategy, we can find the resulting rate of mortality. The optimal gut size is the one at which this rate is minimised.

Model description
We consider a stochastic dynamic programming model of the foraging behaviour of small birds during winter (e.g. Houston et al., 1988;Houston and McNamara, 1999;Clark and Mangel, 20 0 0 ). A formal description with the mathematical details can be found in the Appendix.

States
At each time t , the bird can be described by two biological states; the mass of fat carried by the bird X ( t ), and the mass of food in the gut Y ( t ). Fat reserves provide the energy needed for activities. The bird starves if at any time its level of fat reserves drops to 0. Food in the gut is constrained to lie in the range 0 ≤ Y ( t ) ≤ Y max where Y max is the capacity of the bird's gut.

Time scale and decisions
We consider decision epochs to be discrete and assume that a bird has two options at a given decision epoch t , either to forage or to rest in the time period between t and t + 1 (cf. Houston and McNamara, 1993 ).

Food supply
We model the environment as stochastic; a foraging bird finds no food in any given period with a probability 1 − μ and finds food with probability μ. The mass of food found in a successful foraging effort is e , which we refer to as the meal size. A meal could be a single item of food or a small patch of items. This amount is constant in the baseline model. Thus, the mean gain in food at any interval spent foraging is E = μe . A bird that rests finds no food.

Mass
The mass of the bird is an important variable in our model because the metabolism of the organism and the risk of predation depend on it. We consider that the mass at any given time t depends on the level of fat stored, the amount of food in the gut and the fixed mass of the body m 0 + k Y max . Notice that the mass of the body contains a term that depends on the gut capacity via the constant k . This coefficient determines the rate at which the mass of the gut (together with any associated digestive machinery) increases with gut capacity. Under these assumptions, the total mass

Energetic cost
The rate of energy expenditure while resting is fixed but the foraging metabolism is mass dependent, increasing linearly with mass. In other words, the heavier the bird is, the more energy it consumes. Adding to this, there is an energetic cost related to maintaining the digestive system of the bird which increases linearly with increasing gut size by a constant J (see the appendix for more details).

Predation risk
A bird that forages between times t and t + 1 is killed by a predator during this period with a probability P pred f (t) . We assume that P pred f (t) depends on mass in a quadratic manner (cf. Houston and McNamara, 1993 ). In contrast, there is no predation risk while resting.

Digestion
For most of our computations, we constrain the rate of digestion so that in a unit time only a limited mass of food currently in the gut g 0 can be transformed into fat. We refer to this parameter as the rate of digestion (we consider the case of unconstrained digestion for comparative purposes when we study the effect of g 0 on the bird's survival). In transforming food in the gut into fat, one gram of food yields γ 0 grams of fat.

Optimality criterion
A strategy specifies whether to rest or forage for every combination of fat level and level of food in the gut. The behaviour of a small bird following a given strategy can be described as follows: In each time period, given its current state (level of fat and gut contents), the bird will either forage or rest, as specified by the strategy. Depending on the chosen action, a certain amount of energy reserves will be consumed as a result of the energetic costs of the bird's activities and the functioning of its digestive system. A bird survives until the next decision epoch if its fat reserves do not drop to 0 or below by this time (starvation) and it is not killed by a predator (predation). If the bird were to forage and find food, the amount of food that is found would be added to its gut contents. In a time period, food present in the gut at the beginning of Table 1 List of model parameters. All masses and energy expenditures are given in grams. The lean body mass (not including the gut) of our hypothetical bird is around 10 g.

Parameter
Referential Value Description the period is reduced by the amount that can be transferred to fat in unit time.
The optimal strategy minimises the long-term rate of mortality ( McNamara, 1990;Houston and McNamara, 1993 ). Table 1 gives the baseline combination of parameters. In choosing these baseline parameters we are motivated by the problem faced by a small bird such as a goldcrest ( Regulus regulus ) or blue tit ( Parus caeruleus ) in winter. We assume the bird has 175 decision epochs per day. Thus, in the baseline case a bird with fat reserves of 3 g can survive for around 1.5 days without food ( Table 1 ). In presenting results, we look at the probability that the bird survives a winter of 200 days under the optimal strategy. This quantity allows us to study the effect of gut size on the chances of surviving the winter under different conditions. For example, we will analyse how winter survival changes with different food supply conditions, digestive constraints and energetic costs.

Optimal behaviour and its dependence on state
We first studied how birds' optimal foraging strategy and lifetime reproductive success depend on their current state, using the baseline parameters ( Table 1 ). Our main objective was to compare the importance of fat level against that of food in the gut in birds' foraging decisions and survival. Fig. 1 A shows the optimal strategy for baseline parameter values. This strategy specifies the best action for each combination of food in the gut ( y ) and level of fat ( x ). In the baseline case the gut capacity is equal to meal size. Thus a bird that forages when its gut is not empty will be unable to consume a whole meal if food is found, and the more food that is currently in the gut, the more will be wasted. When reserves are very low the urgent need to get food means that a bird with a half-full gut should still forage. However, because foraging incurs a predation risk, a bird with slightly higher reserves should only forage if there is very little food in the gut. Finally, if reserves are sufficiently high, predation risk means that the bird should not forage even if its gut is empty. Fig. 1 also shows the effect of changing the probability that a meal is found. As this probability goes down, the bird should attempt to increase its fat reserves in order to insure against a run of bad luck in finding food. This is in line with previous findings on optimal fat in models which do not include gut size (e.g. Houston and McNamara, 1993; Clark and Mangel, 20 0 0; Brodin, 2007 ).

Reproductive value (RV)
How valuable are fat reserves and food in the gut? The contribution of fat and food in the gut to a bird's expected future lifetime reproductive success can be determined by computing the reproductive value (RV), a relative measure of how the probability of surviving an extended period depends on the state at the start of the period McNamara, 1993, 1999 ).
To assess how valuable is a unit of fat, we computed the rate of increase of the reproductive value R ( x, y ) with fat level x (i.e.
The reproductive value of a unit of fat is not constant, but changes with the energetic reserves x . There is a sharp rise in RV with the first 0.05 g of fat added to the body, after which the increase becomes quickly slower to eventually fade away by x = 0 . 5 g, and this regardless of the quantity of food present in the gut. However, the quantity of food in the gut does influence how quickly the RV approaches saturation with increase in energetic reserves.
We also compared the value of fat reserves with the value of gut contents by computing the ratio of the rate of increase of the RV with gut contents y to the rate of increase with fat level x (i.e. r = ( ∂R ( x, y ) /∂y ) / ( ∂R ( x, y ) /∂x ) ; Fig. 2 B). r is approximately equal to 0.5 provided there is not much food in the gut or the energy reserves are sufficiently high (higher than x = 2 g). This is to be expected as a gram of food in the gut is converted to 0.5 g of fat. However, when there is substantial food in the gut and energy reserves are not high, r is substantially less than 0.5. This is because a bird with substantial food in the gut does not have room to eat a whole meal if one is found. Another reason for why energy in the gut (which will be gained from the current gut contents) is less valuable than energy stored as fat is that transforming food into fat takes time and increase predation risk by increasing the mass of the bird. This constraint, however, becomes less crucial when reserves are sufficiently high.
Finally, we tested whether the advantage of fat reserves over gut contents would increase or decrease if the rate at which gut contents are transformed into fat change. When the digestion is instantaneous ( Fig. 2 C), a unit energy in the gut becomes equally valuable than fat energy for most combinations of fat reserves and food contents (except when the bird has less than 0.1 g of fat reserves). When the digestion is slow ( Fig. 2 D), more energy reserves are needed for a unit energy in the gut to be as valuable as fat energy. To sum up, when energy reserves are low and gut contents substantial, food in the gut contributes to the bird's lifetime reproductive success less than fat reserves. On the other hand, when energy reserves are high, or the gut contents are low or if the bird can rapidly transform food into fat, the difference between the contribution of food in the gut and fat reserves diminishes. Comparison of long-term policies for different probabilities of finding food. A. Long-term policy for each level of energy and amount of food in the gut for the baseline probability of finding food ( μ = 0 . 13 ). The dark-grey area is where foraging is optimal, and the light-grey one shows where the bird should rest. B. Long-term policy when μ = 0 . 11 . C. Long-term policy when μ = 0 . 09 . D. Long-term policy when μ = 0 . 07 .

Distribution of states
We used forward iteration to find the probability distribution of possible states (fat reserves and gut contents) of a bird if it follows the optimal strategy shown in Fig. 1 . When members of a group of birds follow the optimal strategy for a sufficiently long period, the resulting distribution of states of those birds that are still alive converges. This quasi-equilibrium distribution depends neither on the starting distribution of states, nor on time (see Houston and McNamara, 1999 ;Mangel and Clark, 1988 ). Fig. 3 shows the proportion of birds that are in different states at convergence. There is a slightly inclined ridge extending from around ( x = 2 g, y = 0 g) to around ( x = 1 . 75 g, y = 1 g), which shows that birds reduce slightly their fat reserves as the amount of food in their gut increases. A large proportion of birds (around 47%) have an empty gut and fat reserves between 2 g and 2.25 g. The majority of birds in the group have a level of fat close to 2 g which is the minimal value of x for which it is optimal to rest even with an empty gut (compare with Fig. 1 ). The average level of fat in the group is x ≈ 1 . 96 g and the average amount of food in the gut is y ≈ 0 . 28 g. Furthermore, it is clear that only a very small pro-portion die from starvation at each period (0.23% dying from starvation versus 7.89% being killed by a predator during the whole winter).

Effect of gut capacity on survival
Having a larger gut capacity Y max would be advantageous since the bird can ingest more food, which would decrease the probability of dying by starvation. On the other hand, this increase in gut capacity would come at an energetic (maintenance) cost as well as a larger chance of predation due to increase in overall mass. Thus, there should be an optimal gut capacity that maximises the chances of winter survival. We now show how this optimal gut capacity depends on digestive constraints and the food supply.
In Fig. 4 , we show how winter survival depends on gut capacity Y max for two different digestive constraints. Consider Fig. 4 A first, which shows the winter survival probability for various values of the gut size dependent energetic cost ( J ). There are a number of interesting results. First, note that for all of these curves, there is a unique gut capacity ( Y max = 1 g) which maximises the winter survival probability. The increase in survival as the gut becomes larger Fig. 2. A. Partial derivative of the reproductive value w.r.t fat level ( x ) as a function of x and gut contents ( y ). B. Ratio of the partial derivative of the reproductive value w.r.t y to the partial derivative of the reproductive value w.r.t x as a function of x and y , for the baseline digestion rate ( g 0 = 0 . 05 ). C. Ratio of the partial derivatives of the reproductive value for an instantaneous digestion ( g 0 = 1 ). D. Ratio of the partial derivatives of the reproductive value for a slow digestion rate ( g 0 = 0 . 035 ).
is to be expected because the bird can carry more food that can be transformed later into energy reserves. The subsequent decrease is due to the costs associated with the size of the gut in our model. Next, note that the survival probability decreases with increase in the energetic cost of the gut and the shape of the curve interacts with the value of the energetic cost. When J is large, there is a sharp drop in survival probability after the limiting value Y opt max . In contrast, when J = 0 we observed almost no change in the survival likelihood after Y opt max . This confirms that the decrease in survival probability after Y opt max is due to the energetic costs associated with the gut. Finally, the most striking finding is that the optimal gut capacity Y opt max is equal to the meal size e ( = 1 g in our computations). We will discuss below the reasons behind this finding. Fig. 4 B shows how the rate of digestion g 0 affects winter survival and the value of the optimal gut capacity. The higher the rate of digestion, the higher are the chances of surviving the winter. However, the gain in survival from increasing g 0 quickly becomes insignificant (compare g 0 = 0 . 05 g with instantaneous digestion). Secondly, note that the optimal gut capacity Y opt max for reasonably large rates of digestion remains equal to the size of meal e . However, for slow digestion ( g 0 = 0 . 035 g), the optimal gut capacity Y opt max becomes larger than e . When the digestion cycle is slow, it is advantageous for the bird to have more space in its gut than the size of a meal.
Next, consider how changes in the food supply affect the optimal gut capacity. Fig. 5 A shows how winter survival probability changes with change in the meal size e while keeping the mean gain in food constant ( E = 0 . 13 g). Survival probability decreases with increase in meal size. This is because as we increase e , we also decrease μ in order to keep E constant. Consequently, the food supply is more variable and the survival likelihood decreases. But in each case, the optimal gut capacity was found to be equal to e ( Y opt max = e ). We tested the robustness of this finding ( Y opt max = e ) by varying the mean gain in two different ways: by changing the size of a meal e while keeping the probability of finding food constant ( Fig. 5 B), and by changing the probability of finding food ( μ) while keeping meal size constant ( Fig. 5 C). We found that for large values of e or μ, corresponding to high expected values of food ( E = 0.12 g, 0.13 g and 0.15 g), the optimal size of the gut was exactly the size of a meal ( Y opt max = e ). On the other hand, for small meal sizes ( e = 0 . 6 g or e = 0 . 7 g with respective mean gains 0.08 g and 0.09 g), the optimal gut capacity was larger than the size of a meal ( Y opt max > e ). Similarly, when the probability of finding food was  low ( μ = 0 . 09 or μ = 0 . 11 which correspond to the mean gains 0.09 g and 0.11 g respectively), the optimal gut capacity was again larger than meal size.
These results suggest that it is the expected mass of food ( E ) in the environment that is the critical factor that determines if optimal gut capacity is equal to the meal size. Further computations (shown in Fig. 5 D) confirmed this observation for a variety of meal sizes: when the mean gain in food was high ( E = 0 . 13 g), Y opt max was equal to meal size. In contrast, if the foraging conditions were harsh (low mean gain with low probability of finding food), the model predicts that an optimal bird should have a gut capacity that is larger than the meal size. Further computations showed that this pattern remained valid unless the probability of finding food ( μ) was made absurdly low. Fig. 5 D also shows that, in general, the optimal gut capacity increases as the value of food ( e ) increases or as the probability of finding food ( μ) decreases (on the x -axis, as e increases, μ decreases, so if we were to plot the curves giving the optimal gut size as a function of μ, they would be decreasing).

Why is it optimal for gut capacity to match meal size?
One strong finding that stands out from our analysis is that for many combinations of parameters, the capacity of the gut that maximises winter survival corresponds exactly to the size of a meal e .
To understand the reasons behind this pattern, we compared the foraging strategy of birds having a gut capacity equal to the meal size ( Y max = e = 1 g) with those whose gut capacity is larger than meal size ( Y max = 1 . 55 g > e ) in a rich environment ( E = 0 . 13 g) and a harsh environment ( E = 0 . 09 g; see Table 2 ). Our aim here is to explain why we found that, in the rich environment, Y opt max = e whereas in the harsh environment, Y opt max > e .
A key insight comes from looking at how the optimal birds manage the empty space in their gut. In a rich environment, for either gut capacity (1 g or 1.55 g ), less than 4% of birds choose to forage when they have food in their guts, whereas more than 40% choose to forage if they have an empty gut ( Table 2 ). This indicates that most birds wait until their guts are completely empty before foraging. For these birds, there is little advantage of having a bigger gut size than the size of a meal in terms of reducing the risk of starvation because the bird will rarely use the additional space in its gut. Thus, there is barely a noticeable change in probability of starving over winter (from 0.232% to 0.227%) when one increases the gut capacity from Y max = 1 g to Y max = 1 . 55 g. On the other hand, the chances of being killed by a predator are smaller with the smaller gut (7.89%) than with the larger gut (8.13%) due to the reduced mass of the bird (the average mass of the bird is 12.44 g with the smaller gut whereas it is 12.51 g with the larger gut). This difference in risk of predation between the two gut sizes makes the smaller gut more advantageous. Table 2 Average total mass of a bird, average level of fat, probability of foraging given that the gut is empty or not, probability of dying over winter, probability of starving and probability of being killed by a predator in different environments and for different gut capacities. ( * ) indicates that the marked gut capacity is the optimal capacity under the corresponding environmental condition.
Rich environment ( E = 0 . 13 ) Harsh environment ( E = 0 . 09 ) In contrast, in the harsh environment, birds need to forage more to build more fat reserves, especially with the smaller gut (3.26 g on average as opposed to 2.85 g for Y max = 1 . 55 g). The substantial increase in the bird's fat mass for the smaller gut in comparison with the larger gut makes the overall mass of the bird higher for the smaller gut, hence increasing its related risk of predation more than with the larger gut (14.91% for Y max = 1 g versus 14.46% for Y max = 1 . 55 g). Thus, having a gut capacity that is larger than the size of a meal ( Y max = 1 . 55 g) is more advantageous not only because it decreases starvation (0.74% for Y max = 1 . 55 g versus 0.99% for Y max = 1 g), but also because it reduces predation.

Discussion and conclusion
Models that incorporate gut contents as well as energy reserves include those of Burrows and Hughes (1991) , Burrows et al. (20 0 0), Santini et al. (2014) and Bednekoff and Houston (1994) . The models in the first three of these papers are used to analyse the foraging of marine gastropods in environments that fluctuate in terms of their suitability for foraging (often determined by the tidal cycle). In the model of Bednekoff and Houston, the forager is subject to interruptions because of the day-night cycle (no foraging is possible at night). Burrows and Hughes give the optimal strategy but not the resulting expected behaviour, while Bednekoff and Houston, Burrows et al. and Santini et al. give expected behaviour but not the optimal strategy. None of them investigates optimal gut size. Some of the previous work on optimal gut size is concerned with fermentation (e.g. Alexander, 1991 ), a process that is not relevant in our case. The models of Carpenter et al. (1991) andvan Gils et al. (2003) find the gut size that maximises rate of energetic gain. They do not include stochastic foraging or predation risk.
In our model, we assume a simple form of digestive dynamics in which no more than a mass of food g 0 in the gut can be transformed into fat in unit time. Thus, provided that the mass of food in the gut is greater than g 0 , the rate of digestion is constant. Other assumptions about the rate of digestion are reviewed by Bednekoff and Houston (1994) . An alternative approach is to optimize the digestive process, for example, by assuming that the animal can increase the gain from food at the cost of an increase in the time that food spends in the gut ( Sibly, 1981 ).
We found that a bird's survival and optimal foraging decisions are mainly determined by its current level of fat. Birds should work primarily on constructing sufficiently high reserves of fat and maintain them (birds can do this by foraging whenever fat reserves drop below the decision threshold specified by the optimal strategy). These reserves serve as provisions against runs of unsuccessful foraging attempts. We also found that the current amount of food in the gut can inhibit foraging, especially when fat reserves are sufficiently high. Although food in the gut is ready for transformation into fat, carrying food in the gut increases the bird's mass, and hence, its rate of energetic expenditure and predation more than an equivalent amount of energy carried as fat. Thus, in general, it is preferable to carry fat than undigested food which needs time to be transformed into energy. In fact, our computations showed that at any given time, half of the small birds are expected to have an empty gut, especially when foraging (97%).
An important factor that determines the bird's survival is the uncertainty in obtaining food. When uncertainty is high (i.e. μ is low), the bird is required to forage for more combinations of level of fat and gut contents than in a certain environment (see Fig. 1 ). Consequently, at any given period, more birds are expected to forage (about 31% of the birds that follow the optimal policy are expected to forage when μ = 0 . 09 , whereas this percentage is around 20% when μ = 0 . 13 ), and hence more birds are killed by predators (14.9% when μ = 0 . 09 versus 7.9% when μ = 0 . 13 ). The optimal bird should respond to the uncertainty in the environment by having more fat reserves to guard against runs of unsuccessful foraging attempts. Similarly, in uncertain environments, food in the gut becomes more important. This is because the fat extracted from this food could save the bird's life if its energy reserves were to become low as a consequence of not finding food for an extended period. A bird with a large gut can ingest large quantities of food, which help it avoid starvation. This benefit of a larger gut is offset by the energetic cost required to maintain the gut itself. Moreover, a large gut increases the bird's mass and hence increases the risk of predation. Our calculations find the optimal gut capacity that takes into account these costs and benefits and maximises the chances of winter survival.
The optimal gut size is affected by food size and food availability, and to a lesser extent by food digestibility. Generally, when the environment provides large amounts of food (i.e. when e is large) or when food is hard to find (i.e. when μ is low), birds should respond by increasing their gut size. Similarly, when the food is hard to digest (i.e. when g 0 is low), we found that it might be more advantageous for birds to increase their gut size. This last result is consistent with Dekinga et al. (2001) study, which showed that red knots ( Calidris canutus ) increased the mass of their gizzard by as much as 147% when they were fed with hard food in comparison with when they were fed with soft food. We emphasise that our results do not apply to such cases in which gut size changes repeatedly during an animal's life. In our model, we do not allow gut size to change during the winter. Instead we optimise over a fixed gut size. By comparing survival under each fixed gut size, we find the optimal (fixed) gut size. To find how gut size should change over the winter requires not only specifying the costs and time required to change the gut, it also requires a specification of how the environment changes over winter. We believe that these complications would obscure the main point of the paper and that understanding the case of a fixed gut is a prerequisite to understanding the case of a variable gut.
Perhaps the most surprising finding in this paper is that in sufficiently rich environments (i.e. with high expected value of food found in a time period), the capacity of the optimal gut is equal to the size of a meal (i.e. the mass of food that the optimal gut can carry is exactly the mass of food that is found in each successful foraging attempt). In contrast if the environment is harsh, it may be optimal to have a gut capacity larger than e . The reason behind this pattern is that in rich environments, most birds that follow the optimal strategy wait until their guts are emptied before foraging. These birds do not need an extra space in their gut beyond the size of a meal, and thus, the optimal gut capacity is exactly the meal size. On the other hand, in a harsh environment, more birds should forage even if they have some food in the gut. This increase in the foraging rate, although increases predation risk for birds with larger guts, it decreases their starvation risk substantially in comparison with birds having smaller gut sizes, including those birds with a gut capacity equal to the meal size. Therefore, it is preferable for a bird to have a gut capacity larger than the meal size in a harsh environment.
In the present study, we made the simplifying assumption that each successful foraging attempt results in the same amount of food ( e ). One obvious extension of our model is to consider several possible foraging outcomes e 1 , e 2 , . . . , e N , which can be obtained with respective probabilities μ 1 , μ 2 , . . . , μ N . One question that would then arise is whether we will still find a simple relationship between the optimal gut capacity and meal size. Would the optimal gut capacity be equal, for example, to the minimal meal size, the maximal meal size or perhaps some combination of all possible meal sizes such as the average size?
Although our account is incomplete, especially because we have assumed that birds always get the same amount of food from each successful foraging attempt, we have shown how the contents of the gut contribute to birds' survival in comparison with fat reserves, and highlighted the existence of an optimal gut size that maximises the birds' chances of surviving winter. We also provided some insights into how this optimal gut size varies with environmental and physiological factors such as food supply, digestion rate and energy expenditure rate.

Disclosures and acknowledgements
The authors declare no conflicting interests. A.I.H. was supported by the European Research Council (Advanced Grant 250209 ). A.E and G.M were supported by the UK Engineering and Physical Sciences Research Council (Decision Making Project Grant EP/I032622/1 ). We thank two anonymous referees for their detailed comments on previous versions of this paper. G ( y ) = y, y ≤ g 0 g 0 , y > g 0 with g 0 represents the maximum of contents to be transformed (y ) = γ 0 y .

Updating the states:
The states are updated as follows: If at decision epoch t: X (t) = x, Y (t) = y then at time t ± 1: Depending on the decision i and the availability of food (with probability μ), we have: If i = r: We will note these two quantities respectively x r and y r .
If i = f and the animal has not found food: We note them x f and y f .
If i = f and the animal has found food: We note them x f and y f . Computing the optimal policy: Let T be a given time, and for t < T let V T ( x, y, t ) be the probability of survival from time t to T given that the bird follows the optimal strategy and that X (t) = x and Y (t) = y . We also assume that the bird dies if its energy reserves x drop to 0. Thus, we have: The value function V T ( x, y, t ) is computed through a backward iterative process using stochastic dynamic programming (see for e.g., Houston and McNamara 1999 ): where, V r T ( x , y, t ) = 1 − P pred r ( t ) V T ( x r , y r , t + 1 ) (7) The optimal decision, at each time t , is the one that gives the maximum in Eq. (6) . The renormalised value function converges ( McNamara, 1990 ) before time t = 0 in all our computations. That is, provided T − t is sufficiently large, V T ( x , y , t )/ V T ( x, y, t ) and V T ( x, y, t + 1 ) / V T ( x, y, t ) no longer depend on t, but only on x ', y ', x and y This means that the action that achieves the maximum in Eq. (6) does not depend on t . We take our optimal strategy to be given by this choice of action.
Reproductive value: • The reproductive value at time t : ˜ V T ( x, y, t ) is defined as the normalised value function: McNamara (1990) shows that this function converges as T → + ∞ . • The limiting reproductive value is defined by: