Define the truncated normal Z | a < Z < b for Z ~ N(0,1): write the normalized pdf and cdf. Then design efficient samplers for three cases: (i) a = 1, b = +∞; (ii) a = 4, b = 4.05; (iii) a = 4, b = +∞. For each, compare inverse-CDF sampling (draw U ~ Uniform(Φ(a), Φ(b)), set X = Φ^{-1}(U)) to simple rejection sampling from N(0,1) by computing the expected acceptance rate (1−Φ(1), Φ(4.05)−Φ(4), 1−Φ(4)). Propose an algorithm suitable for extreme tails (e.g., exponential or half-normal proposals with acceptance–rejection), discuss numerical stability when evaluating Φ and Φ^{-1} near machine precision, and explain how you would validate the sampler (KS test on back-transformed uniforms, moment checks).