Enhancing a trait gives diminishing benefit but accelerating side-effect risk. A population of 300 individuals evolves its enhancement level e by tournament selection; the dots climb the fitness curve toward the optimum e*.
Green curve: net fitness W(e). Orange: benefit. Red: side-effect risk + cost. Dots: individuals. Dashed vertical line: analytic optimum e*.
The science
Net fitness W(e) = 1 - exp(-k e) - c e^2 - m e: a saturating benefit (diminishing returns), a quadratic side-effect risk (off-target effects compound) and a linear metabolic cost. The optimum solves W'(e) = k exp(-k e) - 2 c e - m = 0; it is found by bisection and independently by a brute-force grid search, and the evolving population (tournament size 3, mutation sd 0.04) should settle near it. Simplifications: one trait, no genetics of how the enhancement is delivered, no ethics or inequality - this is a toy cost-benefit model, not a prediction about real biotechnology.