You are on page 1of 28

Foundations in Calculus

and Probability
YU SHENG LOH
Probability and Statistics
Probability
The likelihood of an outcome occurring based on all available outcomes
◦ Probability of rolling a ‘1’ on a die is 1 out of 6 possible outcomes
!
◦ 𝑃 𝑥=1 ="
◦ Probability of rolling lower than ‘4’ is 3 out of 6 possible outcomes (‘1’, ‘2’, ‘3’)
# !
◦ 𝑃 𝑥<4 = =
" $

Conditional probability
◦ The likelihood of an outcome occurring given that another event has already occurred
◦ The probability of having a cough is 0.05
◦ 𝑃 𝑐𝑜𝑢𝑔ℎ = 0.05
◦ The probability of having a cough while down with covid is 0.8
◦ 𝑃 𝑐𝑜𝑢𝑔ℎ 𝑐𝑜𝑣𝑖𝑑 = 0.8
Probability
Independence
◦ Two events are independent if their conditional probabilities are the same as their unconditional
probabilities
◦ i.e. 𝑃 𝐴 𝐵) = 𝑃(𝐴)

Bayes’ theorem
◦ Conditional probability of event A given event B can be expressed in terms of conditional probability of
event B given event A
! " #)%!(#)
◦ 𝑃 𝐴 𝐵) = !(")
Probability
Probability distribution
◦ The function that gives the probabilities associated with different outcomes
◦ Can be discrete or continuous
◦ Probabilities must always sum to 1

Discrete probability distribution


◦ E.g. outcome of die roll

Die Roll 1 2 3 4 5 6
Probability 1⁄6 1⁄6 1⁄6 1⁄6 1⁄6 1⁄6
Conditional Probability
Continuous probability distribution
◦ Probability density function (PDF)
'
◦ 𝑓 𝑥 = , 0≤𝑥≤2
(
◦ Verify that this is a valid PDF

Students are to take a 2hr exam. The probability that a student will complete the exam in 𝑥
hours is 𝑓 𝑥
◦ What is the probability that a student completes the exam in less than half an hour?
◦ If the student is still working on the exam after 1 hour, what is the probability that the student will
complete the exam before 1.5 hours?
Conditional Probability
!
To verify that 𝑓 𝑥 = , 0 ≤ 𝑥 ≤2 is a valid PDF, we must first find the cumulative distribution
"
function (CDF)
◦ CDF can be seen as the sum of all the probabilities that are less than or equal to a value 𝑥
!!
𝐹 𝑥 = ∫ 𝑓 𝑥 𝑑𝑥 = +𝐶
#
"! $!
𝐹 2 −𝐹 0 = +𝐶− −𝐶 =1−0=1
# #

We can also solve for C


𝐹 0 = 0 + 𝐶 = 0, 𝐶=0
𝐹 2 = 1 + 𝐶 = 1, 𝐶=0
Probability
What is the probability that a student completes the exam in less than half an hour?
◦ We can make use of the CDF that was previously found
◦ 𝑃 𝑥 < 0.5 = 𝐹 0.5
).+!
◦ 𝐹 0.5 = = 0.0625
,

If the student is still working on the exam after 1 hour, what is the probability that the student
will complete the exam before 1.5 hours?
◦ 𝑃 𝑥 > 1 = 𝐹 2 − 𝐹 1 = 1 − 0.25 = 0.75
-.+! -!
◦ 𝑃 1 < 𝑥 < 1.5 = 𝐹 1.5 − 𝐹 1 = ,
− ,
= 0.5625 − 0.25 = 0.3125
! -.'.-.+ ).0-(+
◦ !('/-)
= ).1+
= 0.4167
Conditional Probability
Students are to take a 1hr quiz. The probability that a student will complete the quiz in 𝑥 hours
is 𝑓 𝑥 = 2𝑥 % + 𝑥, 0 ≤ 𝑥 ≤ 1
◦ Show that this is a valid PDF
◦ What is the probability that a student completes the quiz in less than half an hour?
◦ If the student is still working on the quiz after 30 minutes, what is the probability that the student will
complete the quiz before 45 minutes?
Mean and Variance
Mean of a PDF
◦ The expected value from a given probability density function
◦ First moment of a probability distribution
◦ Found by summing the value of each outcome multiplied with its associated probability

For the following discrete probability distribution


Die Roll 1 2 3 4 5 6
Probability 1⁄6 1⁄6 1⁄6 1⁄6 1⁄6 1⁄6
3 3 3 3 3 3
𝐸 𝑋 =1∗ +2∗ +3∗ +4∗ +5∗ +6∗
4 4 4 4 4 4
3
= 1+2+3+4+5+6
4
= 3.5
Mean and Variance
Variance of a PDF
◦ Measure of dispersion within a probability distribution
◦ Second central moment of a probability distribution
◦ Found by summing the squared value of each outcome’s distance from the mean multiplied with its
associated probability
◦ Standard deviation 𝑉𝑎𝑟(𝑋)
( - ( - ( - ( - ( -
𝑉𝑎𝑟 𝑋 = 1 − 3.5 ∗ 2 + 2 − 3.5 ∗ 2 + 3 − 3.5 ∗ 2 + 4 − 3.5 ∗ 2 + 5 − 3.5 ∗ 2 + (6 −
-
3.5)( ∗
2
&
= 2.5" + 1.5" + 0.5" + 0.5" + 1.5" + 2.5"
'
& %(
= 17.5 =
' &"
Mean and Variance
For a continuous PDF 𝑓 𝑥
The expected value or first moment 𝜇 = ∫ 𝑥 3 𝑓(𝑥) 𝑑𝑥
The variance or second central moment = ∫ 𝑥 − 𝜇 " 3 𝑓(𝑥) 𝑑𝑥
= ∫(𝑥 " − 2𝑥𝜇 + 𝜇" ) 3 𝑓(𝑥) 𝑑𝑥
= ∫ 𝑥 " 3 𝑓(𝑥) 𝑑𝑥 − 2𝜇 ∫𝑥 3 𝑓 𝑥 𝑑𝑥 + 𝜇" ∫ 𝑓 𝑥 𝑑𝑥
= ∫ 𝑥 " 3 𝑓(𝑥) 𝑑𝑥 − 2𝜇 𝜇 + 𝜇"
= ∫ 𝑥 " 3 𝑓(𝑥) 𝑑𝑥 − 𝜇"
= 𝑆𝑒𝑐𝑜𝑛𝑑 𝑚𝑜𝑚𝑒𝑛𝑡 − 𝐹𝑖𝑟𝑠𝑡 𝑚𝑜𝑚𝑒𝑛𝑡 "
Mean and Variance
2𝑥 0≤𝑥≤1
For the following pdf 𝑓 𝑥 = @ , find the mean and variance
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

&
𝐸 𝑋 = ∫$ 𝑥 3 2𝑥 𝑑𝑥
&
= ∫$ 2𝑥 " 𝑑𝑥
&
"!"
= E
% $
"
=
%
Mean and Variance
3 6 6
𝑉𝑎𝑟 𝑋 = ∫5 𝑥 6 2 2𝑥 𝑑𝑥 −
7
3 7 6 6
= ∫5 2𝑥 𝑑𝑥 − 7
3
68 " 6 6
= 5 −
9 5 7
6 9
= −
9 :
3; 34
= −
74 74
6
= 74
3
=
3;
PDF of Two Variables
Density functions involving two or more variables
& &
𝑥 + 𝑦 0 ≤ 𝑥 ≤ 1, 0 ≤ 𝑦 ≤ 2
E.g. Joint PDF 𝑓)* 𝑥, 𝑦 = G" #
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

We can find the marginal PDF of one variable by integrating out the other variable
"& & && &
𝑓) 𝑥 = ∫$ 𝑥 + 𝑦 𝑑𝑦 𝑓* 𝑦 = ∫$ 𝑥 + 𝑦 𝑑𝑥
" # " #
! & " " & " , &
= 𝑦 + 𝑦 E = 𝑥 + 𝑥E
" + $ # # $
& &
=𝑥+ = (𝑦 + 1)
" #
PDF of Two Variables
Conditional density function
𝑓)|* 𝑥 𝑦 𝑓* 𝑦 = 𝑓)* 𝑥, 𝑦 = 𝑓*|) 𝑦 𝑥 𝑓) 𝑥

.#$ !,, .#$ !,,


𝑓)|* 𝑥 𝑦 = , 𝑓*|) 𝑦 𝑥 =
.$ (,) .# (!)

Conditional mean
3
𝐸 𝑋 𝑌 = 𝑦) = ∫23 𝑥 3 𝑓)|* 𝑥 𝑦) 𝑑𝑥
& 3
= ∫ 𝑥 3 𝑓)* 𝑥, 𝑦 𝑑𝑥
.$ (,) 23
PDF of Two Variables
& &
𝑥 + 𝑦 0 ≤ 𝑥 ≤ 1, 0 ≤ 𝑦 ≤ 2
For the joint PDF 𝑓)* 𝑥, 𝑦 = G" #
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Find the conditional mean of 𝑋 and find the mean when 𝑌 = 1 i.e. 𝐸 𝑋 𝑌 = 1)
PDF of Two Variables
Suppose there are two independent variables 𝑥& and 𝑥" that both follow the PDF 𝑓(𝑥), where
1 0≤𝑥≤1
𝑓 𝑥 =@
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Find 𝑃(𝑥& + 𝑥" < 1)


◦ Hint: because the two variables are independent, their PDFs can be multiplied together

& &2!!
𝑃 𝑥& + 𝑥" < 1 = ∫$ ∫$ 𝑓!% 𝑥& 𝑓!! 𝑥" 𝑑𝑥& 𝑑𝑥"
& &2!!
= ∫$ ∫$ 1 𝑑𝑥& 𝑑𝑥"
PDF of Two Variables
& &2!!
𝑃 𝑥& + 𝑥" < 1 = ∫$ ∫$ 1 𝑑𝑥& 𝑑𝑥" 𝑥"

& &2!! 1
= ∫$ 𝑥& |$ 𝑑𝑥"
&
= ∫$ 1 − 𝑥" − 0 𝑑𝑥"
&
!!!
= 𝑥" − E
" $
&
=1−
"
&
=
"
1 𝑥!
PDF of Two Variables
Suppose there are two independent variables 𝑥& and 𝑥" that both follow the PDF 𝑓(𝑥), where
1 0≤𝑥≤1
𝑓 𝑥 =@
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Find 𝑃 𝑥& + 𝑥" < 1 𝑥& < 0.4)


Probability Distributions
Poisson distribution
◦ 𝑋~𝑃𝑜(𝜆)
'% ( &'
◦ 𝑃 𝑋=𝑘 =
)!
◦ 𝐸 𝑋 =𝜆
◦ 𝑉𝑎𝑟 𝑋 = 𝜆
◦ Models the number of occurrences within a certain time

Binomial distribution
◦ 𝑋~𝐵 𝑛, 𝑝
𝑛 ) +,)
◦ 𝑃 𝑋=𝑘 = 𝑝 1−𝑝
𝑘
◦ 𝐸 𝑋 = 𝑛𝑝
◦ 𝑉𝑎𝑟 𝑋 = 𝑛𝑝 1 − 𝑝
◦ Models the number of successes over a number of repeated trials
Probability Distributions
Exponential Distribution
◦ 𝑋~𝐸𝑥𝑝(𝜆)
◦ 𝑓 𝑥 = 𝜆𝑒 34' , 𝑥 ≥ 0
◦ 𝐹 𝑥 = 1 − 𝑒 34'
-
◦ 𝐸 𝑋 =
4
-
◦ 𝑉𝑎𝑟 𝑋 = 4!
◦ If the Poisson distribution looks at the number of occurrences within a given time, then the exponential
distribution models the waiting time in between occurrences
◦ Special case of Gamma distribution
Probability Distributions
Gamma Distribution
◦ 𝑋~Γ(𝛼, 𝛽)
' #$%5 $&' 6 #
◦ 𝑓 𝑥 = , 𝑥 > 0, 𝛼, 𝛽 > 0
7(8)
9(8,6')
◦ 𝐹 𝑥 =
7(8)
;
◦ The gamma function Γ 𝛼 = ∫) 𝑡 83- 𝑒 3< 𝑑𝑡
6'
◦ The incomplete gamma function 𝛾 𝛼, 𝛽𝑥 = ∫) 𝑡 83- 𝑒 3< 𝑑𝑡
8
◦ 𝐸 𝑋 =6
8
◦ 𝑉𝑎𝑟 𝑋 =
6!
◦ Exponential distribution is Γ(1, 𝜆)
Probability Distributions
Normal Distribution
◦ 𝑋~N(𝜇, 𝜎 ( )
% '$( !
- 3
◦ 𝑓 𝑥 = = (>
e ! ) −∞ < 𝑥 < ∞
◦ CDF does not have a closed-form solution
◦ 𝐸 𝑋 =𝜇
◦ 𝑉𝑎𝑟 𝑋 = 𝜎 (
◦ Distribution characterised by its mean and variance, and its symmetry about 0
◦ Commonly used distribution because of Central Limit Theorem
Probability Distributions
Standard Normal Distribution
?3@
◦ Any normal distribution can be transformed into a standard normal distribution 𝑍 =
=
◦ Standardised to have a mean of 0 and variance of 1
◦ Z~N(0,1)
%
- 3!A !
◦ 𝑓 𝑧 = (>
e −∞ < 𝑥 < ∞
◦ CDF does not have a closed-form solution, but we use the function Φ(𝑧) to calculate the CDF up to the
value of 𝑧
◦ Similarly, for a given probability 𝑝, we can take the inverse of the CDF function, Φ3- (𝑝) in order to find
the associated z-score
Probability Distributions
Lognormal Distribution
◦ 𝑋~LN(𝜇, 𝜎 ( )
% *+ '$( !
- 3
◦ 𝑓 𝑥 = '= (>
e ! ) 𝑥>0
)!
@B
◦ 𝐸 𝑋 =𝑒 !
! !
◦ 𝑉𝑎𝑟 𝑋 = 𝑒 = − 1 𝑒 (@B=
◦ If 𝑋~𝑁(𝜇, 𝜎 ( ), then eC ~𝐿𝑁(𝜇, 𝜎 ( )
◦ Useful in certain cases where 𝑋 values are strictly positive
Example in Finance – Measures of Risk
Variance of Return
-
◦ ∫,- 𝑥 − 𝜇 . 𝑓(𝑥) 𝑑𝑥

Semi-variance of Return
/
◦ ∫,- 𝑥 − 𝜇 . 𝑓(𝑥) 𝑑𝑥
Assuming returns follow the distribution function 𝑓 𝑥 = 4𝑥 7 , 0 ≤ 𝑥 ≤ 1, what is the semi-variance
of return?

Shortfall Probability
◦ Measures the probability of returns falling below a certain level
0
◦ 𝑃 𝑋 < 𝐿 = ∫,- 𝑓(𝑥) 𝑑𝑥
Example in Finance – Measures of Risk
Value at Risk (VaR)
◦ For a given probability, what is the value associated with the probability
◦ This translates to a probability that losses will exceed that associated value
◦ 𝑉𝑎𝑅 𝑋 = −𝑡, where 𝑃 𝑋 < 𝑡 = 𝑝
◦ What is the 5% VaR of a portfolio of $1 million whose returns 𝑟~𝑁(0.08,0.1( ) (Corresponding z-score is
-1.645)

Expected Shortfall
◦ The expected value of the shortfall below a certain chosen benchmark
D
◦ 𝐸 max(𝐿 − 𝑋, 0) = ∫3;(𝐿 − 𝑥)𝑓(𝑥) 𝑑𝑥

You might also like