If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Instructions: Natural selection

Apply loops to simulate natural selection over many generations of the Neebler population.
Can you simulate a population over many generations to see natural selection at work?
Natural selection is the process by which living things that have traits better suited for their environment are more likely to survive and reproduce. Over many generations, these helpful traits become more common in the population. Watch Natural selection and the owl butterfly to learn more!
In this project, you’ll study the fictional Neebler population, and explore how trait variations influence how well Neeblers strive or thrive over several generations.

Traits and variations

Imagine a trait that Neeblers might have like size, speed, or even number of eyes! Then, imagine two variations of that trait, like small and big or slow and fast. Consider how each variation might make a Neebler better or worse suited to their environment.
  • Choose a trait, two variations of that trait, and at least one question to explore in your simulation.
For example, you might consider how the trait influences how likely a Neebler is to be caught by a predator, or how well a Neebler can find water or bond with other Neeblers. How does that behavior influence their survival?
Maybe Neeblers suffer from food scarcity if the population gets too large. How does the trait influence how well a Neebler can compete for food in the environment?

Survival

Once you have your trait, split the first Neebler generation into two groups based on variation.
  • Create two variables to keep track of the number of Neeblers in each group and set an initial population size for each.
  • Using your question, model each Neebler variation’s chance of survival, with some randomness.
For example, small Neeblers might be harder for predators to spot than big Neeblers, so they might be twice as likely to survive. Be sure to update the number of surviving Neeblers in each group.

Reproduction

Neeblers reproduce asexually, which means they don’t need to mate with another Neebler to have babies. A Neebler passes its trait variation onto its children. For example, a small Neebler might have between 0 and 3 babies, where each baby inherits the small variation.
  • Model reproduction for each surviving Neebler, with some randomness.
  • Create two new variables to count the number of baby Neeblers with each variation.
Neeblers with different variations may have the same chance of reproduction, or their variation may influence the number of babies they have — it’s up to you!

Multiple generations

At the end of a generation, the surviving adult Neeblers die out, and their babies become the starting population for the next generation.
  • Wrap the survival and reproduction steps in a loop to simulate multiple generations.
  • Terminate the loop after some number of generations, or if the population dies out.
Be sure to update the number of Neeblers in each group at the bottom of the loop accordingly.

More to explore

What other population events can we explore?
Consider adding one or two random mutations to your model. During reproduction, one of these mutations might randomly appear, and instead of inheriting the trait of their parent, the baby expresses a new variation of the trait, like teeny-tiny Neeblers!
Model one of the chance events in Genetic drift. For example, a volcanic eruption might wipe out a large portion of the Neebler population, impact their food supply, or reduce the number of predators.

Want to join the conversation?

No posts yet.