HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Foraging, Biological Clocks and Migration
  1. 1Optimal foraging
  2. 2Circadian and other biological rhythms
  3. 3Migration and navigation
  1. Biology
  2. /Foraging, Biological Clocks and Migration
  3. /Optimal foraging

Course 36.3·Lesson 1 of 3

Optimal foraging

A crab on the shore can choose small, middle-sized or large mussels. Which should it eat, and when should a bird leave a bush with few berries left? This lesson builds simple models of feeding and tests them against what animals really do.

about 30 min1 simulation1 practice question
Lesson 1 of 3Show all lessonsHide
Foraging, Biological Clocks and Migration
  1. 1Optimal foraging
  2. 2Circadian and other biological rhythms
  3. 3Migration and navigation

Try the code and the simulations beside the lesson.

Feeding is a set of choices

Watch a shore crab among mussels. Small mussels open fast but hold little flesh. Large ones hold a lot, but they take a long time to crack and can break a claw. Which should the crab choose?

Optimal foraging theory gives a way to answer. It says that natural selection favours ways of feeding that give the most net energy per unit time. An animal that feeds faster has more time and energy left for escaping, finding mates and raising young. The theory makes clear predictions that we can test.

Profitability

The profitability of a food item is the energy it gives, EEE, divided by the time needed to catch, open and eat it, the handling time hhh:

profitability=Eh\displaystyle \text{profitability} = \frac{E}{h}profitability=hE​
MusselEnergy (J)Handling (s)
small15030
medium90075
large2000250

The small mussel gives 150 J30 s=5 J/s\dfrac{150\ \text{J}}{30\ \text{s}} = 5\ \text{J/s}30 s150 J​=5 J/s. The medium one gives 900 J75 s=12 J/s\dfrac{900\ \text{J}}{75\ \text{s}} = 12\ \text{J/s}75 s900 J​=12 J/s. The large one gives 2000 J250 s=8 J/s\dfrac{2000\ \text{J}}{250\ \text{s}} = 8\ \text{J/s}250 s2000 J​=8 J/s. So the model predicts that the crab should prefer middle-sized mussels. Studies of shore crabs found just that pattern.

Northwestern crows on the Pacific coast of Canada break whelks by dropping them on rocks. They pick large whelks and drop them from about 5 m5\ \text{m}5 m. A lower drop needs many more tries. A higher one costs more climbing for little gain. About 5 m5\ \text{m}5 m gives the least total climbing for each whelk broken.

Which prey to include?

A bird finds two kinds of prey. Should it take both? The model ranks prey by profitability.

  • The best prey should always be eaten when it is found.
  • A poorer prey should be added only if eating it gives more than the bird would gain by ignoring it and searching on for the best prey.

So when the best prey is common, the bird should ignore poor prey, however common the poor prey is. When the best prey becomes scarce, the bird should start to eat both. Great tits that took mealworm pieces from a moving belt in a classic test behaved close to this prediction.

When to leave a patch

Food often comes in patches: a bush of berries, a field with worms. As an animal feeds, the patch runs down, and each minute gives less. Travel to the next patch takes time and gives nothing.

A graph of the marginal value theorem. The horizontal axis is time; to the right of zero is the time spent feeding in a patch, to the left is the travel time between patches. A curve shows the energy gained in the patch: it rises fast at first and then levels off as the patch is used up. Two straight lines start on the left of zero, one at a short travel time and one at a long travel time, and each just touches the curve. The line from the short travel time touches the curve early; the line from the long travel time touches it later. Dashed lines drop from the two touching points to the time axis and are labelled best time to leave, short trip and best time to leave, long trip.

Eric Charnov answered the question in 1976 with the marginal value theorem. The animal should leave when its rate of gain in the patch falls to the best average rate it can get over the whole trip, travel and feeding together. With a travel time TTT and a time in the patch ttt, the rate over a trip is

gain in the patchT+t\displaystyle \frac{\text{gain in the patch}}{T + t}T+tgain in the patch​

The picture shows the result. When the travel time is long, the best stay is longer. A starling that flies far from its nest to collect insects for its chicks brings back a larger load than one that feeds close to the nest.

Slide the time in the patch until the rate is highest. Then make the travel time longer. Notice that the best stay grows.

Food is not everything

An animal that feeds where it is easily seen may be eaten. Small sunfish feed in open water, where food is rich, when no predator is near. When predatory bass are in the pond, the small fish move into weed beds with less food but more cover. Large sunfish, too big for the bass, stay in the open. So the best choice balances energy against risk.

Try it in Python

The program finds the best stay in a patch for three travel times.

Read it first. Then run it. How does the best stay change as the travel time grows?

1. Change scale = 20 to scale = 40, a patch that runs down more slowly. What happens to the best stays?

Practise with new numbers

Common mistakes

  • Thinking the biggest prey is always best. It may take too long to handle.
  • Dividing time by energy. Profitability is energy over handling time.
  • Leaving out the travel time. The rate that counts is over the whole trip.
  • Thinking an animal should empty a patch. It should leave while food is still there.
  • Forgetting predators. A rich but risky place may not be the best choice.

Remember these

  • Optimal foraging: the most net energy per unit time, within limits.
  • Profitability =E/h= E/h=E/h; shore crabs prefer medium mussels.
  • Prey choice: always take the best; add poorer prey only when the best is scarce.
  • Marginal value theorem: leave when the patch rate falls to the best average rate; longer travel, longer stay.
  • Risk of predation can outweigh energy.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. A snail gives a thrush 500 J500\ \text{J}500 J and takes 50 s50\ \text{s}50 s to smash. A beetle gives 120 J120\ \text{J}120 J and takes 8 s8\ \text{s}8 s. Which is more profitable?
  1. Why might a crab avoid the largest mussels even though they hold the most flesh?
  1. Patches of berries become farther apart. Should a bird stay longer or shorter in each bush?
  1. The best prey of a bird becomes very common. What should happen to the share of poor prey in its diet?
  1. Small fish feed in weeds with little food when a predator is in the pond. Does this go against optimal foraging?

References

  • Alcock, J. Animal Behavior: An Evolutionary Approach, chapter on feeding behaviour (optimal foraging).
  • Davies, N. B., Krebs, J. R. and West, S. A. An Introduction to Behavioural Ecology, chapter on economic decisions and the individual.

Enroll free in Foraging, Biological Clocks and Migration

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (4)

A team offers shore crabs mussels of three sizes in a tank and measures the flesh energy of each…Hard · High School (11–12) · by StemPy Lab
Crows on a rocky coast break whelks by carrying them up and dropping them onto rocks, again and…Advanced · High School (11–12) · by StemPy Lab
A tit feeds on insects in one bush at a time…Advanced · High School (11–12) · by StemPy Lab
Next: lesson 2Circadian and other biological rhythms
← Foraging, Biological Clocks and Migration
← PreviousCircadian and other biological rhythms →

Discussion (0)

Log in to join the discussion.

Loading…

1 Python program
5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

In a pond, small sunfish can feed in open water, where insect larvae are plentiful, or in weed…Hard · High School (11–12) · by StemPy Lab

Python Labs (1)

The forager's calculatorPython Lab · by StemPy Lab