The Deep Learning Book (Goodfellow Et al. 2016) defines a random variable as (see section 3.2):
A random variable is a variable that can take on different values randomly. We typically denote the random variable itself with a lower case letter in plain typeface, and the values it can take on with lower case script letters. For example, x1 and x2 are both possible values that the random variable x can take on. For vector-valued variables, we would write the random variable as x and one of its values as x. On its own, a random variable is just a description of the states that are possible; it must be coupled with a probability distribution that specifies how likely each of these states are.
Random variables may be discrete or continuous. A discrete random variable is one that has a finite or countably infinite number of states. Note that these states are not necessarily the integers; they can also just be named states that are not considered to have any numerical value. A continuous random variable is associated with a real value.
This definition seems to be different from the regular definition of a random variable, which from my understanding, requires the value to be numerical (more concretely, the random variable defines a mapping from sample space to a measurable space).
This becomes apparent when you compare the regular definition of the expected value (discrete case):
$$ \mathbb{E}[X] = \sum_x xP(x) $$
compared to the definition deep learning book (see section 3.8):
$$ \mathbb{E}_{x \sim P}[f(x)] = \sum_x P(x)f(x) $$
where since their definition of random variable is not numerical, we require this mapping function $f$ that's basically what the random variable is actually suppose to be defined as. That is, their definition is more a synonym for the outcome of an experiment (i.e. a variable that takes on a value from sample space).
Is my understanding here correct? If so, is there a good reason for deviating from the standard definition for random variable? It seems quite confusing that they use a different definition from what is standard.
https://math.stackexchange.com/questions/240673/what-exactly-is-a-random-variable
https://stats.stackexchange.com/questions/236765/does-a-random-variable-needs-to-be-numeric
– leonbloy Aug 31 '23 at 15:35