{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basics of probabilities\n",
"***Reading: Emile-Geay: Chapters 1,2***"
]
},
{
"cell_type": "markdown",
"metadata": {
"tags": []
},
"source": [
"In this module, we will learn how to model and describe the outcome of random processes. \n",
"\n",
"We'll start by reviewing some basics of probability theory. I will use some simple examples - dice and roullete - as simple models to illustrate basic probability concepts. We'll also use these simple examples to build intuition on several properties of probabilities - the law of total probability, independence, conditional probability, and Bayes's rule - that can be generalized, and will be used throughout the course. \n",
"\n",
"# Probability Spaces\n",
"\n",
"\n",
"A probability model is a representation of a random process, or random phenomenon. To build a probability model of a random process we need a probablity space, and a random varible. This notebook will focus on probability spaces. \n",
"\n",
"To define a probability space we need: \n",
"1. A sample space, $\\Omega$\n",
"2. An event space, $\\mathcal F$\n",
"3. A probability function, $P$\n",
"\n",
"Read more about probability spaces on Wikipedia\n",
"\n",
"## Discrete Sample Space\n",
"**Roulette**\n",
"A simple example to illustrate the concept or probability spaces is the roullete. Here we'll consider an American Roullete with 38 equally-probably numbers.\n",
"\n",
"\n",
"\n",
"- ***Sample Space***:
\n",
" The sample space is the space of all possible outcomes.\n",
" \n",
"$$\\Omega=\\{\\color{green}{00},\\color{green}0,\\color{red}1,2,\\color{red}3,4,\\ldots, \\color{red}{36}\\}$$\n",
"\n",
"- ***Event Space:***
\n",
" The event space is the set of all subsets of the sample space: \n",
" \n",
"$$\\mathcal F=\\left\\{\n",
"\\{\\color{green}{00}\\},\n",
"\\{\\color{green}{0}\\},\n",
"\\{\\color{red}1\\},\n",
"\\{2\\},\\{\\color{red}3\\}\\ldots,\n",
"\\{\\color{green}{00},\\color{green}0\\},\\ldots,\n",
"\\{ \\color{red}1,\\ldots, \n",
"\\color{red}36\\}\\right\\}$$\n",
"\n",
"- ***Probability:***
\n",
" For a roullete the probability is defined as $P=1/38$ for each of the 38 possible outcomes in the sample space. Each event also has an associated probability \n",
"\n",
"We note a couple of things. The Sample space and the event space do not uniquely define the probability. For example, we could have a biased roullete (perhaps using a magnet and a metal ball), such that the ball is more likely to fall on particular numbers. In that case, the probability of individual outcomes in the sample space may not be equal. However, as we discusss more below, the total sum of probabilities across the possible outcomes still has to equal 1, unless there is a chance that the ball falls off the roullete table and none of the outcomes is hit. \n",
"\n",
"Note also that outcomes are different from events. A single outcome, e.g. a roullete roll of $\\color{green}{00}$ is associated with multiple possible events. It helps to think of an event as a possible bet , and the event space as *the space of all possible bets*. Any bet you make on the roullete can be expressed as a subset of $\\mathcal F$, and has a probability associated with it. \n",
"\n",
"For example, consider a bet on a single number (e.g. on $\\color{red}7$), also called a straight-up bet. This event is equivalent to the outcome of the roullete being in the set $E_1=\\{\\color{red}1\\}$. The probability of this event is $P(E_1)$=1/38.\n",
"\n",
"\n",
"\n",
"Alternatively consider a bet on red. This event is equivalent to the outcome being in $E_2=\\left\\{\\color{red}{1},\\color{red}{2},\\color{red}{3},\\ldots,\\color{red}{36}\\right\\}$, and its probability is $P(E_2)=18/38$.\n",
"\n",
"\n",
"\n",
"*Note*: Formally, the event space is a $\\sigma$-algebra, and the probability function is a measure.\n",
"\n",
"## Infinite Sample Spaces\n",
"Why do we need to go through these definitions of event spaces and sample spaces? For probability spaces with a finite number of possibl outcomes we can assign a probability to each outcome and it becomes trivial to compute the probability of events. However, that is no longer the case when we start working with infinite sample spaces, such as an interval on the real line. For example, if the sample space of a random process is the interval $\\Omega=[0,1]\\in \\mathbb R$, there are an infinite number of possible outcomes, and thus not all of them can have finite (non-zero) probability. In that case, we can only assign finite probabilities to sub-intervals, or subsets of the sample space. In other words, *in the most general case we can only assign finite probabilities to member of the event space $\\mathcal E$*. However, the same rules of probabilites apply for both infinite and finite samples spaces, and it is easier to get an intuition for them on small, finite spaces. \n",
"\n",
"For purposes of this class, we don't need to worry about probability spaces, event spaces, and probability functions. However, simple examples such as these are useful in illustrating some very general properties of probabilities that we *will* use extensively in the class, especially in the chapters on statistical inference and Bayesian data analysis. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"