For a continuous variable, P(a ≤ X ≤ b) is the integral of the density f(x) from a to b, and the total area under f is 1. The probability of any exact value is 0. The CDF, F(x) = P(X ≤ x), is the running area under the density, and the density is the CDF's derivative. Discrete variables use a probability mass function instead, where each value has a real probability.
Example: a uniform distribution on [0, 0.5] has density 2 across that interval. The curve sits above 1, yet the area is 0.5 × 2 = 1. For a standard normal the density at 0 is about 0.399, and P(−1.96 ≤ Z ≤ 1.96) = F(1.96) − F(−1.96) ≈ 0.95, which is where the 1.96 in 95% confidence intervals comes from.
In machine learning, the likelihood of continuous data is a product of densities, kernel density estimation estimates a density from samples, and generative models such as normalizing flows learn one. Common follow-ups: why P(X = x) is 0 for a continuous variable, and how to sample from any distribution by feeding uniform random numbers through the inverse of its CDF (inverse transform sampling).