Random variables
To understand statistical data analysis, we must first understand the concept of a random variable.
A random variable is a function that assigns a number to each element of a sample space. By converting symbolic outcomes such as HTTH, they allow for simpler mathematical analysis of the data.
The coin example illustrates this. The sample space S1 has 16 outcomes. For each outcome x, let X(x) be the number of heads in that outcome. For example, X(HHTH) = 3, and X(TTTT) = 0. This is the same as the transformation of S1 into S2 in the previous discussion. Here, we are using the random variable X for the same purpose. Now we can translate statements about the probability functions p and P into statements about purely numerical functions.