# prize35-11 Exercise 2: how much yearly removal does it take to control an invader? K, r = 1000, 0.5 def final(removal, start=10, years=60): n = start for _ in range(years): n = n + r * n * (1 - n / K) n = n * (1 - removal) return n print("removal population after 60 years") for pct in (0, 10, 20, 30, 33, 34, 40, 50): print(f"{pct:5}% {final(pct / 100):10.1f}") smallest = next(p for p in range(0, 100) if final(p / 100) < 10) print("smallest whole-percent removal that shrinks it below the start of 10:", smallest, "%") print(f"rule of thumb r / (1 + r) = {r / (1 + r) * 100:.1f}%") # Output: # removal population after 60 years # 0% 1000.0 # 10% 777.8 # 20% 499.9 # 30% 84.9 # 33% 10.9 # 34% 4.8 # 40% 0.0 # 50% 0.0 # smallest whole-percent removal that shrinks it below the start of 10: 34 % # rule of thumb r / (1 + r) = 33.3% # Reading it: below roughly a third of the population removed each year, the invader still wins; above it, it declines. # The threshold is close to r / (1 + r), and sustained effort matters more than a single large cull.