NumPy allowed · plain Python earns 10 bonus points
Implement the Wilson score confidence interval, a real, more statistically sound alternative to a naive normal-approximation interval for reporting uncertainty on a small-sample eval pass rate.
Implement wilson_interval(successes, total, z) using the real Wilson score formula: p = successes/total; denom = 1 + z**2/total; center = (p + z**2/(2*total)) / denom; margin = (z * sqrt(p*(1-p)/total + z**2/(4*total**2))) / denom. Return (center - margin, center + margin).
wilson_interval(successes: int, total: int, z: float) -> tuple