# prize35-6 Exercise 3: density-dependent birth and death rates def step(n): b = 0.40 - 0.0002 * n # births per head fall as the population crowds d = 0.10 + 0.0001 * n # deaths per head rise return n + (b - d) * n print(f"equilibrium where b = d: N = {(0.40 - 0.10) / (0.0002 + 0.0001):.0f}") for start in (100, 1500): n = float(start) for year in range(0, 31): if year % 10 == 0: print(f"start {start:5d} year {year:2d} N = {n:7.1f}") n = step(n) # Output: # equilibrium where b = d: N = 1000 # start 100 year 0 N = 100.0 # start 100 year 10 N = 659.7 # start 100 year 20 N = 983.1 # start 100 year 30 N = 999.5 # start 1500 year 0 N = 1500.0 # start 1500 year 10 N = 1007.9 # start 1500 year 20 N = 1000.2 # start 1500 year 30 N = 1000.0 # Reading it: both starting points, one far below and one far above, settle at 1000. That is the carrying # capacity: the density at which births exactly balance deaths. Density-dependent rates act like a thermostat, # pulling the population back towards the equilibrium from either side. Logistic growth is this idea written # as a single formula.