Repeat trials times: draw n values from , build the
interval using the known , and
check whether it contains the true mean of 0. Return the fraction that did.
This is what "95% confidence" actually means: a statement about how often the procedure captures the parameter, not about any single interval.
Seed np.random.seed(seed) inside solve, immediately before drawing.
Input
n = 30
trials = 2000
seed = 0
Output
0.947