Docsity

Probability and Stochastic Calculus with Exercises, Dispense di Stocastica

Toggle sidebar
bg1
Probability & Stochastic Calculus
Complete theory handout — every lecture explained from scratch,
with 5 worked exercises from the course materials after each session
Course 10218 · MaFinRisk · Bocconi University
Based on the slides L1–L11 (Probability), the handwritten Lectures 1–12 and the lecture notes Stochastic Calculus (De
Donno & Callegaro)
Exam: 21 December 2026 · 2 hours · open book
Probability & Stochastic Calculus — Complete Theory Handout MaFinRisk 10218
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Anteprima parziale del testo

Scarica Probability and Stochastic Calculus with Exercises e più Dispense in PDF di Stocastica solo su Docsity!

Probability & Stochastic Calculus

Complete theory handout — every lecture explained from scratch,

with 5 worked exercises from the course materials after each session

Course 10218 · MaFinRisk · Bocconi University

Based on the slides L1–L11 (Probability), the handwritten Lectures 1–12 and the lecture notes Stochastic Calculus (De

Donno & Callegaro) Exam: 21 December 2026 · 2 hours · open book

Contents

  • How to use this handout
  • Part I — Probability
  • Session 1 · Probability spaces and the axioms (L1)
  • Session 2 · Properties of probability, counting, first look at conditioning (L2)
  • Session 3 · Conditional probability, Bayes, independence (L3)
  • Session 4 · Random variables, distribution function, expectation and variance (L4)
  • Session 5 · Bernoulli, binomial and Poisson random variables (L5)
  • Session 6 · Discrete random vectors, independence, conditional distributions (L6)
  • Session 7 · Continuous random variables: density, mgf, exponential, uniform, normal (L7–L8)
  • Session 8 · Normal computations, continuous random vectors, covariance (L9)
  • Session 9 · Covariance, variance of sums, correlation, mgf of random vectors (L10)
  • Session 10 · Gaussian vectors and limit theorems (L11)
  • Part II — Stochastic Calculus
  • Session 11 · Conditional expectation and change of measure (Lecture 1)
  • Session 12 · Stochastic processes and filtrations (Lecture 2)
  • Session 13 · Discrete-time martingales (Lecture 3)
  • Session 14 · Continuous-time processes, Poisson process, Brownian motion (Lecture 4)
  • Session 15 · The Markov property (Lecture 5)
  • Session 16 · First-order and quadratic variation (Lecture 6)
  • Session 17 · The Itô integral and Itô processes (Lecture 7)
  • Session 18 · Itô’s formula (Lecture 8)
  • Session 19 · Multidimensional Itô calculus (Lecture 9)
  • Session 20 · Girsanov’s theorem (Lecture 10)
  • Session 21 · Stochastic differential equations (Lecture 11)
  • Session 22 · Infinitesimal generator and Feynman–Kac (Lecture 12)

Part I — Probability

Sessions 1–10 · slides L1–L

Session 1 · Probability spaces and the axioms (L1)

1.1 Why probability, and three ways to define it

Finance is about uncertainty : tomorrow’s price, the default time of a firm, the number of claims an insurer receives. Probability is the mathematical language for uncertainty. The slides start with three historical definitions of “the probability of an event ”:

  1. Classical (Laplace). If an experiment has finitely many outcomes and they are all equally likely ,

Example: a fair die, , so. Limit: it needs equally likely outcomes and a finite number of them.

  1. Frequentist. Repeat the experiment times and let be the number of times occurs. Then . Limit: it needs infinitely many repetitions under identical conditions. (We will prove that the relative frequency converges: it is the Law of Large Numbers, Session 10.)
  2. Subjective (de Finetti). is the price you would pay for a bet that pays 1 if occurs and 0 otherwise. Prices must be coherent : no system of bets may give a sure gain.

All three share three features: ; a sure event has probability 1; if and cannot happen together,

. Kolmogorov (1933) turned exactly these three features into axioms. Modern probability is built on them.

1.2 Sample space and events

Definition (sample space) The sample space is the set of all possible outcomes of the experiment.

Examples: flipping a coin twice, ; the default time of a firm,.

An event is a subset of (“something that may or may not happen”). We need to say which subsets we are allowed to talk about, and the collection must be stable under the usual logical operations. This is a σ-algebra.

Definition (σ-algebra, measurable space) A family of subsets of is a σ-algebra if

  1. ;
  2. (closed under complement);
  3. (closed under countable unions). The pair is a measurable space ; the elements of are the events.

Consequences: , and by De Morgan (below) is also closed under countable intersections. An algebra is the same thing with finite unions only; when is finite the two notions coincide, which is why the exercise sheets say “algebra”.

Intuition: a σ-algebra is a level of information Think of as “the questions you can answer”. If you only know whether happened, nothing more. The biggest σ-algebra is the power set (you know everything); the smallest is (you know nothing). This idea becomes central in Stochastic Calculus, where σ-algebras that grow with time model the information we gain as time passes.

The σ-algebra generated by some events. Given events , is the smallest σ-algebra containing them. On a finite there is a mechanical recipe:

E

P( E ) =.

number of possible outcomes

number of outcomes in E

E = {even} = {2, 4, 6} P( E ) = 3/6 = 1/

n n ( E ) E P( E ) = lim (^) n →∞ n ( E )/ n

P( E ) E

0 ≤ P( E ) ≤ 1 E F P( E ∪ F ) =

P( E ) + P( F )

Ω ω

Ω = {( H , H ), ( H , T ), ( T , H ), ( T , T )} Ω = { x : x ≥ 0} = [0, ∞) Ω

F Ω

Ω ∈ F

E ∈ F ⇒ E c^ ∈F E (^) 1 , E (^) 2 , ⋯ ∈F ⇒ ⋃ n E (^) n ∈F (Ω, F) F

∅ = Ω c^ ∈F F Ω

F F = {∅, E , E c^ , Ω} E P(Ω) {∅, Ω}

E (^) 1 , … , Ek σ ( E (^) 1 , … , E (^) k ) Ω

  1. , overlap. Intersections give the atoms , , , . Every singleton is an atom, so the algebra is the whole power set (16 events).

Exercise 1.2 — Exercise sheet Prob 1, Ex. 2

Let. Which of these are algebras? Complete those that are not. (1). (2).

Solution

  1. is an algebra: is the complement of and all unions are already in the list. It is the algebra generated by.
  2. is not an algebra:. Its atoms are , so we must add all missing unions of atoms and complements: , ,. Then we have events.

Exercise 1.3 — Exercise sheet Prob 1, Ex. 3

A die is rolled. (1) Describe. (2) The algebra generated by. (3) The algebra generated by and. (4) The algebra generated by and.

Solution

1..

  1. :.
  2. Atoms: , ,. Algebra:.
  3. is the complement of , and an algebra contains every complement, so the generated algebra is the same as in (3).

Exercise 1.4 — Slides L1 (in-class exercise)

A coin is flipped twice,. Write possible σ-algebras on , starting with the one generated by (head on the first flip).

Solution Generated by : atoms and , so. This is “the information of the first flip”. The trivial σ-algebra (no information). Generated by (“two heads?”):. Generated by both flips: all four singletons are atoms, so we get with events (full information). Note how a bigger σ-algebra = more information:.

Exercise 1.5 — Exercise sheet Prob 1, Ex. 9

Let be events. (1) With , show. (2) Show

. (3) Show by induction that.

Solution

  1. is the disjoint union of and , so by additivity. Using (Session 2, P.5):.
  2. ; rearrange.
  3. The case is (2). Assume it holds for. Apply (2) to the two events and , then the inductive hypothesis:

{∅, { ω (^) 1 , ω (^) 4 }, { ω (^) 2 }, { ω (^) 3 }, { ω (^) 1 , ω (^) 2 , ω (^) 4 }, { ω (^) 1 , ω (^) 3 , ω (^) 4 }, { ω (^) 2 , ω (^) 3 }, Ω}. E = { ω (^) 1 , ω (^) 4 } G = { ω (^) 1 , ω (^) 3 } E ∩ G = { ω (^) 1 } E ∩ G c^ ={ ω (^) 4 } E c^ ∩ G = { ω (^) 3 } E c^ ∩ G c^ ={ ω (^) 2 } P(Ω)

Ω = { ω (^) 1 , … , ω (^) 5 } A 1 ={∅, { ω (^) 1 , ω (^) 4 }, { ω (^) 2 , ω (^) 3 , ω (^) 5 }, Ω} A 2 ={∅, { ω (^) 1 }, { ω (^) 2 }, { ω (^) 3 , ω (^) 4 , ω (^) 5 }, Ω}

A 1 { ω (^) 2 , ω (^) 3 , ω (^) 5 } { ω (^) 1 , ω (^) 4 } { ω (^) 1 , ω (^) 4 } A 2 { ω (^) 1 } ∪ { ω (^) 2 } = { ω (^) 1 , ω (^) 2 } ∈ / A 2 { ω (^) 1 }, { ω (^) 2 }, { ω (^) 3 , ω (^) 4 , ω (^) 5 } { ω (^) 1 , ω (^) 2 }{ ω (^) 1 , ω (^) 3 , ω (^) 4 , ω (^) 5 } { ω (^) 2 , ω (^) 3 , ω (^) 4 , ω (^) 5 } 2 3 = 8

Ω {odd} {odd} {6} {even} {6}

A = {1, 3, 5} {∅, {1, 3, 5}, {2, 4, 6}, Ω}

{even} {odd}

Ω = {( H , H ), ( H , T ), ( T , H ), ( T , T )} Ω

E = {( H , H ), ( H , T )}

E E E c^ ={( T , H ), ( T , T )} σ ( E ) = {∅, E , E c , Ω}

{( H , H )} {∅, {( H , H )}, {( H , T ), ( T , H ), ( T , T )}, Ω}

P(Ω) 2 4 = 16

{∅, Ω} ⊂ σ ( E ) ⊂ P(Ω)

A , B A △ B := ( A ∪ B ) ∖ ( A ∩ B ) P( A △ B ) = P( A ) + P( B ) − 2P( A ∩ B )

P( A ∩ B ) ≥ P( A ) + P( B ) − 1 P( A (^) 1 ∩⋯ ∩ A (^) n ) ≥∑ i^ n =1^ P( A (^) i ) − ( n − 1)

A ∪ B A △ B A ∩ B P( A ∪ B ) = P( A △ B ) + P( A ∩ B ) P( A ∪

B ) = P( A ) + P( B ) − P( A ∩ B ) P( A △ B ) = P( A ) + P( B ) − 2P( A ∩ B )

1 ≥ P( A ∪ B ) = P( A ) + P( B ) − P( A ∩ B )

n = 2 n − 1 A (^) 1 ∩⋯ ∩ An −1 An

P( A ) ≥

i =

n i P(^ A^ )^ + i =

n − i P( A^ n ) −1 ≥^ P( A^ ) − i =

n − i ( n^ − 2) +^ P( A^ n ) −1 =^ P( A^ ) − i =

n i ( n^ − 1).

Session 2 · Properties of probability, counting, first look at conditioning

(L2)

2.1 First consequences of the axioms

Properties P.1–P. P.. P.2 (finite additivity) If are mutually exclusive,. P.3 (complement). P.4 (monotonicity). P.5 (union of two events).

Why P.3: and are disjoint and , so. Why P.4: disjointly, so

. Why P.5: disjointly and. The intersection is subtracted because it was counted twice.

A very useful by-product:.

Inclusion–exclusion Three events:

events: add singles, subtract pairs, add triples, …, with sign for the -fold intersection:

Draw a Venn diagram For “only ”, “ or but not ” and similar questions, draw three circles and fill the 7 regions starting from the centre (the triple intersection) and moving outwards. Each region’s probability is then obtained by subtraction.

2.2 Equally likely outcomes and counting

If and all outcomes are equally likely, then and

So probability becomes counting. The slides use this in the dice, urn and birthday examples; the tools are the following (they are also needed in exam exercise Probability 1).

Counting toolkit Multiplication principle. If a choice is made in stages with options at each stage, there are results. Ordered samples with replacement of size from objects:.

Ordered samples without replacement (arrangements):. In particular orderings (permutations) of objects. Unordered samples without replacement (combinations):

Hypergeometric count. An urn with balls of colour 1 and of colour 2; draw without replacement. The probability of exactly of colour 1 is

P(∅) = 0

E (^) 1 , … , En P( ⋃ i^ n =1^ E (^) i ) = ∑ i^ n =1^ P( E (^) i ) P( E c^ ) =1 − P( E ) E ⊂ F ⇒ P( E ) ≤ P( F ) P( E ∪ F ) = P( E ) + P( F ) − P( E ∩ F )

E Ec^ E ∪ E c^ =Ω P( E ) + P( E c ) =^ P(Ω) = 1 F = E ∪ ( F ∖ E ) P( F ) = P( E ) + P( F ∖ E ) ≥ P( E ) E ∪ F = E ∪ ( F ∖ E ) P( F ∖ E ) = P( F ) − P( E ∩ F )

P( E ∖ F ) = P( E ∩ F c^ ) =P( E ) − P( E ∩ F )

P( E ∪ F ∪ G ) = P( E ) + P( F ) + P( G ) − P( E ∩ F ) − P( E ∩ G ) − P( F ∩ G ) + P( E ∩ F ∩ G ).

n (−1) n −1^ n

P( E ) = i =

n i P( E^ ) − i

∑ (^) i P( E ∩ i < j

∑ (^) i E (^) j ) + P( E ∩ i < j < k

∑ (^) i E (^) j ∩ E (^) k ) − ⋯ + (−1) n −1P( E ). i =

n i

S L I S

Ω = { ω (^) 1 , … , ω (^) N } P({ ω (^) i }) = 1/ N

P( E ) =. #Ω

# E

k n (^) 1 , n (^) 2 , … , nk n (^) 1 n (^) 2 ⋯ nk k n nk

n ( n − 1) ⋯ ( n − k + 1) = ( n − k )!

n! n! n

k

n ) (" n choose k "). k! ( n − k )!

n!

N 1 N 2 k j

( N^^1 + kN^2 )

( Nj^1 )( kN −^2 j^ )

Solution , 36 equally likely outcomes. i. Sum 7: , so. Sum 12: only , so. ii. , :. (Or: .) iii. “At most one 6” is the complement of “two 6s”:. iv. “Exactly one 6” = “at least one” minus “two”:.

Exercise 2.3 — Slides L2 (urn)

An urn contains 6 white and 5 black balls. Three balls are drawn at random (without replacement). What is the probability that 2 are white and 1 is black?

Solution Count unordered samples. Total:. Favourable: choose 2 of the 6 white and 1 of the 5 black:

. So

Check with ordered draws: the colour sequence WWB has probability , and there are 3 positions for the black ball, so. ✓

Exercise 2.4 — Slides L2/L3 (birthday problem)

people are in a room. What is the probability that at least two of them have the same birthday? (365 equally likely days.)

Solution Use the complement “all birthdays different”. Ordered assignment of birthdays: equally likely outcomes. All different: (arrangements). So

For this is : with only 23 people a shared birthday is already more likely than not. (For the probability is 1.)

Exercise 2.5 — Exercise sheet Prob 1, Ex. 6

A tourist visits Rome ( ) with probability 0.8 and Venice ( ) with probability 0.7. (1) Find the minimal probability of visiting both. (2) Now : find the probability of visiting at least one city, (3) none, (4) Rome but not Venice, (5) only one of the two.

Solution

  1. , so. 2..
  2. (De Morgan). 4..
  3. “Only one” :. (Check: .)

Ω = {( i , j ) : 1 ≤ i , j ≤ 6} (1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1) 6/36 = 1/6 (6, 6) 1/ E = {first is 6} F = {second is 6} P( E ∪ F ) = 61 + 61 − 361 = 3611 1 − P(no 6) = 1 − 3625 1 − 361 = 3635

3611 − 361 = 3610 = 185

P = =

n

365 n 365 ⋅ 364 ⋯ (365 − n + 1)

P(at least two share) = 1 − = 365 n

365 ⋅ 364 ⋯ (365 − n + 1) 1 − (1 − i =

n − ). 365

i

n = 23 ≈ 0.507 n > 365

A B

P( A ∩ B ) = 0.

P( A ∪ B ) = 0.8 + 0.7 − P( A ∩ B ) ≤ 1 P( A ∩ B ) ≥ 0.

P( A ∪ B ) = 0.8 + 0.7 − 0.6 = 0.

P( A c^ ∩ B c ) =^ P(( A ∪ B ) ) = c^ 1 − 0.9 = 0. P( A ∩ B c ) =^ P( A ) − P( A ∩ B ) = 0.8 − 0.6 = 0. = ( A ∪ B ) ∖ ( A ∩ B ) 0.9 − 0.6 = 0.3 P( A ∩ B c^ ) +P( A c^ ∩ B ) = 0.2 + 0.1 = 0.

Session 3 · Conditional probability, Bayes, independence (L3)

3.1 The multiplication rule

From the definition,. Applying it repeatedly:

Multiplication rule (chain rule)

If ,

This is how you compute probabilities of sequences (draws without replacement, stages of a game): multiply the probabilities along the path, each one conditional on what happened before.

P(· | F) is itself a probability For fixed with , the map satisfies the three axioms. So every property of Session 2 holds conditionally, e.g. and.

3.2 Law of total probability and Bayes’ formula

Definition (partition) Events form a partition of if they are pairwise disjoint ( for ) and : exactly one of them happens. The simplest partition is.

Law of total probability If is a partition with ,

is a weighted average of the conditional probabilities, with weights.

Why: disjointly, and.

Bayes' formula With a partition and ,

The are hypotheses , the prior probabilities, the posterior probabilities after observing.

When to use which The text gives you probabilities of the effect given the cause ( , ). Total probability gives the probability of the effect; Bayes “reverses” the conditioning to get the probability of the cause given the effect. A tree diagram (first branch: the hypothesis; second branch: the effect) makes both formulas automatic: total probability = sum of the paths that end in ; Bayes = (path through ) / (sum of all paths to ).

Worked example (slides L3): accident-prone policyholders 30% of people are accident-prone ( ); they have an accident within a year with probability 0.4; the others with probability 0.2. Let.

Observing an accident raises the probability of being accident-prone from 30% to 46%.

P( E ∩ F ) = P( F )P( E ∣ F )

P( E (^) 1 ∩⋯ ∩ E (^) n −1 ) > 0 P( E (^) 1 ∩ E (^) 2 ∩⋯ ∩ E (^) n ) = P( E (^) 1 ) P( E (^) 2 ∣ E (^) 1 ) P( E (^) 3 ∣ E (^) 1 ∩ E (^) 2 ) ⋯ P( E (^) n ∣ E (^) 1 ∩⋯ ∩ E (^) n −1).

F P( F ) > 0 E ↦ P( E ∣ F )

P( E c^ ∣ F ) = 1 − P( E ∣ F ) P( E ∪ G ∣ F ) = P( E ∣ F ) + P( G ∣ F ) − P( E ∩ G ∣ F )

F (^) 1 , … , Fn Ω F (^) i ∩ F (^) j =∅ i = j ⋃ i F (^) i =Ω { F , F c }

F (^) 1 , … , Fn P( F (^) i ) > 0

P( E ) = P( F ) P( E ∣ i =

n i F^ i ).^ Two cases:^ P( E ) =P( F^ )P( E^ ∣^ F^ ) +^ P( F^ c )^ P( E^ ∣ F^ c ).

P( E ) P( F (^) i )

E = ⋃ i ( E ∩ F (^) i ) P( E ∩ F (^) i ) = P( F (^) i ) P( E ∣ F (^) i )

F (^) 1 , … , Fn P( E ) > 0

P( F (^) j ∣ E ) =. ∑ i^ n =1^ P( F (^) i ) P( E ∣ F (^) i )

P( F (^) j ) P( E ∣ F (^) j )

Fj P( F (^) j ) P( F (^) j ∣ E ) E

P(accident ∣ risky driver) P(positive test ∣ ill)

E Fj E

A

H = {accident within a year}

P( H ) = 0.3 ⋅ 0.4 + 0.7 ⋅ 0.2 = 0.12 + 0.14 = 0.26, P( A ∣ H ) = =

  1. Total probability:.

  2. Bayes:. 4.. Lesson: with a very rare condition, even a 99%-accurate test gives mostly false positives, because the healthy population is huge.

Exercise 3.3 — Slides L3 / L5 (conditional independence)

Urn 1 has 6 white and 4 black balls; urn 2 has 2 white and 8 black. An urn is chosen at random and two balls are drawn with replacement. Find the probability that the second ball is white given that the first is white.

Solution Let be the urns ( each) and “first/second white”. Given the urn, draws are independent (with replacement): ,. By total probability:

Note : the draws are not independent unconditionally. A white first ball makes urn 1 more likely ( ), which raises the chance of another white.

Exercise 3.4 — Exam 10 Dec 2024, Probability 1 (8 pts) / Recap Ex. 3

A device has 5 components, each working independently with probability ;. Compute (1) ; (2) ; (3) ; (4) the expected number of working components. The device is a bridge : components 1–2 on the upper path, 4–5 on the lower path, component 3 connects the middle of the two paths; it works if some path of working components joins input and output (1–2, 4–5, 1–3–5 or 4–3–2). Let. Compute (5) ; (6) ; (7) ; (8).

Solution

  1. Independence:.
  2. (or ).
  3. The number of working components is (Session 5):
  4. (sum of 5 indicators, each with mean 0.9).
  5. Condition on the bridge component (this is the trick). If 3 works, the left side works if 1 or 4 works, and the right side if 2 or 5 works; the device is “(1 or 4) in series with (2 or 5)”:
  6. If 3 fails, the device is “(1 and 2) in parallel with (4 and 5)”:
  7. Total probability:.
  8. Bayes:.

Exercise 3.5 — Exercise sheet Prob 1, Ex. 19

Bocconi students: 55% Undergraduate ( ), 35% Graduate ( ), 6% Master ( ), 4% PhD ( ). The share of foreign students ( ) is 20%, 30%, 60%, 40% respectively. Find (1) ; (2) ; (3) ; (4) ; (5) .

Solution

  1. Total probability:.

P(+) = 0.0002 ⋅ 0.99 + 0.9998 ⋅ 0.01 = 0.000198 + 0.009998 = 0.

P( M ∣ +) = ≈

P( M c^ ∣+) = 1 − 0.0194 = 0.

U 1 , U 2 P = 1/2 W 1 , W 2

P( W 1 ∩ W 2 ∣ U 1 ) = 0.6^2 P( W 1 ∩ W 2 ∣ U 2 ) =0.2^2

P( W 1 ) = 21 (0.6) + 21 (0.2) =0.4, P( W 1 ∩ W 2 ) = 21 (0.36) + 21 (0.04) =0.2.

P( W 2 ∣ W 1 ) = =

P( W 2 ) =0.4 = 0.5 P( U 1 ∣

W 1 ) = 0.3/0.4 = 0.

p = 0.9 C (^) i ={component i works} P( C (^) 1 ∩ C (^) 2 ) P( C (^) 1 ∪ C (^) 4 ) P(at least 3 of 5 work)

F = {device works} P( F ∣ C (^) 3 ) P( F ∣ C (^) 3^ c )^ P( F ) P( C (^) 3 ∣ F )

P( C 1 ∩ C 2 ) =0.9 2 =0.

P( C 1 ∪ C 4 ) =0.9 + 0.9 − 0.81 = 0.99 1 − 0.1^2

N Bin(5, 0.9)

P( N ≥ 3) = ( 0.9 0.1 + 3

E[ N ] = np = 4.

P( F ∣ C 3 ) =[1 − 0.1 ] [1 −^2 0.1 ] =^2 0.99 2 =0.9801.

P( F ∣ C (^) 3^ c^ ) =1 − (1 − 0.81) 2 =1 − 0.0361 = 0.9639. P( F ) = 0.9 ⋅ 0.9801 + 0.1 ⋅ 0.9639 = 0.88209 + 0.09639 = 0.

P( C (^) 3 ∣ F ) = ≈

E 1 E 2 E 3 E 4

A P( A ) P( E (^) 3 ∣ A ) P( E (^) 3 ∣ A c )^ P( E (^) 3^ c^ ∣ A c )^ P( E (^) 3 ∪ E (^) 4 ∣ A c )

P( A ) = 0.2(0.55) + 0.3(0.35) + 0.6(0.06) + 0.4(0.04) = 0.11 + 0.105 + 0.036 + 0.016 = 0.

  1. Bayes:. 3.. 4..
  2. disjoint: , so the answer is.

P( E 3 ∣ A ) = =

P( E (^) 3 ∣ A c ) =^ = P( A c )

P( A c^ ∣ E (^) 3 )P( E (^) 3 ) ≈

P( E (^) 3^ c^ ∣ A c^ ) =1 − 0.0327 = 0. E (^) 3 , E 4 P( E (^) 4 ∣ A c^ ) = ≈

4.4 Expectation

Definition (expected value, discrete case) If , the expected value (mean) of is

It is the probability-weighted average of the values: the “centre of mass” of the distribution.

Fair die: (not a possible value: the mean need not be attainable).

Expected utility. Faced with “80% lose 500, 20% win 500” versus “lose 280 for sure”, many people choose the gamble even though its expected loss is larger ( ); with gains instead of losses, people choose the sure thing. People do not maximise expected gains but expected utility , e.g. for a risk-averse investor. So we need the expectation of a function of.

Expectation of a function of X (LOTUS) and linearity For a discrete and any function :

You do not need the pmf of. Consequences: and.

4.5 Variance and standard deviation

, and (each with probability ) all have mean 0 but very different spreads. The variance measures the average squared distance from the mean.

Definition (variance, moments, standard deviation)

is the -th moment ; the variance is the second centred moment; is the standard deviation.

Proof of the shortcut: expand and use linearity:.

Properties of the variance

, and iff is a.s. constant. : shifting does not change the spread; scaling by multiplies it by. Standardisation: has ,.

Exercises for Session 4

Exercise 4.1 — Slides L4 (investment) Today we invest 100 euro. Tomorrow the value halves with probability , stays the same with probability , or doubles with probability. Find and the expected value of the investment tomorrow.

Solution The probabilities must sum to 1:. Tomorrow’s value takes the values 50, 100, 200 with probabilities :

∑ i ∣ x (^) i ∣ p ( x (^) i ) <∞ X E( X ) = x p ( x ). i

∑ (^) i i

E( X ) = 1+2+3+4+5+6 6 =3.

E[ U (gain)] U ( x ) = log x X

X g

E[ g ( X )] = g ( x ) p ( x ). i

∑ (^) i i

g ( X ) E( aX + b ) = a E( X ) + b E[ f ( X ) + g ( X )] = E[ f ( X )] + E[ g ( X )]

X ≡ 0 Y = ±1 Z = ±100 1/

Var( X ) = E[( X − E X ) 2 ]^ =E( X^2 ) −[E( X )].^2 E( X n )^ n σ (^) X = Var( X )

( X − μ ) 2 = X^2 − 2 μX + μ^2 E X^2 − 2 μ^2 + μ^2

Var( X ) ≥ 0 Var( X ) = 0 X Var( aX + b ) = a^2 Var( X ) a a^2 Z = σX

X − E X

E Z = 0 Var Z = 1

p p 2 p p

p + p + 2 p = 1 ⇒ p = 41 V 41 ,^41 , 21 E( V ) = 50 ⋅ 41 +100 ⋅ 41 +200 ⋅ 21 =12.5 + 25 + 100 = 137.5 euro.

Exercise 4.2 — Exercise sheet Prob 2, Ex. 1 (measurability) with the algebra. Which maps are measurable? (1) on ; (2) on , on , on ; (3) on , on , on ; (4) on , elsewhere; (5).

Solution The atoms of are , ,. A map is measurable iff it is constant on each atom.

  1. : not measurable. (E.g. .)
  2. : not measurable ( ).
  3. is constant on each atom: measurable. ( is , , or .)
  4. is constant on each atom: measurable.
  5. A constant is always measurable ( is or ).

Exercise 4.3 — Exercise sheet Prob 2, Ex. 3 for and for , ,. Compute for every.

Solution is constant between integers, so if. At , :

and (same formula). Check with the geometric series ( for ):

. ✓ This is a geometric distribution counting the failures before the first success.

Calculus reminder: geometric series

For : , ,. Differentiating term by term:.

Exercise 4.4 — Exercise sheet Prob 2, Ex. 6 takes the values with probabilities. (1) Find. (2). (3) The CDF. (4) Mean and median ( ). (5) Variance. (6) pmf and mean of.

Solution

1.. So the probabilities are. 2..

  1. for ; on ; on ; on ; for. 4.. Median: for and , so med.
  2. ,.
  3. so : ,. (check: ✓).

Exercise 4.5 — Exercise sheet Prob 2, Ex. 8 Let take values in. Show that.

Solution Write and swap the two sums (all terms are non-negative). The pair ranges over :

Ω = { ω (^) 1 , … , ω (^) 5 } A = {∅, Ω, { ω (^) 5 }, { ω (^) 1 , ω (^) 2 }, { ω (^) 3 , ω (^) 4 }, { ω (^) 1 , ω (^) 2 , ω (^) 3 , ω (^) 4 }, { ω (^) 3 , ω (^) 4 , ω (^) 5 }, { ω (^) 1 , ω (^) 2 , ω (^) 5 }} X = (1, 0, −1, 2, −2) ( ω (^) 1 , … , ω (^) 5 ) Y = −1 { ω (^) 1 , ω (^) 2 } 0 ω 3 2 { ω (^) 4 , ω (^) 5 } Z = 100 { ω (^) 1 , ω (^) 2 } 1 { ω (^) 3 , ω (^) 4 } 0 ω 5 U = 12 { ω (^) 1 , ω (^) 2 } 0 V ≡ 1

A { ω (^) 1 , ω (^) 2 } { ω (^) 3 , ω (^) 4 }{ ω (^) 5 } X ( ω (^) 1 ) = 1 = X ( ω (^) 2 ) = 0 { X ≤ 0} = { ω (^) 2 , ω (^) 3 , ω (^) 5 } ∈ / A Y ( ω (^) 3 ) = 0 = Y ( ω (^) 4 ) = 2 { Y ≤ 0} = { ω (^) 1 , ω (^) 2 , ω (^) 3 } ∈ / A Z { Z ≤ z } ∅ { ω (^) 5 } { ω (^) 3 , ω (^) 4 , ω (^) 5 } Ω U { V ≤ v } ∅ Ω

F ( a ) = 0 a < 0 F ( a ) = 1 − (1 − p ) n +1^ n ≤ a < n + 1 n = 0, 1, 2, … 0 < p < 1 P( X = a ) a ∈ R

F P( X = a ) = F ( a ) − F ( a −) =^0 a ∈/ N n ∈ N n ≥ 1 P( X = n ) = F ( n ) − F ( n − 1) = [1 − (1 − p ) n +1] −^ [1 − (1 − p ) ] = n^ (1 − p ) [1 − n^ (1 − p )] = p (1 − p ) , n P( X = 0) = F (0) − 0 = p ∑ n ≥0 q n^ =1−^1 q ∣ q ∣ < 1 ∑ np (1 − p ) n^ = p ⋅ (^) p^1 = 1

∣ q ∣ < 1 q = n =

∞ n 1 − q

q = n =

N − n 1 − q

1 − qN q = n = m

∞ n 1 − q

qm nq = n ≥

∑ n − (1 − q )^2

X −2, −1, 1, 2 161 , p , 2 p , 163 p P( X ≥ 0 ∣ X > −2) med = inf{ t : F ( t ) ≥ 0.5} Y = X^2 − 1

161 + 163 +^3 p^ = 1 ⇒^ p^ =^41 161 ,^164 ,^168 , 163 P( X ≥ 0 ∣ X > −2) = = 1 − P( X = −2)

P( X ∈ {1, 2})

F ( t ) = 0 t < −2 161 [−2, −1) 165 [−1, 1) 1613 [1, 2) 1 t ≥ 2 E X = − 162 − 164 + 168 + 166 = 21 F ( t ) ≤ 165 < 21 t < 1 F (1) = 1613 ≥ 21 = 1 E X^2 = 164 + 164 + 168 + 1612 = 1628 = 47 Var X = 47 − 41 = 23 X^2 ∈{1, 4} Y ∈ {0, 3} P( Y = 3) = P( X = ±2) = 164 = 41 P( Y = 0) = 43 E Y = 3 ⋅ 41 = 43 E X^2 −1 = 47 −^1

X N = {0, 1, 2, … } E( X ) = ∑ n ∞=1^ P( X ≥ n )

P( X ≥ n ) = ∑ k ≥ n P( X = k ) ( n , k ) 1 ≤ n ≤ k

P( X = n =

∞

k = n

∞ k ) = P( X = k =

∞

n =

k k ) = k P( X = k =

∞ k ) = E( X ).

Session 5 · Bernoulli, binomial and Poisson random variables (L5)

5.1 Bernoulli

Bernoulli(p) An experiment is a success with probability. takes values 1 (success) and 0 (failure):

Why: ; since , and. In particular the mean of an indicator is the probability of its event :. This simple fact is the engine of the “indicator method” (Session 9).

5.2 Binomial

Binomial(n, p)

= number of successes in independent trials, each a success with probability. and

,. Moreover with independent ( = indicator of a success at trial ).

The mean and variance follow from the sum: , and for independent summands variances add, (Session 9).

Recognising a binomial Ask three questions: is there a fixed number of trials? Are they independent? Is the success probability the same each time? If yes, “number of successes” is. Typical exam phrasing: “out of 10 trains / 50 components / 100 measurements, how many …”. Drawing without replacement from a small urn is not binomial (trials are dependent).

5.3 Poisson

Poisson(λ)

with

Calculus reminder: the exponential series

Hence. Mean:. The same trick gives , so.

Law of rare events (Poisson approximation of the binomial) If with and , then for every. In practice: many trials, small success probability, moderate ⇒ the number of successes is approximately.

Sketch with : , using the limit .

p X = (^1) {success} P( X = 1) = p , P( X = 0) = 1 − p , X ∼ Be( p ). E X = p Var X = p (1 − p )

E X = 1 ⋅ p + 0 ⋅ (1 − p ) = p X^2 = X E X^2 = p Var X = p − p^2 E[ (^1) A ] = P( A )

X n p X ∈ {0, 1, … , n }

P( X = k ) = ( p (^) (1 − k

n ) k^ p ) n − k ,^ X ∼Bi( n , p ).

E X = np Var X = np (1 − p ) X = X (^) 1 +⋯ + Xn X (^) i ∼Be( p ) Xi i

E X = ∑ E X (^) i = np Var X = np (1 − p )

n p Bi( n , p )

X ∈ {0, 1, 2, … }

P( X = k ) = e − λ , X ∼ k!

λk Poisson( λ ), λ > 0.

E X = Var X = λ

e x^ = = k =

∞ k!

xk 1 + x + + 2

x^2

6

x^3 … for every x ∈ R.

∑ k e − λλ^ k /^ k! = e − λe^ λ^ = 1 ∑ k ≥1 k e − λ^ λk !=

k λe − λ^ ∑ k ≥1 ( k^ λ −1)!=

k − λe − λ^ e λ^ = λ E[ X ( X − 1)] = λ^2 Var X = λ^2 + λ − λ^2 = λ

X (^) n ∼Bi( n , p (^) n ) p (^) n → 0 np (^) n → λ P( X (^) n = k ) → e − λλ^ k /^ k! k np Poisson( λ = np )

p (^) n = λ / n ( kn )( (^) nλ^ ) (1 − k nλ^ )^ =

n − k (^) ⋅ k! λk ⋅ nk

n ( n −1)⋯( n − k +1) (^) (1 − ) (1 − n λ n^ ) → n λ − k^ ⋅ k! λk 1 ⋅ e − λ (^) ⋅ 1 (1 +

x / n ) n^ → ex

Poisson variables model counts of rare events in a period: calls per minute, defects per metre of tape, insurance claims per month, defaults, jumps of a stock price. Key property : if counts in disjoint periods are independent and the count in a period of length is , we have a Poisson process (Session 14); and the sum of independent Poissons is Poisson with the sum of the parameters.

5.4 Geometric (from the exercise sheets)

Geometric(p) = trial of the first success in independent trials: , Then (the first trials fail), , and it is memoryless :.

Exercises for Session 5

Exercise 5.1 — Slides L5, Ex. 1 (multiple choice) An exam has 10 questions with 4 answers each (one correct). For each question independently, the student knows the answer with probability ; otherwise he guesses at random. Compute (a) the probability of at least 9 correct answers; (b) the mean and variance of the number of correct answers.

Solution By total probability, a single answer is correct with probability

Questions are independent, so. a.. (E.g. : and .) b. ,^.

Exercise 5.2 — Slides L5, Ex. 3 (surgeons) Dr. Black does 50 heart surgeries a year with 3% unsuccessful; Dr. Fisher does 100 with 1% unsuccessful. (1) Probability that a surgery at the hospital is unsuccessful. (2) Probability that an unsuccessful surgery was done by Black. (3) Black did 10 surgeries in a day: probability that at least one is unsuccessful. (4) Black did 100 surgeries in two years: compare mean and variance of the number of failures under the binomial and the Poisson approximation.

Solution A random surgery is Black’s with probability and Fisher’s with. Let = unsuccessful.

1.. 2..

  1. Failures in 10 independent surgeries:.
  2. : ,. Poisson approximation :. Same mean, the variance differs only by the factor : the approximation is good because is small.

Exercise 5.3 — Exercise sheet Prob 2, Ex. 9 An asset goes up each day with probability , independently. = first day it goes up. (1) pmf of. (2) Probability it goes up at least once in 10 days. (3) Same, given no increase in the first 3 days. (4) = number of ups in 10 days; show

. (5) Probability of at least two ups in 10 days. (6) Average number of ups in 10 days.

Solution

  1. , : geometric with. 2..
  2. Memoryless:.
  3. and : both mean “no up in 10 days”. 5..

t Poisson( λt )

T Be( p ) P( T = k ) = (1 − p ) k −1 p^ k = 1, 2, … P( T > n ) = (1 − p ) n^ n E T = 1/ p P( T > n + k ∣ T > n ) = P( T > k )

p

q = P(correct) = p ⋅ 1 + (1 − p ) ⋅ 41 =. 4

1 + 3 p

N ∼ Bi(10, q ) P( N ≥ 9) = ( 109 ) q^9 (1 −^ q ) + q^10 = 10 q^9 (1 − q ) + q^10 p = 0.5 q = 0.625 P ≈ 0. E N = 10 q = 10(1+3 4 p )^ Var N = 10 q (1 − q ) = 10 ⋅ 1+3 4 p ⋅3(1− 4 p )

15050 = 31 32 U

P( U ) = 31 (0.03) + 32 (0.01) =0.01 + 0.00 6 = 601 ≈0.

P(Black ∣ U ) = = 1/

P(≥ 1) = 1 − 0.97 10 ≈1 − 0.7374 = 0.

N ∼ Bi(100, 0.03) E N = 3 Var N = 100(0.03)(0.97) = 2.91 Poisson(3) E = Var = 3 1 − p = 0.97 ≈ 1 p

3

1 T T

N P( N =

0) = P( T > 10)

P( T = k ) = (2/3) k −1(1/3)^ k ≥ 1 p = 31 P( T ≤ 10) = 1 − P( T > 10) = 1 − (2/3) 10 =1 − 0.0173 = 0. P( T ≤ 10 ∣ T > 3) = 1 − P( T > 10 ∣ T > 3) = 1 − P( T > 7) = 1 − (2/3) 7 =1 − 0.0585 = 0. N ∼ Bi(10, 31 ) P( N = 0) = (2/3) 10 =P( T > 10) P( N ≥ 2) = 1 − (2/3) 10 −10 ⋅ 31 (2/3) 9 =1 − 0.0173 − 0.0867 = 0.