Shows a random variable X as a mapping from outcomes ω in a sample space to numbers, then compares discrete vs continuous distributions. The bottom panels animate an interval (a,b] and demonstrate that P(a<X≤b)=F_X(b)-F_X(a): as a sum of PMF bars for a discrete RV and as an area under the PDF (integral) for a continuous RV, with the corresponding CDF step-curve vs smooth curve.
Self-contained canvas draw function with retro grid-snapped rendering and green-on-black palette. Includes a small mouse interaction (mousemove) attached once to the canvas: x controls interval center, y controls interval width; otherwise it auto-animates. Uses simple normal PDF/CDF approximations (erf approximation) and a fixed discrete PMF to illustrate step vs smooth CDF behavior.