![Hands-On Mathematics for Deep Learning](https://wfqqreader-1252317822.image.myqcloud.com/cover/81/36698081/b_36698081.jpg)
Random variables
Random variables are variables that have a probability distribution attached to them that determines the values each one can have. We view the random variable as a function, X: Ω → Ωx, where . The range of the X function is denoted by
.
A discrete random variable is a random variable that can take on finite or countably infinite values.
Suppose we have S ∈ Ωx:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_90.jpg?sign=1738879785-5Sobm9OrzrsLedUzuXwqoUcle2g4Y2tS-0-a9f6a601f8a70c432ed9816446134e67)
This is the probability that S is the set containing the result.
In the case of random variables, we look at the probability of a random variable having a certain value instead of the probability of obtaining a certain event.
If our sample space is countable, then we have the following:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_46.jpg?sign=1738879785-pYAN3USUZySYADIJMG0m5s3SRm5feanp-0-4bb8b6f5b0c2d33f654dd7a08796b935)
Suppose we have a die and X is the result after a roll. Then, our sample space for X is Ωx={1, 2, 3, 4, 5, 6}. Assuming this die is fair (unbiased), then we have the following:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_448.jpg?sign=1738879785-fJGcLDjKaDlJ6bPHOXvEbr7MccuoPiIm-0-7d419ce320b749bdc4cecf92411d1453)
When we have a finite number of possible outcomes and each outcome has an equivalent probability assigned to it, such that each outcome is just as likely as any other, we call this a discrete uniform distribution.
Let's say X∼B(n, p). Then, the probability that the value that X takes on is r is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_220.jpg?sign=1738879785-dMosXOrywtS4zZrqF82asGf0VlXai4ye-0-cbca835411d382f983b78378e862e8ff)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1479.jpg?sign=1738879785-FiSvEXKykldUHvfK5K84guOK2oDx3v7V-0-0010615c3cae75ba9cbc027b5e469da4)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_268.jpg?sign=1738879785-pdoCjLH2vA9iMT8TVHqyiSyqUsz156Fr-0-541c5330d5536993d9a4a5121dcb36d7)
A lot of the time, we may need to find the expected (average) value of a random variable. We do this using the following formula:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_5.jpg?sign=1738879785-IwR88PX6ZKybJgYsIgEJuDxamNs4OalH-0-d6109f2b2dc85e1038cff13477012995)
We can also write the preceding equation in the following form:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_699.jpg?sign=1738879785-hJxZKqHQ9ceB8tamPQr2F5Pmmn7VSeq3-0-5fb76e7ecda1aa55983e4cd036674a19)
The following are some of the axioms for :
- If
, then
.
- If
and
, then
.
.
, given that α and β are constants and Xi is not independent.
, which holds for when Xi is independent.
minimizes
over c.
Suppose we have n random variables. Then, their expected value is as follows:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1608.jpg?sign=1738879785-6C11vyc1FqHga1nSRizNs0zXJHxlO65t-0-6d61aafc2818d6e7019aca8d403a7f95)
Now that we have a good understanding of the expectation of real-valued random variables, it is time to move on to defining two important concepts—variance and standard variables.