In [1]:
import pandas as pd
Probabilities Add Up to 1¶
Another important property we are going to learn is that the probabilities of events that make the whole sample space will add up to $1$. For example:
In [2]:
dataset = pd.DataFrame({
'Person #':[1,2,3,4,5,6,7,8,9,10],
'City':['SF','SF','NY','NY','NY','SF','NY','SF','SF','SF'],
'Age':[41,26,28,53,32,51,65,49,25,33]
})
dataset
Out[2]:
In [3]:
dataset.sample(1)['City'].values[0]
Out[3]:
In this experiment, if we think of the events $E=$ "the person chosen is from SF" and $F=$ "the person chosen is from NY", we can notice that toghether they make the whole sample space $\Omega=\{SF,NY\}$.
So, even though we don't know yet how much each probability is, we can tell that: