Skip to content

Commit e2824d1

Browse files
committed
Stochastic Modeling
1 parent 395c8e9 commit e2824d1

File tree

1 file changed

+81
-17
lines changed

1 file changed

+81
-17
lines changed

projects/masters-degree-in-data-science/stochastic-modeling.md

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A **(random) event** is a collection of outcomes - in other words a subset $A \s
2525

2626
:::{prf:example} Sample Spaces and Events
2727
:label: ex-sample-spaces
28+
:class: dropdown
2829

2930
1. **Tossing a die**: $\Omega = \{1, 2, 3, 4, 5, 6\}$
3031
- Event $A = \{2, 4, 6\}$: "toss an even number"
@@ -46,27 +47,28 @@ The following operations on events are fundamental:
4647
- $\bigcap_{i=1}^{\infty} A_i$: all $A_i$
4748
- $\bigcup_{i=1}^{\infty} A_i$: at least one $A_i$
4849

49-
:::{prf:example} Set Operations on Events
50-
:label: ex-set-operations
51-
52-
If $A = \{3, 5, 6\}$ and $B = \{1, 3\}$, then:
53-
- $A \cup B = \{1, 3, 5, 6\}$
54-
- $A \cap B = \{3\}$
55-
- $A^c = \{1, 2, 4\}$
56-
:::
5750

58-
:::{note}
59-
**Remarks:**
51+
#### Remarks
6052

6153
1. If $A \cap B = \emptyset$, we say that $A$ and $B$ are **disjoint**. We often write $A \dot{\cup} B$ to indicate a union of two disjoint events $A, B$.
6254

6355
2. When $A \subseteq B$, event $A$ is said to **imply** event $B$. We then have $A \cap B = A$ and $A \cup B = B$.
6456

6557
3. Note that we have $A \cup A^c = \Omega$ and $A \cap A^c = \emptyset$.
58+
59+
:::{prf:example} Set Operations on Events
60+
:label: ex-set-operations
61+
:class: dropdown
62+
63+
If $A = \{3, 5, 6\}$ and $B = \{1, 3\}$, then:
64+
- $A \cup B = \{1, 3, 5, 6\}$
65+
- $A \cap B = \{3\}$
66+
- $A^c = \{1, 2, 4\}$
6667
:::
6768

6869
:::{exercise} Set Operations with Die Events
6970
:label: ex-die-set-operations
71+
:class: dropdown
7072

7173
A die is tossed. Consider the events:
7274
$$
@@ -78,6 +80,7 @@ Determine the events $B \cap C$, $A \cup B$, $B \cup C$, $C \cap E$, $A^c$, $B \
7880

7981
:::{exercise} Venn Diagrams
8082
:label: ex-venn-diagrams
83+
:class: dropdown
8184

8285
Given two events $A$ and $B$, use a Venn diagram to represent:
8386

@@ -88,6 +91,7 @@ c) $A$ or $B$, but not both
8891

8992
:::{exercise} Coin and Die Sample Space
9093
:label: ex-coin-die
94+
:class: dropdown
9195

9296
A coin and a die are tossed together.
9397

@@ -100,11 +104,11 @@ b) Specify the following events:
100104

101105
### Probability measure
102106

103-
Consider a random experiment with sample space $\Omega$. Recall that we write $\mathcal{A}$ for the set of all possible events $E$. A probability on $\Omega$ is a function which assigns to every event $E \in \mathcal{A}$ a real number $P(E)$ and satisfies the following properties known as the **Axioms of Kolmogorov**:
104-
105-
:::{prf:definition} Probability Measure
107+
:::{prf:definition} Probability Measure - Axioms of Kolmogorov
106108
:label: def-probability-measure
107109

110+
Consider a random experiment with sample space $\Omega$. Recall that we write $\mathcal{A}$ for the set of all possible events $E$. A probability on $\Omega$ is a function which assigns to every event $E \in \mathcal{A}$ a real number $P(E)$ and satisfies the following properties known as the **Axioms of Kolmogorov**:
111+
108112
A **probability measure** on $\Omega$ is a function $P : \mathcal{A} \to \mathbb{R}$ satisfying the following axioms:
109113

110114
**A1)** $0 \leq P(E) \leq 1$ for all events $E \in \mathcal{A}$
@@ -121,8 +125,7 @@ We refer to $P(E)$ as the **probability** of the event $E \in \mathcal{A}$.
121125
Events $E \in \mathcal{A}$ with $P(E) = 0$ are called **almost impossible**, events $E \in \mathcal{A}$ with $P(E) = 1$ are called **almost certain**.
122126
:::
123127

124-
:::{note}
125-
**Remarks:**
128+
#### Remarks
126129

127130
1. **(Summation rule)** If in Axiom A3) we choose a finite sequence of disjoint events, say $E_1, E_2$ and $E_3$, we can simply set $E_i = \emptyset$ for all $i \geq 4$ to obtain
128131
$$
@@ -135,10 +138,10 @@ Events $E \in \mathcal{A}$ with $P(E) = 0$ are called **almost impossible**, eve
135138
P(A) = \frac{k}{n} = \frac{\text{number of good outcomes}}{\text{total number of possible outcomes}} = \frac{|A|}{|\Omega|}
136139
$$
137140
We refer to such a $P$ as the **uniform probability measure** on the sample space $\Omega$.
138-
:::
139141

140142
:::{prf:example} Fair Die Probabilities
141143
:label: ex-fair-die
144+
:class: dropdown
142145

143146
In the die tossing example, if all six numbers are equally likely, we have
144147
$$
@@ -167,12 +170,61 @@ Let $A, B \subseteq \Omega$ be events and $P$ a probability measure on $\Omega$.
167170

168171
:::{exercise} Prove Basic Properties
169172
:label: ex-prove-properties
173+
:class: dropdown
174+
175+
Prove of [](#prop-probability-properties):
176+
177+
**a) $P(\varnothing)=0$**
178+
179+
For a probability measure $P$ on $\Omega$, $P(\varnothing) = 0.$
180+
181+
The sets $\Omega$ and $\varnothing$ are disjoint and $\Omega = \Omega \cup \varnothing.$
182+
183+
By A3 applied to these two sets, $P(\Omega) = P(\Omega \cup \varnothing)
184+
= P(\Omega) + P(\varnothing).$
185+
186+
Subtracting $P(\Omega)$ from both sides gives $0 = P(\varnothing)$
187+
188+
**b) $P(A^c) = 1 - P(A)$**
189+
190+
For every event $A \subseteq \Omega$, $P(A^{c}) = 1 - P(A).$
191+
192+
The sets $A$ and $A^{c}$ are disjoint and their union is the whole sample space: $\Omega = A \cup A^{c}, \qquad A \cap A^{c} = \varnothing.$
193+
194+
Using A3 for these two disjoint sets, $P(\Omega) = P(A \cup A^{c}) = P(A) + P(A^{c})$
195+
196+
By A2, $P(\Omega) = 1$, so $1 = P(A) + P(A^{c}) \quad\Rightarrow\quad P(A^{c}) = 1 - P(A)$
197+
198+
**c) $P(A\setminus B) = P(A) - P(A\cap B)$**
199+
For all events $A,B \subseteq \Omega$, $P(A \setminus B) = P(A) - P(A \cap B).$
200+
201+
Inside $A$, split into two disjoint parts: $A = (A \setminus B) \cup (A \cap B)$, and $(A \setminus B) \cap (A \cap B) = \varnothing$.
202+
203+
Applying A3 to these two disjoint sets, $P(A) = P(A \setminus B) + P(A \cap B)$
204+
205+
Rearranging gives $P(A \setminus B) = P(A) - P(A \cap B)$
206+
207+
**d) $P(A\cup B) = P(A)+P(B)-P(A\cap B)$**
208+
209+
For all events $A,B \subseteq \Omega$, $P(A \cup B) = P(A) + P(B) - P(A \cap B)$
210+
211+
Decompose the union into disjoint parts: $A \cup B = (A \setminus B) \cup B$, with $(A \setminus B) \cap B = \varnothing$.
212+
213+
By A3, $P(A \cup B) = P(A \setminus B) + P(B)$. Using the result from (c), $P(A \setminus B) = P(A) - P(A \cap B)$ so $P(A \cup B) = \bigl(P(A) - P(A \cap B)\bigr) + P(B) = P(A) + P(B) - P(A \cap B)$.
214+
215+
**e) If $A\subseteq B$ then $P(A)\le P(B)$**
216+
If $A,B \subseteq \Omega$ with $A \subseteq B$, then $P(A) \le P(B)$
217+
218+
If $A \subseteq B$, then $B$ can be written as the disjoint union $B = A \cup (B \setminus A)$, with $A \cap (B \setminus A) = \varnothing$.
219+
220+
By A3, $P(B) = P(A) + P(B \setminus A)$.
170221

171-
Prove [](#prop-probability-properties).
222+
By A1, $P(B \setminus A) \ge 0$, so $P(B) \ge P(A)$, which is equivalent to $P(A) \le P(B)$.
172223
:::
173224

174225
:::{prf:example} Two Fair Coins
175226
:label: ex-two-coins
227+
:class: dropdown
176228

177229
Suppose that we toss two fair coins, so that each of the four outcomes in the sample space
178230
$$
@@ -196,12 +248,14 @@ $$
196248

197249
:::{exercise} Unfair Die
198250
:label: ex-unfair-die
251+
:class: dropdown
199252

200253
Construct a sample space $\Omega$ and probability measure $P$ to model an unfair die in which faces $1-5$ are equally likely, but face 6 has probability $\frac{1}{3}$. Using this model, compute the probability that a toss results in a face showing an even number of dots.
201254
:::
202255

203256
:::{prf:example} Probability Measure Construction
204257
:label: ex-probability-construction
258+
:class: dropdown
205259

206260
The foregoing exercise follows a typical modeling schema: First, select a suitable sample space $\Omega$, second, define $P(A)$ for all events $A$. For example if $\Omega$ is finite and all outcomes are equally likely we usually take $P(A) = \frac{|A|}{|\Omega|}$. If it is not the case that all outcomes are equally likely, then $P(A)$ would be given by some other formula.
207261

@@ -217,6 +271,7 @@ This is a well defined probability measure on $\Omega$. Analogously, one can con
217271

218272
:::{prf:example} Two Dice Conditional Probability
219273
:label: ex-two-dice-conditional
274+
:class: dropdown
220275

221276
We toss two fair dice. Each of the 36 possible outcomes in $\Omega$ is equally likely to occur and hence has probability $\frac{1}{36}$. Now suppose that we observe that the first die is a four. Then given this information, what is the probability that the sum of the two dice equals six?
222277

@@ -245,6 +300,7 @@ Note that $P(\cdot|F)$ is itself a probability measure in the first argument, ca
245300

246301
:::{prf:example} Family with Two Children
247302
:label: ex-two-children
303+
:class: dropdown
248304

249305
A family has two children. What is the conditional probability that both are boys given that at least one of them is a boy?
250306

@@ -258,6 +314,7 @@ $$
258314

259315
:::{prf:example} Drawing Balls from an Urn
260316
:label: ex-urn-balls
317+
:class: dropdown
261318

262319
Suppose an urn contains seven black and five white balls. We draw two balls from the urn without replacement. Assuming that each ball in the urn is equally likely to be drawn, what is the probability that both drawn balls are black?
263320

@@ -271,6 +328,7 @@ In the preceding display, we have used that $P(E \cap F) = P(F) P(E|F)$. This ru
271328

272329
:::{exercise} Multiplication Rule for Three Events
273330
:label: ex-multiplication-three
331+
:class: dropdown
274332

275333
Show that for any three events $A, B, C \subseteq \Omega$ such that $P(A \cap B) > 0$ we have
276334
$$
@@ -304,6 +362,7 @@ $$
304362

305363
:::{prf:example} Genetic Anomaly and Stomach Cancer
306364
:label: ex-stomach-cancer
365+
:class: dropdown
307366

308367
It is suspected that stomach cancer develops with probability $p$ if some specific genetic anomaly is given. In absence of this anomaly stomach cancer develops with probability $q < p$.
309368

@@ -338,6 +397,7 @@ $$
338397

339398
:::{prf:example} Bayes' Rule Application
340399
:label: ex-bayes-stomach-cancer
400+
:class: dropdown
341401

342402
In the context of [](#ex-stomach-cancer), calculate the probability that a person with stomach cancer shows the genetic anomaly.
343403

@@ -349,6 +409,7 @@ $$
349409

350410
:::{exercise} Overloaded Cell System
351411
:label: ex-overloaded-cell
412+
:class: dropdown
352413

353414
The probability that a cell in a wireless system is overloaded is $\frac{1}{3}$. Given that it is overloaded, the probability of a blocked call is 0.3. Given that it is not overloaded, the probability of a blocked call is 0.1. Find the conditional probability that the system is overloaded given that your call is blocked.
354415

@@ -357,6 +418,7 @@ The probability that a cell in a wireless system is overloaded is $\frac{1}{3}$.
357418

358419
:::{exercise} Autopilot Failure
359420
:label: ex-autopilot
421+
:class: dropdown
360422

361423
A certain aircraft's autopilot has conditional probability $\frac{1}{3}$ of failure given that it employs a faulty microprocessor chip. The autopilot has conditional probability $\frac{1}{10}$ of failure given that it employs a nonfaulty chip. According to the chip manufacturer, the probability that a customer receives a faulty chip is $\frac{1}{4}$. Given that an autopilot failure has occurred, find the conditional probability that a faulty chip was used.
362424

@@ -369,6 +431,7 @@ $$
369431

370432
:::{exercise} Internet Packet Routing
371433
:label: ex-packet-routing
434+
:class: dropdown
372435

373436
Due to an Internet configuration error, packets sent from Zurich to Lausanne are routed through Bellinzona with probability 3/4. Given that the packet is routed through Bellinzona, suppose it has conditional probability 1/3 of being dropped. Given that a packet is not routed through Bellinzona, suppose it has conditional probability 1/4 of being dropped.
374437

@@ -378,6 +441,7 @@ b) Can you find the conditional probability that a packet is routed through Bell
378441

379442
:::{prf:example} The Monty Hall Problem
380443
:label: ex-monty-hall
444+
:class: dropdown
381445

382446
In a game show, a contestant is told the rules as follows: There are three doors, labelled 1, 2, 3. A single prize is hidden behind one of them. You get to select one door. Initially your chosen door will not be opened. Instead, the gameshow host will open one of the two other doors, and he will do so in such a way as not to reveal the prize.
383447

0 commit comments

Comments
 (0)