# Introduction to Probability

Probability Theory is a fundamental branch of mathematics concerned with quantifying the likelihood of events. Probability answers the question: *"How likely is it that a particular outcome will happen?”*&#x20;

This concept is expressed as a number between 0 and 1, where 0 indicates impossibility of an event to occur and 1 indicates certainty of an event happening.

In probability theory, a probability space includes three key components:&#x20;

1. **Sample Space (S):** the set of all possible outcomes of a particular experiment
2. **Sigma-Algebra (F):** representing subsets of the sample space for which probabilities are defined
3. **Probability Function (P):** assigning probabilities to these subsets.&#x20;

The sample space, encompasses all possible outcomes of a random experiment. The sigma-algebra consists of subsets of the sample space, ensuring that certain properties hold true under probability measures, such as closure under complementation and countable unions. Lastly, the probability function assigns probabilities to these subsets, reflecting the likelihood of different outcomes or events occurring within the sample space. These 3 components form the foundational framework for analyzing uncertainty and randomness in various statistical contexts.

### <mark style="color:blue;">Example 1: Flipping a Coin</mark>

**Sample Space (S)**: The set of all possible outcomes.

* $$S={Heads,Tails}$$

**Sigma-Algebra (F)**: The collection of all subsets of the sample space including the empty set.

* $$F = { \emptyset, {\text{Heads}}, {\text{Tails}}, {\text{Heads}, \text{Tails}} }$$

**Probability Function (P)**: Assigns a probability to each subset in the sigma-algebra.

* $$P(∅)=0$$
* $$P({\text{Heads}}) = \frac{1}{2}$$
* $$P({\text{Tails}}) = \frac{1}{2}$$
* $$P({\text{Heads, Tails}}) = {1}$$

### <mark style="color:blue;">Example 2: Rolling a Die</mark>

**Sample Space (S)**: The set of all possible outcomes.

* $$S = { 1, 2, 3, 4, 5, 6 }$$

**Sigma-Algebra (F)**: The collection of all subsets of the sample space including the empty set.

* $$F = { \emptyset, {1}, {2}, \ldots, {6}, {1, 2}, {1, 3}, \ldots, {1, 2, 3, 4, 5, 6} }$$

**Probability Function (P)**: Assigns a probability to each subset in the sigma-algebra.

* $$P(\emptyset) = 0$$
* $$P({1}) = \frac{1}{6}$$
* $$P({2}) = \frac{1}{6}$$​
* $$\vdots$$
* $$P({1, 2}) = \frac{2}{6}$$
* $$\vdots$$
* $$P({1, 2, 3, 4, 5, 6}) = 1$$

### <mark style="color:blue;">Example 3: Detecting the Presence of a Gene Variant</mark>

**Sample Space (S)**: The set of all possible genotypes at a particular genetic locus.

* $$S = { \text{AA}, \text{Aa}, \text{aa} }$$

**Sigma-Algebra (F)**: The collection of all subsets of the sample space.

* $$F = { \emptyset, {\text{AA}}, {\text{Aa}}, {\text{aa}}, {\text{AA}, \text{Aa}}, {\text{AA}, \text{aa}}, {\text{Aa}, \text{aa}}, {\text{AA}, \text{Aa}, \text{aa}} }$$

**Probability Function (P)**: Assigns a probability to each subset in the sigma-algebra, typically based on population genetics models such as Hardy-Weinberg equilibrium.

* $$P(\emptyset) = 0$$
* $$P({\text{AA}}) = p^2$$
* $$P({\text{Aa}}) = 2pq$$
* $$P({\text{aa}}) = q^2$$
* $$P({\text{AA}, \text{Aa}}) = p^2 + 2pq$$
* $$P({\text{AA}, \text{aa}}) = p^2 + q^2$$
* $$P({\text{Aa}, \text{aa}}) = 2pq + q^2$$
* $$P({\text{AA}, \text{Aa}, \text{aa}}) = 1$$

where $$p$$ is the frequency of the dominant allele $$A$$ and $$q$$ is the frequency of the recessive allele $$a$$ in the population, with $$p+q=1$$.
