moving stuff around
This commit is contained in:
+791
File diff suppressed because one or more lines are too long
+222
@@ -0,0 +1,222 @@
|
||||
State De Morgan's Law for $n$ sets
|
||||
---
|
||||
|
||||
For any sets $A_1, A_2, \dots, A_n$:
|
||||
|
||||
$$\left(\bigcup_{i=1}^n A_i\right)^c = \bigcap_{i=1}^n A_i^c$$
|
||||
|
||||
$$\left(\bigcap_{i=1}^n A_i\right)^c = \bigcup_{i=1}^n A_i^c$$
|
||||
|
||||
The complement of a union is the intersection of complements, and vice versa.
|
||||
|
||||
===
|
||||
|
||||
State the Distributive Law for sets $A$, $B$, and $C$
|
||||
---
|
||||
|
||||
$$A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$$
|
||||
|
||||
$$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$
|
||||
|
||||
===
|
||||
|
||||
State the inclusion-exclusion principle for a finite collection of sets $A_1, A_2, A_3, \dots A_n$ where $n=2$
|
||||
|
||||
---
|
||||
|
||||
$n = 2$ case:
|
||||
|
||||
$|A \cup B| = |A| + |B| - |A \cap B|$
|
||||
|
||||
---
|
||||
|
||||
$n = 3$ case:
|
||||
|
||||
$|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|$
|
||||
|
||||
---
|
||||
|
||||
For a finite collection of sets $A_1, A_2, A_3, \dots A_n$, we have
|
||||
|
||||
$\left| \bigcup_{i=1}^n A_i \right| = \sum_{i=1}^n |A_i| - \sum_{i < j} |A_i \cap A_j| + \sum_{i < j < k} |A_i \cap A_j \cap A_k| - \dots + (-1)^{n-1} |A_1 \cap A_2 \cap \dots \cap A_n|$
|
||||
|
||||
===
|
||||
|
||||
For the function
|
||||
|
||||
$$f: A \to B$$
|
||||
|
||||
State the following of $f$:
|
||||
|
||||
1. Domain
|
||||
2. Co-domain
|
||||
3. Range
|
||||
|
||||
---
|
||||
|
||||
1. $A$
|
||||
2. $B$
|
||||
3. Set of all possible outputs of $f$ (not necessarily $B$)
|
||||
|
||||
===
|
||||
|
||||
State definition for each the following:
|
||||
|
||||
1. Random experiment
|
||||
2. Outcome
|
||||
3. Sample space
|
||||
4. Event
|
||||
|
||||
---
|
||||
|
||||
1. A **random experiment** is a process by which we observe something uncertain
|
||||
2. An **outcome** is a result of a random experiment
|
||||
3. The **sample space** $S$ is the set of all possible outcomes
|
||||
4. An **event** is a subset of the sample space
|
||||
|
||||
===
|
||||
|
||||
State the Axioms of Probability
|
||||
|
||||
---
|
||||
**Axioms of Probability**
|
||||
|
||||
1. For any event $A$, $P(A) \geq 0$
|
||||
2. $P(S) = 1$
|
||||
3. If $A_1, A_2, A_3, \dots$ are disjoint events, then $P(A_1 \cup A_2 \cup A_3 \cup \dots) = P(A_1) + P(A_2) + P(A_3) + \dots$
|
||||
|
||||
===
|
||||
|
||||
In a finite sample space $S$, where all outcomes are equally likely, what is the probability of any event $A$?
|
||||
|
||||
---
|
||||
|
||||
$P(A) = \frac{|A|}{|S|}$
|
||||
|
||||
===
|
||||
|
||||
What is $P(A^c)$ in terms of $P(A)$?
|
||||
---
|
||||
|
||||
$$P(A^c) = 1 - P(A)$$
|
||||
|
||||
Follows from the axioms: $A$ and $A^c$ are disjoint, and $A \cup A^c = S$, so $P(A) + P(A^c) = P(S) = 1$.
|
||||
|
||||
===
|
||||
|
||||
Define conditional probability $P(A|B)$
|
||||
---
|
||||
|
||||
The probability of $A$ given $B$ (when $P(B) > 0$):
|
||||
|
||||
$$P(A|B) = \frac{P(A \cap B)}{P(B)}$$
|
||||
|
||||
In the equally-likely case:
|
||||
|
||||
$$P(A|B) = \frac{|A \cap B|}{|B|}$$
|
||||
|
||||
===
|
||||
|
||||
State the chain rule of probability for $n$ events
|
||||
---
|
||||
|
||||
$$P(A_1 \cap A_2 \cap \cdots \cap A_n) = P(A_1)\,P(A_2|A_1)\,P(A_3|A_1,A_2)\cdots P(A_n|A_1,A_2,\dots,A_{n-1})$$
|
||||
|
||||
Each factor conditions on all previously listed events.
|
||||
|
||||
===
|
||||
|
||||
What conditions must hold for three events $A$, $B$, $C$ to be independent?
|
||||
---
|
||||
|
||||
All four conditions must hold:
|
||||
|
||||
1. $P(A \cap B) = P(A)P(B)$
|
||||
2. $P(A \cap C) = P(A)P(C)$
|
||||
3. $P(B \cap C) = P(B)P(C)$
|
||||
4. $P(A \cap B \cap C) = P(A)P(B)P(C)$
|
||||
|
||||
Pairwise independence alone is **not** sufficient.
|
||||
|
||||
===
|
||||
|
||||
What does it mean for $n$ events $A_1, A_2, \dots, A_n$ to be independent?
|
||||
---
|
||||
|
||||
Every subset of the events must satisfy the product rule. That is, for all $i < j < k < \dots$:
|
||||
|
||||
$$P(A_i \cap A_j) = P(A_i)P(A_j)$$
|
||||
$$P(A_i \cap A_j \cap A_k) = P(A_i)P(A_j)P(A_k)$$
|
||||
$$\vdots$$
|
||||
$$P(A_1 \cap A_2 \cap \cdots \cap A_n) = \prod_{i=1}^n P(A_i)$$
|
||||
|
||||
===
|
||||
|
||||
If $A_1, A_2, \dots, A_n$ are independent, what is $P(A_1 \cup A_2 \cup \cdots \cup A_n)$?
|
||||
---
|
||||
|
||||
$$P(A_1 \cup A_2 \cup \cdots \cup A_n) = 1 - \prod_{i=1}^n (1 - P(A_i))$$
|
||||
|
||||
Derived by taking the complement (none of the events occur) and using independence.
|
||||
|
||||
===
|
||||
|
||||
What is the difference between disjoint and independent?
|
||||
|
||||
---
|
||||
|
||||
- Disjoint: $A$ and $B$ cannot occur at the same time. $A \cap B = \empty$
|
||||
- Independent: $A$ does not give any information about $B$
|
||||
|
||||
===
|
||||
|
||||
State the Law of Total Probability using event $B$ and its complement
|
||||
---
|
||||
|
||||
$$P(A) = P(A|B)\,P(B) + P(A|B^c)\,P(B^c)$$
|
||||
|
||||
===
|
||||
|
||||
State the general Law of Total Probability for a partition of the sample space
|
||||
---
|
||||
|
||||
If $B_1, B_2, B_3, \dots$ is a partition of $S$, then for any event $A$:
|
||||
|
||||
$$P(A) = \sum_i P(A \cap B_i) = \sum_i P(A|B_i)\,P(B_i)$$
|
||||
|
||||
===
|
||||
|
||||
State Bayes' Rule for two events $A$ and $B$
|
||||
---
|
||||
|
||||
For $P(A) \neq 0$:
|
||||
|
||||
$$P(B|A) = \frac{P(A|B)\,P(B)}{P(A)}$$
|
||||
|
||||
===
|
||||
|
||||
State Bayes' Rule when $B_1, B_2, \dots$ form a partition of $S$
|
||||
---
|
||||
|
||||
For any event $A$ with $P(A) \neq 0$:
|
||||
|
||||
$$P(B_j|A) = \frac{P(A|B_j)\,P(B_j)}{\displaystyle\sum_i P(A|B_i)\,P(B_i)}$$
|
||||
|
||||
The denominator expands $P(A)$ via the Law of Total Probability.
|
||||
|
||||
===
|
||||
|
||||
State the meaning of conditionally independent between events $A$ and $B$ given event $C$. Note $P(C) \gt 0$.
|
||||
|
||||
---
|
||||
|
||||
$$P(A \cap B \mid C) = P(A \mid C)P(B \mid C)$$
|
||||
|
||||
===
|
||||
|
||||
State the multiplication rule for $P(A \cap B)$
|
||||
---
|
||||
|
||||
$$P(A \cap B) = P(A|B)\,P(B) = P(B|A)\,P(A)$$
|
||||
|
||||
Rearrangement of the definition of conditional probability.
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
For any event $A$, prove $P(A^c) = 1 - P(A)$
|
||||
|
||||
---
|
||||
|
||||
$$
|
||||
1 = P(S)
|
||||
= P(A \cup A^c)
|
||||
= P(A) + P(A^c)
|
||||
$$
|
||||
|
||||
===
|
||||
|
||||
Prove $P(A \setminus B) = P(A) - P(A \cap B)$
|
||||
|
||||
---
|
||||
|
||||
TODO
|
||||
+216
@@ -0,0 +1,216 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"id": "206bf674",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import os\n",
|
||||
"import sys\n",
|
||||
"\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"import numpy as np\n",
|
||||
"import pandas as pd\n",
|
||||
"import seaborn as sns\n",
|
||||
"\n",
|
||||
"sns.set_theme(style=\"whitegrid\", context=\"notebook\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "612bd02c",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Chapter 1 Summary Notes"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "be70f5df",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Intro (1.0.0 - 1.3.1)\n",
|
||||
"\n",
|
||||
"**Theorem 1.1: De Morgan's law** \\\n",
|
||||
"For any sets $A_1, A_2, A_3, \\dots A_n$, we have\n",
|
||||
"- $(A_1 \\cup A_2 \\cup A_3 \\cup \\dots A_n)^c = A_1^c \\cap A_2^c \\cap A_3^c \\cap \\dots A_n^c$\n",
|
||||
"- $(A_1 \\cap A_2 \\cap A_3 \\cap \\dots A_n)^c = A_1^c \\cup A_2^c \\cup A_3^c \\cup \\dots A_n^c$\n",
|
||||
"\n",
|
||||
"**Theorem 1.2: Distributive law** \\\n",
|
||||
"For any sets $A, B,$ and $C$ we have\n",
|
||||
"- $A \\cap (B \\cup C) = (A \\cap B)\\cup(A \\cap C)$\n",
|
||||
"- $A \\cup (B \\cap C) = (A \\cup B)\\cap(A \\cup C)$\n",
|
||||
"\n",
|
||||
"**Inclusion-exclusion principle** \\\n",
|
||||
"For a finite collection of sets $A_1, A_2, A_3, \\dots A_n$, we have\n",
|
||||
"\n",
|
||||
"$\\left| \\bigcup_{i=1}^n A_i \\right| = \\sum_{i=1}^n |A_i| - \\sum_{i < j} |A_i \\cap A_j| + \\sum_{i < j < k} |A_i \\cap A_j \\cap A_k| - \\dots + (-1)^{n-1} |A_1 \\cap A_2 \\cap \\dots \\cap A_n|$\n",
|
||||
"\n",
|
||||
"$n = 2$ case:\n",
|
||||
"\n",
|
||||
"$|A \\cup B| = |A| + |B| - |A \\cap B|$\n",
|
||||
"\n",
|
||||
"$n = 3$ case:\n",
|
||||
"\n",
|
||||
"$|A \\cup B \\cup C| = |A| + |B| + |C| - |A \\cap B| - |A \\cap C| - |B \\cap C| + |A \\cap B \\cap C|$\n",
|
||||
"\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c7475d4f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Random experiments (1.3.1 - 1.4)\n",
|
||||
"\n",
|
||||
"- A **random experiment** is a process by which we observe something uncertain\n",
|
||||
"- An **outcome** is a result of a random experiment\n",
|
||||
"- The **sample space** $S$ is the set of all possible outcomes\n",
|
||||
"- An **event** $A$ is any subset of $S$\n",
|
||||
"\n",
|
||||
"> In the context of a random experiment, the sample space is our *universal set*\n",
|
||||
"\n",
|
||||
"**Axioms of Probability**\n",
|
||||
"\n",
|
||||
"1. For any event $A$, $P(A) \\geq 0$\n",
|
||||
"2. $P(S) = 1$\n",
|
||||
"3. If $A_1, A_2, A_3, \\dots$ are disjoint events, then $P(A_1 \\cup A_2 \\cup A_3 \\cup \\dots) = P(A_1) + P(A_2) + P(A_3) + \\dots$\n",
|
||||
"\n",
|
||||
"**Some notation**\n",
|
||||
"\n",
|
||||
"- $P(A \\cap B) = P(A$ and $B) = P(A,B)$\n",
|
||||
"- $P(A \\cup B) = P(A$ or $B)$\n",
|
||||
"\n",
|
||||
"In a finite sample space $S$, where all outcomes are equally likely, the probability of any event $A$ can be found by\n",
|
||||
"\n",
|
||||
"\\begin{align*}\n",
|
||||
"P(A) = \\frac{|A|}{|S|}\n",
|
||||
"\\end{align*}"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "b705ef32",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Conditional probability (1.4.0)\n",
|
||||
"\n",
|
||||
"If $A$ and $B$ are twos events in sample space $S$, then the **conditional probability of $A$ given $B$** is defined as\n",
|
||||
"\n",
|
||||
"\\begin{align*}\n",
|
||||
"P(A|B) = \\frac{P(A \\cap B)}{P(B)}, \\text{when } P(B) > 0\n",
|
||||
"\\end{align*}\n",
|
||||
"\n",
|
||||
"or\n",
|
||||
"\n",
|
||||
"\\begin{align*}\n",
|
||||
"P(A|B) = \\frac{|A \\cap B|}{|B|}, \\text{when } P(B) > 0\n",
|
||||
"\\end{align*}\n",
|
||||
"\n",
|
||||
"For events $A, B,$ and $C$, with $P(C) \\gt 0$, we have\n",
|
||||
"\n",
|
||||
"- $P(A^c|C) = 1 - P(A|C)$\n",
|
||||
"- $P(\\empty|C) = 0$\n",
|
||||
"- $P(A|C) \\leq 1$\n",
|
||||
"- $P(A \\setminus B|C) = P(A|C) - P(A \\cap B|C)$\n",
|
||||
"- $P(A \\cup B|C) = P(A|C) + P(B|C) - P(A \\cap B|C)$\n",
|
||||
"- if $A \\subset B$ then $P(A|C) \\leq P(B|C)$\n",
|
||||
"\n",
|
||||
""
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "188a8fc2",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Independence (1.4.1)\n",
|
||||
"\n",
|
||||
"**Definition.** Two events $A$ and $B$ are *independent* if $P(A \\cap B) = P(A)P(B)$. AKA $P(A|B) = P(A)$\n",
|
||||
"\n",
|
||||
"**Definition.** Three events $A, B,$ and $C$ are independent if **all** of the following conditions hold:\n",
|
||||
"- $P(A \\cap B) = P(A)P(B)$\n",
|
||||
"- $P(A \\cap C) = P(A)P(C)$\n",
|
||||
"- $P(B \\cap C) = P(B)P(C)$\n",
|
||||
"- $P(A \\cap B \\cap C) = P(A)P(B)P(C)$\n",
|
||||
"\n",
|
||||
"**Definition.** $N$ events $A_1, A_2, A_3, \\dots, A_n$ are independent if **all** the following conditions holds:\n",
|
||||
"- $P(A_i \\cap B_j) = P(A_i)P(A_j)$\n",
|
||||
"- $P(A_i \\cap A_j \\cap A_k) = P(A_i)P(A_j)P(A_k)$ where $i \\in [1:n+1]$, $j \\in [i:n+1]$, $k \\in [j:n+1]$\n",
|
||||
"- $\\dots$\n",
|
||||
"- $P(A_1 \\cap A_2 \\cap A_3 \\cap \\dots \\cap A_n) = \\prod_{i=1}^nP(A_i)$\n",
|
||||
"\n",
|
||||
"**Lemma.** \\\n",
|
||||
"If $A$ and $B$ are independent then\n",
|
||||
"- $A$ and $B^c$ are independent\n",
|
||||
"- $A^c$ and $B$ are independent\n",
|
||||
"- $A^c$ and $B^c$ are independent\n",
|
||||
"\n",
|
||||
"**Definition.** If $A_1, A_2, \\dots, A_n$ are independent then\n",
|
||||
"$$P(A_1 \\cup A_2 \\cup \\dots \\cup A_n) = 1 - (1 - P(A_1))(1 - P(A_2))\\dots(1 - P(A_n))$$"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "90cf5b00",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Law of Total Probability (1.4.2)\n",
|
||||
"\n",
|
||||
"$$P(A) = P(A|B)P(B) + P(A|B^c)P(B^c)$$\n",
|
||||
"\n",
|
||||
"**Definition.** Law of Total Probability: \\\n",
|
||||
"If $B_1, B_2, B_3, \\dots $ is a partition of the sample space $S$, then for any event $A$ we have\n",
|
||||
"\n",
|
||||
"$$P(A) = \\sum_i P(A \\cap B_i) = \\sum_i P(A|B_i)P(B_i)$$"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c33df800",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Bayes' Rule (1.4.3)\n",
|
||||
"\n",
|
||||
"**Definition.** Bayes' Rule\n",
|
||||
"\n",
|
||||
"- For any two events $A$ and $B$, where $P(A) \\neq 0$, we have\n",
|
||||
"\n",
|
||||
"$$P(B|A) = \\frac{P(A|B)P(B)}{P(A)}$$\n",
|
||||
"\n",
|
||||
"- If $B_1, B_2, B_3, \\dots$ form a partition of the sample space $S$, and $A$ is any event with $P(A) \\neq 0$, we have\n",
|
||||
"\n",
|
||||
"$$P(B_j|A) = \\frac{P(A|B_j)P(B_j)}{\\sum_i P(A|B_i)P(B_i)}$$"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "849d7c99",
|
||||
"metadata": {},
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "roadmap (3.14.5)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.14.5"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Reference in New Issue
Block a user