2.2. Example: Biology
2.2.1 Vibe Coding simulations in the biology classroom
Predator–Prey Dynamics (Lotka–Volterra model)
Subject: Biology · Grade: 9 (age 14–15) · Duration: 1 double lesson (90 min)
Learning objectives
By the end of the lesson, students can:
- describe the key variables (prey population, predator population) and parameters (growth rate, predation rate, conversion efficiency, mortality rate) of the Lotka–Volterra model;
- form and test hypotheses about population dynamics using an interactive simulation;
- extend an existing simulation with
aadditionalnewlayersfactorof ecological complexity (e.g.hunting)a carrying capacity, a second species, a seasonal factor) by writingastructuredpromptprompts for an AI language model; - critically evaluate the model’s assumptions and limitations (Nature of Science), including why introducing randomness or an additional factor can destabilise it.
Take-home message: Students
don’don't need to code from scratch. Reading and testing an existing simulation,extendingthenitusingthroughan LLM to add one layer of ecological realism at awell-structured AI prompt, and then deliberately trying to break it,time, is enough to build genuine understanding of a dynamic biological model — and,justsoonerasorimportantly,later,oftowhatdiscoveranyfor themselves exactly where that modelcanreachesanditscannot show.limits.
Content
PredatorMathematical models and preycomputer populationssimulations typicallyare showespecially cyclical,valuable phase-shiftedtools fluctuationsin (classicecology, example:because lynxthey can express highly complex relationships between organisms and snowshoetheir hare)environment through comparatively simple mathematical equations (often systems of differential equations). This makes it possible to run experiments in silico and test hypotheses on the model in situations where a real experiment would be too costly, too slow, ethically difficult, or outright dangerous — manipulating a real predator population, for instance, is rarely an option. At the same time, every model is necessarily a simplification of reality, and this is exactly where its weaknesses lie: real ecosystems are far more complex than any model can fully capture.
The Lotka–Volterra model (Lotka, 1925; Volterra, 1926) is a classic example of such a simplification, applied to predator–prey dynamics — the cyclical, phase-shifted fluctuations typical of many real predator and prey populations (classic example: lynx and snowshoe hare). It describes thisthe system with two variables — prey population and predator population — and four parameters: prey growth rate, predation rate, conversion efficiency, and predator mortality rate. The oscillation results from a feedback loop: more prey → more food for predators → predator population grows → more predation → prey declines → less food for predators → predator population declines → prey recovers, and the cycle repeats.
ThisTo tidyproduce cyclethis onlyclean emerges becausecycle, the model makes several strong assumptions: it is deterministic: given (the same starting values, itvalues always producesproduce exactly the same curve.curve); it is a closed two-species system that excludes every abiotic factor (temperature, precipitation, season) and every other biotic factor (food plants for the prey, a third species, disease); and it makes each population's growth depend on nothing except the size of the other population.
Real populations arerarely notmeet likethese thisassumptions. — births,Births, deaths and encounters are subject to chance, and a stochastic (randomised) version of the same model tends to drift away from the clean cycle and can even collapse (e.g. the predator population dying out) in cases where the deterministic version predicts stable oscillation. TheLikewise, modeladding is alsojust a closedsingle system: it excludes every abiotic factor (temperature, precipitation, season) and every other biotic factor (food plants for the prey, a third species, disease), and makes each population’s growth depend on nothing except the size of the other population. Adding just one suchmissing factor — a temperature-dependent growth rate, or a limit on the prey’prey's own food supply — is often enough to break the clean two-variable cycle. This is not a flaw to hide from students: it is the central Nature-of-Science lesson of the activity. A model can be genuinely useful (it explains why lynx and hare numbers rise and fall in step) while still being a deliberately narrow approximation of reality — and using it well means knowing exactly which factors it leaves out. In this lesson's main activity, students discover this for themselves by trying to add exactly these kinds of factors.
Lesson plan
| Phase | Time | Activity |
| Warm-up | 8 min | |
| Input | 12 min | |
| Explore | 15 min | |
Guiding questions: layering complexity
Pairs work through as many of the following rounds as time allows in the 35 minutes (most manage two; the third is an extension for early finishers). Each round follows the same four-step cycle:
Closing question (for the Reflect phase): At which round did the simulation stop producing a clean, repeating cycle — and what does that tell you about how many real-world factors the original Lotka–Volterra model has to leave out in order to stay solvable and easy to interpret?
Materials
- One laptop per student pair, with a browser