![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=1738884629-MyLJQKwkqVoWyNCRVrQodbKErlc9iR7B-0-99ecb513c2d8967060b614aaab066cde)
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=1738884629-TvbcxihoOHWXgoaDnYagBMpeBxfi4lad-0-392a92efdcb6cf30149e4712e9ea032d)
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=1738884629-OvKfYrji5yEXz5AXzpmi4V9NL3EdfUGf-0-63ec79d754dbd7c5a83c0dc909fe3990)
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=1738884629-qVuKdrLVLXgW1aqgI2NHB6WEN1BiC2T4-0-5ddd9e5d1e21afe0f263435e3532bd77)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_1479.jpg?sign=1738884629-k79xfEdbj4UA44XO31aBf49bMVDO9DgA-0-a21fcda84263d79ff66e82aad6e66bc4)
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_268.jpg?sign=1738884629-SsPEvUhbwXQSkJLlXeGagr2GWXJMzwNI-0-bc94cf45cf1dfba54421262b81890232)
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=1738884629-1DNtTwj0Acsg185iovDnUStrefPTywVD-0-71f4ffa9ea87bc8994fdd1215d0983b5)
We can also write the preceding equation in the following form:
![](https://epubservercos.yuewen.com/FF11E0/19470372701459106/epubprivate/OEBPS/Images/Chapter_699.jpg?sign=1738884629-18jFHBKaIjfwZrREOlmhgq7OoexYQght-0-663d792ba2ce7332c88a043a306559d1)
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=1738884629-fQX3ni1thvFkMUmNqY1GyMG2rFR8Bq30-0-a2037412642833ac421c46ed12a6e921)
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.