Discrete random variables
A discrete random variable is a numerical variable with either a finite or a countably infinite number of possible values. Usually these values are counts of something — integers. For example,
Continuous random variables
In contrast, a continuous random variable can take any value within some range. For example,
It can be argued that recorded values are always rounded to some number of decimals, making the number of possible recorded values of these variables finite, but the underlying measurement is continuous with an uncountable number of possible values.
Probabilities for individual values
The randomness of discrete random variables can be described with the probabilities of all possible values — either with a table of probabilities or a mathematical function. This is not possible for continuous random variables since all individual values have effectively zero probability.
Probability for a specific value of X
If a random variable, \(X\), has a continuous distribution,
\[ P(X=x) \;=\; 0 \qquad \text{for all } x \]We only explain this informally. Consider the following sequence of probabilities:
The probabilities that \(X\) would equal \(x\) to \(k\) decimal places will clearly decrease as \(k\) increases. In the limit, the probability that \(X\) equals \(x\) to an infinite number of decimals is infinitesimally small — effectively zero.
We will still use probabilities to describe the distribution of a continuous random variable, but must find a way to describe the probabilities for events, such as \((2 \lt X \lt 3)\), not individual outcomes such as \((X = 2.5)\).
Probability density functions
A continuous random variable's distribution is characterised by a function called a probability density function that is closely related to the histogram of a data set.
Reducing histogram class width
In conventional histograms of data sets with equal class widths, the height of each class's rectangle is given by the proportion of values in that class. A similar histogram can be drawn for a continuous random variable, but with the rectangle's height being given determined by the probability of a value being in the class.
Click Narrower several times to reduce the width of the histogram classes. For a histogram of a finite data set, reducing the class width generally makes the contour of the histogram more jagged, but with a continuous distribution, the shape approaches a smooth curve.
With infinitely narrow histogram class widths, a continuous distribution's histogram is called its probability density function, often abbreviated to the distribution's pdf. (This is scaled to have area one.)
A random variable's probability density function is often described by a mathematical function,
\[f(x)\]We will fully describe the properties of probability density functions in a later chapter. In the remainder of this section, we informally introduce some of the ideas.