# prize35-1 Exercise 3: mark-recapture scenarios scenarios = [ ("A", 30, 40, 6), ("B", 100, 80, 10), ("C", 25, 30, 15), ] for label, marked, second, recaptured in scenarios: n = marked * second / recaptured chapman = (marked + 1) * (second + 1) / (recaptured + 1) - 1 print(f"{label}: Lincoln-Petersen {n:7.1f} Chapman {chapman:7.1f}") # Output: # A: Lincoln-Petersen 200.0 Chapman 180.6 # B: Lincoln-Petersen 800.0 Chapman 742.7 # C: Lincoln-Petersen 50.0 Chapman 49.4 # Scenario C recaptured 15 of 30, so about half of the population was already marked: the estimate (50) # is close to the number marked plus a few. Scenarios with few recaptures (A, B) are much less certain, # and Chapman's correction pulls the estimate down a little when recaptures are few. # Assumptions that can break: marks fall off, marked animals become trap-shy or trap-happy, # animals move in or out, or the animals are not mixed before the second sample.