Introduction
1 Probability Space
The Formal Definition is found at Probability Space
1.1 Definition
A probability space is a triplet P=(Ω,F,μ) with:
- Ω is the universe.
- F⊆P(Ω) is the set of all events.
- μ:F→[0,1] is a probability function that assigns a probability to each event.
We define the probability of an event A∈F as follow:
P(A)=μ(A) 1.2 Example: Dice Game
You are playing a dice game with your friend, at each turn are throwing two dices; one at a time.
We will assume that both dices are fair, you want to calculate the probability that you get i on the first dice and j on the second dice for each i,j∈{1,2,3,4,5,6}
Solution
We will first create a mathematical model for this problem.
Let Ω={1,2,3,4,5,6}×{1,2,3,4,5,6}.
Let F=P(Ω)={A/A⊆Ω}.
Let μ:F→[0,1] defined simply by μ(A)=∣Ω∣∣A∣. The choice of such μ is justified as both dices are fair.
Let Ai be the event: The first dice has the value i.
Let Bj the event: The second dice has the value j.
Let Ci,j be the event: The first dice has the value i, and the second dice has the value j.
Mathematically, Ci,j=Ai∩Bj={(i,j)}, its probability is:
P(Ci,j)=∣Ω∣∣Ci,j∣=361 2. Random Variable
The Formal Definition is found at Random Variable
2.1 Definition
A random variable is a function X:Ω→S.
In some sense, the probability that X∈A from some A⊆S is defined as:
μ(X−1(A)) 2.2 Example: Dice Game 2
After throwing both dices, one of the following will happen:
If the sum of the two dices is a prime number p, you will go forward by p
Else, it is a composite number n, you will go backward by p where p is the biggest prime divisor of n
Let X be the random variable denoting the signed value of the steps that will be taken.
We will generate a table of values of possible sums each with its corresponding step:
| 1 | 2 | 3 | 4 | 5 | 6 |
---|
1 | Sum is 2, Step is 2 | Sum is 3, Step is 3 | Sum is 4, Step is −2 | Sum is 5, Step is 5 | Sum is 6, Step is −3 | Sum is 7, Step is 7 |
2 | Sum is 3, Step is 3 | Sum is 4, Step is −2 | Sum is 5, Step is 5 | Sum is 6, Step is −3 | Sum is 7, Step is 7 | Sum is 8, Step is −2 |
3 | Sum is 4, Step is −2 | Sum is 5, Step is 5 | Sum is 6, Step is −3 | Sum is 7, Step is 7 | Sum is 8, Step is −2 | Sum is 9, Step is −3 |
4 | Sum is 5, Step is 5 | Sum is 6, Step is −3 | Sum is 7, Step is 7 | Sum is 8, Step is −2 | Sum is 9, Step is −3 | Sum is 10, Step is −5 |
5 | Sum is 6, Step is −3 | Sum is 7, Step is 7 | Sum is 8, Step is −2 | Sum is 9, Step is −3 | Sum is 10, Step is −5 | Sum is 11, Step is 11 |
6 | Sum is 7, Step is 7 | Sum is 8, Step is −2 | Sum is 9, Step is −3 | Sum is 10, Step is −5 | Sum is 11, Step is 11 | Sum is 12, Step is −3 |
We have:
- X−1(2)={(1,1)}
- X−1(3)={(1,2),(2,1)}
- X−1(5)={(1,4),(2,3),(3,2),(4,1)}
- X−1(7)={(1,6),(2,5),(3,4),(4,3),(5,2),(6,1)}
- X−1(11)={(5,6),(6,5)}
- X−1(−2)={(1,3),(2,2),(3,1),(2,6),(3,5),(4,4),(5,3),(6,2)}
- X−1(−3)={(1,5),(2,4),(3,3),(4,2),(5,1),(3,6),(4,5),(5,4),(6,3),(6,6)}
- X−1(−5)={(4,6),(5,5),(6,4)}
Now we will build the table of probabilities of X
Value | Probability |
---|
−5 | 363 |
−3 | 3610=185 |
−2 | 368=92 |
2 | 361 |
3 | 362=181 |
5 | 364=91 |
7 | 366=61 |
11 | 362=181 |
2. Expected Value
Let X be a random variable following some distribution D.
The expected value of X, denoted E[X], if it exists, defines in some sense what value at average we expect from X
2.1 Discrete Case
If D is a discrete distribution, then:
E[X]=k∈S∑kP(X=k) With S defined as the support of X
2.2 Continuous Case
If D is a continuous distribution, then:
E[X]=∫Sxf(x) dx 2.3 Linearity
2.3.1 Simple Case
- Let a,b∈R
- Let X,Y two random variables
The expected value is linear:
E[aX+bY]=aE[X]+bE[Y] 2.3.2 Generalisation
- Let n∈N
- Let a1,…,an∈R
- Let X1,…,Xn be n random variables
- Let Y=∑k=1nakXk
We have:
E[Y]=E[k=1∑nakXk]=k=1∑nakE[Xk] 2.4 Example: Dice Game 3
We want to calculate the expected number of steps taken on each step:
E[X]=k∈X(Ω)∑kP(X=k)=36−5⋅3−3⋅10−2⋅8+2⋅1+3⋅2+5⋅4+7⋅6+11⋅2=3631≈0.861 3. Variance
3.1 Definition
Let X be a random variable following some distribution D.
The variance of X, denoted V[X], if it exists, defines in some sense how far is X from its expected value, on average.
It is defined as follow:
V[X]=E[(X−E[X])2]=E[X2]−E[X]2 3.1 Discrete Case
If D is a discrete distribution, then:
V[X]=k∈S∑(k−E[X])2P(X=k) With S defined as the support of X
3.2 Continuous Case
If D is a continuous distribution, then:
E[X]=∫S(x−E[X])2f(x) dx 3.3 Variance of sum of independent random variables
3.3.1 Simple Case
- Let a,b∈R.
- Let X,Y two independent random variables.
The expected value is linear:
V[aX+bY]=a2V[X]+b2V[Y] 3.3.2 Generalisation
- Let n∈N
- Let a1,…,an∈R
- Let X1,…,Xn be n independent random variables
- Let Y=∑k=1nakXk
We have:
V[Y]=V[k=1∑nakXk]=k=1∑nak2V[Xk] 3.4 Example: Dice Game 4
E[X2]⟹V[X]=k∈X(Ω)∑k2P(X=k)=3625⋅3+9⋅10+4⋅8+4⋅1+9⋅2+25⋅4+49⋅6+121⋅2=36855=495=E[X2]−E[X]2=495−362312=129629819≈23.008 4. Co-variance
4.1 Definition
Let X,Y be two random variables.
The co-variance of X and Y, denoted Cov[X,Y], if it exists, defines in some sense how X and Y varies together.
It is defined as follow:
Cov[X,Y]=E[(X−E[X])⋅(Y−E[Y])]=E[XY]−E[X]E[Y] 4.1 Discrete Case
If D is a discrete distribution, then:
Cov[X,Y]=u∈S1∑v∈S2∑(u−E[X])(v−E[Y])P(X=u∧Y=v) With S defined as the support of X
4.2 Continuous Case
If D is a continuous distribution, then:
Cov[X,Y]=∬S1×S2(x−E[X])(y−E[Y])f(x,y) dydx 4.3 Bi-linearity
4.3.1 Simple Case
- Let a,b∈R
- Let X,Y,Z three random variables
The co-variance is left-linear:
Cov[aX+bY,Z]=aCov[X,Z]+bCov[Y,Z] The co-variance is right-linear:
Cov[X,aY+bZ]=aCov[X,Y]+bCov[X,Z] 4.3.2 Generalisation
- Let n,m∈N
- Let a1,…,an,b1,…,bm∈R
- Let X1,…,Xn,Y1,…,Ym be n+m random variables
We have:
Cov[i=1∑naiXi,j=1∑mbjYj]=i=1∑nj=1∑maibjCov[Xi,Yj] 4.3.4 Symmetry
In fact, Cov is also symmetric as:
Cov[X,Y]=Cov[Y,X] 4.3.5 Positive semi-definite
More than that, Cov is positive semi-definite as:
Cov[X,X]=V[X]≥0 4.3.6 Orthogonality between independent random variables
Let X,Y two independent random variables. We have:
Cov[X,Y]=0 The converse does not generally hold
4.4 Relation to Variance
4.4.1 Variance as a Co-variance
Let X a random variable.
The variance of X is in fact equal to:
V[X]=Cov[X,X] 4.4.2 Variance of a sum of random variables
- Let n∈N
- Let a1,…,an∈R
- Let X1,…,Xn be n random variables (not necessarily independent)
- Let Y=∑k=1nakXk
The variance of Y is:
V[Y]=Cov[i=1∑naiXi,j=1∑najXj]=i=1∑nj=1∑naiajCov[Xi,Xj]=i=1∑nai2Cov[Xi,Xi]+1≤i=j≤n∑aiajCov[Xi,Xj]=i=1∑nai2V[Xi]+21≤i<j≤n∑aiajCov[Xi,Xj]