The empirical cdf F̂n estimates F at every x at once. The Dvoretzky–Kiefer–Wolfowitz inequality turns it into a band: F̂n ± εn, with εn = √(log(2/α)/(2n)), contains the whole curve F with probability at least 1 − α, whatever F is. The top left panel shows it on the 799 nerve waiting times of the book. The rest of the page asks what "whole curve" costs: simulate samples from a known F and compare the band with the narrower pointwise intervals F̂n(x) ± zα/2√(F̂n(1 − F̂n)/n), which are right at each x separately but fail together.
Sample r uses its own seeded generator, so the same settings always give the same samples. For a continuous F the sample is drawn as Xi = F−1(Ui): the Normal, Cauchy and Exponential choices then see exactly the same uniforms, and the band covers in exactly the same samples. The pointwise intervals are checked on [X(1), X(n)), where 0 < F̂n < 1. The exact coverage curve is computed from the exact distribution of supx|F̂n(x) − F(x)| for continuous F.
code/ch07_estimating_cdf.py (dkw_eps, dkw_band, band_events, band_coverage_sim, ks_exact_cdf, pointwise_exact_at_median).