![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=1739695411-gRrRugPEZ7tWf4vCv7McHEW13R9aGNSD-0-7d14ea73f4e0372b751ca0719ee40dd1)
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=1739695411-45htrPIv3K37s0x7TCfhev9syrPLjYbe-0-cd6be711ce5c99991915d68f21171f59)
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=1739695411-8V0S5NYffDqdLbjvSJQ4tnrcHEhacZyC-0-7f991edf7da1e71abded3046e46be784)
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=1739695411-HpLnqSriiuAjl4i6amLiTkD7vL1G5Qxl-0-a7c347c0ba929539b39061361867c6a6)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1479.jpg?sign=1739695411-hsgOdYzP64p52FUjkH9JZPOt5FKfq1Aa-0-7d1a2feb499a70ca453f1c3c624161bf)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_268.jpg?sign=1739695411-S0i46xiE41s95uNtrTaQe2NIkDfSRr86-0-79a7186e99187adb3a6e78f1afe0f71a)
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=1739695411-W8mFzsKtLLMoVmuo4Ti3vbKBRpH7OLf8-0-a7a9a7c3772382c9d6721927f77d7b96)
We can also write the preceding equation in the following form:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_699.jpg?sign=1739695411-xjvwHLr95JADxkt4HRXPnov9wuJZRMOm-0-90ce1546047735633194ba1d445ccd7c)
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=1739695411-TBimifYD64BldAuPNI80X6xnxMNh5XXs-0-b98daa43445be7f40ceb78ba7169ce92)
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.