Discrete vs Continuous Random Variables
The two families differ in whether outcomes are countable, and that difference decides whether you sum or integrate.
Two kinds of randomness
A discrete random variable takes values in a finite or countably infinite set: counts of events, categories, integers. A continuous random variable can take any value in an interval: times, lengths, temperatures. The distinction governs every formula you use.
Mass versus density
Discrete variables carry probability at points, described by a mass function p(x) = P(X = x). Continuous variables carry zero probability at any single point; instead a density f(x) gives probability per unit length, and probabilities come from areas: P(a ≤ X ≤ b) = ∫ f(x) dx.
- Discrete: Σ p(x) = 1, expectation Σ x p(x).
- Continuous: ∫ f(x) dx = 1, expectation ∫ x f(x) dx.
- Both: F(x) = P(X ≤ x) is non-decreasing from 0 to 1.
The density is not a probability
A continuous density can exceed 1; only its integral over an interval is a probability. This trips up newcomers who read f(x) = 2 as an impossible probability. It is a rate, and the units are inverse to those of x.
Mixed and discretized variables
Real data often mixes the two: a sensor that reports zero when off and a continuous value when on has an atom at zero plus a density elsewhere. Continuous quantities also become discrete once digitized to finite precision, which is why simulation output is technically discrete even when the model is continuous.
Choosing the right family at the modeling stage prevents the classic error of assigning a nonzero probability to an exact real value, which is always zero for a continuous variable.