Skip to content

Commit 9b2f30f

Browse files
committed
Stochastic Modeling
1 parent 3814f41 commit 9b2f30f

File tree

2 files changed

+188
-0
lines changed

2 files changed

+188
-0
lines changed

myst.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ project:
4040
- title: My Projects
4141
children:
4242
- file: projects/masters-degree-in-data-science.md
43+
children:
44+
- file: projects/masters-degree-in-data-science/stochastic-modeling.md
4345
- title: My Areas
4446
children:
4547
- file: areas/calyx-os.md
@@ -104,3 +106,4 @@ site:
104106
favicon: favicon.ico
105107
logo: logo.png
106108
style: ./style.css
109+
folders: true
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Stochastic Modeling
2+
3+
:::{note} Historical Context
4+
**1654**: Blaise Pascal and Pierre de Fermat
5+
Chevalier de Méré wrote a letter to Pascal, which became the origin of probability theory stemming from gambling problems.
6+
7+
**1932**: Kolmogorov strictly defined probability theory.
8+
:::
9+
10+
## Review of Probability Theory
11+
12+
Modeling of a random experiment involves three key components:
13+
14+
- **Sample space** $\Omega$: the set of possible outcomes
15+
- **Events** $A \subseteq \Omega$: where $\mathcal{A}$ is the set of all measurable events
16+
- **Probability Measure** $\mathbb{P}$: see definition below
17+
18+
### Definition of a Probability Measure
19+
20+
:::{prf:definition} Probability Measure
21+
:label: def-prob-measure
22+
23+
A function $\mathbb{P}: \mathcal{A} \rightarrow \mathbb{R}$ with the following three properties:
24+
25+
**A1)** $0 \le \mathbb{P}(E) \le 1$ for any $E \in \mathcal{A}$
26+
27+
**A2)** $\mathbb{P}(\Omega) = 1$
28+
29+
**A3)** If $E_1, E_2, \dots$ are pairwise disjoint events (i.e., $E_i \cap E_j = \emptyset$ if $i \neq j$), then
30+
31+
$$
32+
\mathbb{P}\left(\bigcup_{i=1}^{\infty} E_i\right) = \sum_{i=1}^{\infty} \mathbb{P}(E_i)
33+
$$ (eq:countable-additivity)
34+
35+
Any function satisfying A1, A2, A3 is called a **Probability Function**. These axioms (A1–A3) are known as the **Kolmogorov Axioms**.
36+
:::
37+
38+
:::{note} Interpretation
39+
- $\mathbb{P}(E) = 0$: almost impossible
40+
- $\mathbb{P}(E) = 1$: almost certain
41+
:::
42+
43+
### Example: Fair Die Tossing
44+
45+
:::{prf:example} Fair Die
46+
:label: ex-fair-die
47+
48+
Consider a fair six-sided die:
49+
50+
- Sample space: $\Omega = \{1, 2, 3, 4, 5, 6\}$
51+
- Event space: $\mathcal{A} = \mathcal{P}(\Omega)$ (power set with $|\mathcal{A}| = |\mathcal{P}(\Omega)| = 2^6$)
52+
- Probability: $\mathbb{P}(\{i\}) = \frac{1}{6}$ for $i=1, \dots, 6$
53+
54+
Let $A = \{2, 4, 6\}$ be the event "roll an even number". Then:
55+
56+
$$
57+
\mathbb{P}(A) \stackrel{\text{A3}}{=} \mathbb{P}(\{2\}) + \mathbb{P}(\{4\}) + \mathbb{P}(\{6\}) = \frac{3}{6} = \frac{1}{2}
58+
$$
59+
60+
This follows the classical probability formula:
61+
62+
$$
63+
\mathbb{P}(A) = \frac{\text{# of favorable outcomes}}{\text{# of all outcomes}}
64+
$$
65+
:::
66+
67+
### Properties of a Probability Measure
68+
69+
:::{prf:proposition} Basic Properties
70+
:label: prop-prob-properties
71+
72+
For any probability measure $\mathbb{P}$ and events $A, B \in \mathcal{A}$:
73+
74+
a) $\mathbb{P}(\emptyset) = 0$
75+
76+
b) $\mathbb{P}(A^c) = 1 - \mathbb{P}(A)$
77+
78+
c) $\mathbb{P}(A \setminus B) = \mathbb{P}(A) - \mathbb{P}(A \cap B)$
79+
80+
d) $\mathbb{P}(A \cup B) = \mathbb{P}(A) + \mathbb{P}(B) - \mathbb{P}(A \cap B)$
81+
82+
e) $\mathbb{P}(A) \le \mathbb{P}(B)$ if $A \subseteq B$
83+
:::
84+
85+
:::{prf:proof}
86+
We prove properties (a) and (b):
87+
88+
**Part (a):**
89+
90+
$$
91+
1 \stackrel{\text{A2}}{=} \mathbb{P}(\Omega) = \mathbb{P}(\Omega \cup \emptyset) \stackrel{\text{A3}}{=} \mathbb{P}(\Omega) + \mathbb{P}(\emptyset) \stackrel{\text{A2}}{=} 1 + \mathbb{P}(\emptyset)
92+
$$
93+
94+
Therefore, $\mathbb{P}(\emptyset) = 0$.
95+
96+
**Part (b):** Since $\Omega = A \cup A^c$ and the events are disjoint, we have:
97+
98+
$$
99+
1 = \mathbb{P}(\Omega) = \mathbb{P}(A) + \mathbb{P}(A^c)
100+
$$
101+
102+
Therefore, $\mathbb{P}(A^c) = 1 - \mathbb{P}(A)$.
103+
104+
The remaining properties follow similarly.
105+
:::
106+
107+
## Conditional Probabilities
108+
109+
Consider events $E, F \in \mathcal{A}$ with $\mathbb{P}(F) > 0$.
110+
111+
**Question:** What is the probability of $E$ if we know that $F$ occurs?
112+
113+
- Relevant cases: $\omega \in F$
114+
- Favorable cases: $\omega \in E \cap F$
115+
116+
:::{prf:definition} Conditional Probability
117+
:label: def-conditional-prob
118+
119+
The **conditional probability** of $E$ given $F$ is defined as:
120+
121+
$$
122+
\mathbb{P}(E|F) = \frac{\mathbb{P}(E \cap F)}{\mathbb{P}(F)}
123+
$$ (eq:conditional-prob)
124+
:::
125+
126+
### Example: Throwing Two Dice
127+
128+
:::{prf:example} Two Dice
129+
:label: ex-two-dice
130+
131+
Sample space: $\Omega = \{(i, j) : i, j = 1, 2, \dots, 6\}$
132+
133+
Let $E$ be the event "sum equals 6". Then $\mathbb{P}(E) = \frac{5}{36}$.
134+
135+
Now assume we know that $F$ = "first toss equals 2". Then:
136+
137+
- $\mathbb{P}(F) = \frac{1}{6}$
138+
- $\mathbb{P}(E \cap F) = \mathbb{P}(\{(2,4)\}) = \frac{1}{36}$
139+
140+
Therefore:
141+
142+
$$
143+
\mathbb{P}(E|F) = \frac{\mathbb{P}(E \cap F)}{\mathbb{P}(F)} = \frac{1/36}{1/6} = \frac{1}{6} \quad \left[ > \frac{5}{36} \right]
144+
$$
145+
146+
Notice that knowing the first die increases the probability of the sum being 6.
147+
:::
148+
149+
:::{important} Multiplication Rule
150+
From the definition of conditional probability, we obtain:
151+
152+
$$
153+
\mathbb{P}(E \cap F) = \mathbb{P}(F) \cdot \mathbb{P}(E|F)
154+
$$ (eq:multiplication-rule)
155+
:::
156+
157+
## Law of Total Probability
158+
159+
:::{prf:theorem} Law of Total Probability (General Form)
160+
:label: thm-total-prob
161+
162+
Let $\{A_1, A_2, \dots, A_n\}$ be a partition of $\Omega$, i.e., $\Omega = A_1 \cup A_2 \cup \dots \cup A_n$ with pairwise disjoint sets.
163+
164+
For any event $E \in \mathcal{A}$:
165+
166+
$$
167+
E = E \cap \Omega = E \cap (A_1 \cup A_2 \cup \dots \cup A_n)
168+
$$
169+
170+
Therefore:
171+
172+
$$
173+
\mathbb{P}(E) \stackrel{\text{A3}}{=} \sum_{i=1}^{n} \mathbb{P}(E \cap A_i) = \sum_{i=1}^{n} \mathbb{P}(E|A_i) \cdot \mathbb{P}(A_i)
174+
$$ (eq:total-prob)
175+
:::
176+
177+
:::{prf:theorem} Simplified Law of Total Probability
178+
:label: thm-total-prob-simple
179+
180+
For any event $A$ with $\mathbb{P}(A) > 0$, we have the partition $\Omega = A \cup A^c$. Thus:
181+
182+
$$
183+
\mathbb{P}(E) = \mathbb{P}(E|A) \cdot \mathbb{P}(A) + \mathbb{P}(E|A^c) \cdot \mathbb{P}(A^c)
184+
$$ (eq:total-prob-simple)
185+
:::

0 commit comments

Comments
 (0)