To detect a difference between two means with common standard deviation , the per-group sample size for a two-sided test is
rounded up. Implement n_per_group(delta, sigma, alpha=0.05, power=0.8), computing normal quantiles yourself by bisection on (via math.erf).
Also implement mde(n, sigma, alpha=0.05, power=0.8): the minimum detectable effect for a given n per group (the same formula solved for ).