2.2. Example: Biology (Weingarten)
2.2.1 Alex: Vibe Coding with AI -– programmingProgramming htmlHTML simulationsSimulations
Example: 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:
Content
Predator and prey populations typically show cyclical, phase-shifted fluctuations (classic example: lynx and snowshoe hare). The Lotka–Volterra model (Lotka, 1925; Volterra, 1926) describes this 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.
This tidy cycle only emerges because the model is deterministic: given the same starting values, it always produces exactly the same curve. Real populations are not like this — 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. The model is also a closed 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 such factor — a temperature-dependent growth rate, or a limit on the 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.
Lesson plan (very short)
Materials
Take-home message: Students don’t need to code from scratch. Reading and testing an existing simulation, extending it through a well-structured AI prompt, and then deliberately trying to break it, is enough to build genuine understanding of a dynamic biological model — and, just as importantly, of what any model can and cannot show.