# prize35-10 Exercise 3: how long does an island take to fill up? import math POOL = 100 islands = { "large, near": (0.04, 0.02), "large, far": (0.01, 0.02), "small, near": (0.04, 0.08), "small, far": (0.01, 0.08), } print("island equilibrium years to reach 90% formula 2.3/(i+e)") for name, (i, e) in islands.items(): eq = POOL * i / (i + e) s, year = 0.0, 0 while s < 0.9 * eq: s += i * (POOL - s) - e * s year += 1 print(f"{name:12} {eq:11.1f} {year:18} {math.log(10) / (i + e):17.1f}") # Output: # island equilibrium years to reach 90% formula 2.3/(i+e) # large, near 66.7 38 38.4 # large, far 33.3 76 76.8 # small, near 33.3 19 19.2 # small, far 11.1 25 25.6 # Reading it: the small near island fills fastest (about 19 years) and the large far island slowest (about 76), because the time scale # is roughly 2.3 divided by (i + e). Arrival and loss rates both matter, so the two effects of size and distance trade off.