Stellar Grove · Research

Stellar Grove · Concrete Mathematical Modelling

Which worms should a bird eat?

A big worm is worth more but takes longer to eat. When should a bird ignore small worms?

Chapter 7 · Optimal decision and reward. A worked example rebuilt from the chapter's topic in Mike Mesterton-Gibbons, *A Concrete Approach to Mathematical Modelling*; the scenario and numbers are our own illustration, not the book's text.

Headline: Rank worms by energy per second of handling: big worms (5 J/s) beat small ones (2 J/s). The bird should still eat small worms now, and ignore them once big worms are met more than 0.083 times a second, however many small worms there are.

The problem

A thrush searches a lawn. It meets big worms (e1=40 J, h1=8 s to handle) at rate λ1 per second of searching, and small ones (e2=6 J, h2=3 s) at λ2=0.5. Eating a small worm takes time that could have been spent finding a big one. Which worms should it take to maximise energy per unit time?

The model

Time alternates between searching and handling. Over a long foraging bout of search time Ts, the bird meets λiTs worms of type i; if it eats the types in its diet D, the long-run intake rate is the ratio of expected energy to expected time (Holling's disc equation, a renewal-reward ratio):

R(D)=∑i∈Dλiei1+∑i∈Dλihi

Rank types by profitability ei/hi. Adding the next type raises R exactly when its profitability beats the rate already achieved without it. For two types, small worms are worth eating when

e2h2>λ1e11+λ1h1⟺λ1<e2e1h2−e2h1

Here the threshold is λ1*=6/(40·3−6·8)=0.0833. At λ1=0.05 the specialist rate is 1.429 J/s and the generalist 1.724 J/s.

Intake rate of the two strategies as big worms become more common; the lines cross at the switch point
Intake rate of the two strategies as big worms become more common; the lines cross at the switch point

Try it

Diet choice explorer

Drag the sliders; hover the chart to read values.

Key findings

from books.concrete_mathematics import decision as de
d = de.optimal_diet(rates=[0.05, 0.5], energy=[40.0, 6.0], handling=[8.0, 3.0])
print(d.include, round(d.rate, 3))
print(round(de.switch_density(0.05, e=(40.0, 6.0), h=(8.0, 3.0)), 4))
print([round(x, 3) for x in de.mvt_exponential(G=10, a=0.5, travel=4)])   # patch-leaving time and rate

# → [0, 1] 1.724
# → 0.0833
# → [3.01, 1.11]

Assumptions and extensions