Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 5 : Predator / Prey Model Assume that a certain ecosystem contains both rabbits and wolves. The size of the rabbit population and the

Problem 5: Predator/Prey Model
Assume that a certain ecosystem contains both rabbits and wolves. The size of the rabbit population and the size of the
wolf population both fluctuate, and have an effect on each other. Suppose that the current sizes of the populations can be
used to determine the sizes of the populations one year from now according to the following population model:
Let A be the current size of the rabbit population.
Let B be the current size of the wolf population.
Let C be the size of the rabbit population one year from now.
Let D be the size of the wolf population one year from now
The population sizes one year from now are determine by the following equations:
C =1.5 A 0.002 A B
D =0.8 B +0.0003 A B
Suppose that the current rabbit population is 1000 and the current wolf population is 200. Under these circumstances, the
populations will fluctuate for several years, but the rabbit population will eventually die out completely.
In this problem, you will be asked to calculate the size of each population at the end of each year until the the rabbit
population dies out.
Perform the following steps in a single code cell:
1. Create variables r_pop and w_pop to store the current rabbit and wolf populations (which are provided above).
2. Print the first three rows of the table shown below (the column headers, the dashed line, and the year 0 info).
3. Use a loop to determine the new populations at the end of each new year. Each time the loop executes,
perform the steps below. The loop should continue to run for as long as both populations are greater than zero.
Store the current population values in temporary variables named r_pop_prev and w_pop_prev.
Use the formulas provided to calculate the new population sizes. Round the results to the nearest
integer, and store these values in r_pop and w_pop (as integers).
If any population end up being negative, it should be changed to 0.
Print a new line of the table below with updated values.
Year r_pop w_pop
-----------------------
01000200
11100220
21166249
.........
No lists should be created for this problem, and only one loop should be used.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MFDBS 89 2nd Symposium On Mathematical Fundamentals Of Database Systems Visegrad Hungary June 26 30 1989 Proceedings

Authors: Janos Demetrovics ,Bernhard Thalheim

1989th Edition

3540512519, 978-3540512516

More Books

Students also viewed these Databases questions

Question

What is meant by a concatenated identifier?

Answered: 1 week ago