KEMBAR78
Week 5-6 Notes | PDF | Probability Distribution | Normal Distribution
0% found this document useful (0 votes)
5 views40 pages

Week 5-6 Notes

Uploaded by

kewchinloong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views40 pages

Week 5-6 Notes

Uploaded by

kewchinloong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

SC2000/CZ2100

Probability & Statistics

Week 5-6
Prob. Distribution of Continuous r.v.
- Introduction
- Special Probability Distributions
● Uniform Distribution
● Exponential Distribution
● Normal Distribution

2
Prob. Distribution of Continuous r.v.
A continuous random variable is a variable used for
continuous measurements such as distance, weight,
and time.
Probability Density Function (pdf)
For a continuous random variable X, we can describe
the probability distribution by some function f (X),
such that
(i) f ( X )  0 for all X
eg:

3
Prob. Distribution of Continuous r.v.

(ii) P(a <X <b ) is the area under the curve


between a and b : b
 f ( x) dx
a
a b

(iii) Total area under curve = 1.

The function f (x ) is called the probability density


function (or pdf ) of X.
The probability P(X <x ) is known as the
Cumulative distribution function (or CDF) of X .
4
Given that the probability density function of X is:
𝑥3
𝑓 𝑥 = where 0 < 𝑥 < 𝑐
4
Find the value of the constant c.

𝑐
𝑐
𝑥3 𝑥4
න 𝑑𝑥 = อ =1 Solve for c, we get c = 2.
0 4 16
0

Determine the CDF of X.


𝑥
CDF of X = න 𝑓(𝑥) 𝑑𝑥
−∞
𝑥
𝑥
𝑥3 𝑥4 𝑥4
=න 𝑑𝑥 = อ =
−∞ 4 16 16
0
5
Prob. Distribution of Continuous r.v.
For a continuous random variable X the probability
that X equals to an exact value is zero.
Eg: for the length of a bolt
P(X = 1.999965700 cm) = 0

i.e., P(X =x ) = 0. Hence, for continuous random


variables, probabilities are always associated with
a range of values.
Eg: P(X ≤ 2.00 cm) or P(X > 1.95 cm).

6
Prob. Distribution of Continuous r.v.
The expected value of a continuous r.v. is defined
x =
as: E[ X ] =  x f ( x) dx =  For discrete r.v.
x = − n
E ( X ) =  pi xi
i =1

and its variance is:


x =
 (x −  ) f ( x) dx
2
var[X ] =
For discrete r.v.
x = − n
Var[X] =  (xi −  ) pi
2
2 2
= E[X ] – E[X ] i =1

x =
where E[ X 2 ] =  x 2 f ( x) dx
x = − 7
Example:
The pdf of X is given below. Determine E[X].
cos 𝑥 , 0 ≤ 𝑥 ≤ 𝜋2
𝑓 𝑥 = ൝
0, otherwise

8
Prob. Distribution of Continuous r.v.
How do we determine the pth percentile from the
probability distribution of a continuous r.v.?

The p t h percentile is the value Xp such that the


probability that x < Xp is p percent.
𝑋𝑝
𝑝
න 𝑓 𝑥 𝑑𝑥 =
−∞ 100
𝑝th percentile = 𝑋𝑝
9
Given that the probability density function of x is
𝑓 𝑥 = 𝑒 −𝑥 , where 𝑥 > 0
determine the 25th percentile.

10
Prob. Distribution of Continuous r.v.
- Introduction
- Special Probability Distributions
● Uniform Distribution
● Exponential Distribution
● Normal Distribution

11
Prob. Distribution of Continuous r.v.
Uniform Distribution
One example of a pdf for a continuous r.v. is the
uniform continuous distribution.
X can take any real value between a and b with
uniform probability over this interval.
Notation: X ~U (a,b). f (X)

Total area = 1 1/(b −a)


Length = b − a
Height = 1/(b – a ) a b
X

12
Prob. Distribution of Continuous r.v.
Thus the pdf is f ( X ) = b −1 a for a  X  b
= 0, otherwise
For any values c and d between a and b

Exercise: Obtain the CDF.


13
Obtain the expressions for E[X] and Var[X] of r.v. X~U(a,b).

14
Prob. Distribution of Continuous r.v.
Exponential Distribution
If the number of arrivals during an interval is
Poisson distributed, then the interarrival times x are
exponentially distributed. The pdf of x is:

𝑓 𝑥 = 𝜆𝑒 −𝜆𝑥 , 𝑥≥0
where 𝜆 is the mean arrival rate and the mean
interarrival time is 1/𝜆.

Notation: X ~ Exp(𝜆)

15
If the number of arrivals in an interval is Poisson distributed,
we show that the interarrival times are exponentially
distributed.

16
Prob. Distribution of Continuous r.v.
Exponential Distribution – examples:

Pdf:
𝑓 𝑥 = 𝜆𝑒 −𝜆𝑥

Expected value:
1
𝐸𝑋 =
𝜆
Variance:
1
Var 𝑋 = 2
𝜆

17
Eg: Given that an average of number of customers walk into
a shop per hour is 20 and the time between arrivals is
exponentially distributed. After a customer arrives, what is
the probability that the next customer will arrive within 1
minute?

18
Prob. Distribution of Continuous r.v.
Normal Distribution
A common function for a continuous distribution is
the normal (bell-shaped) curve. Its pdf depends on
 and  and is given by:
1 1 𝑥−𝜇 2
−2 𝜎
𝑓(𝑥) = 𝑒 where − ∞ < 𝑥 < ∞
𝜎 2𝜋

The normal distribution is by convention written as


X~N (,  ). Eg: if X~N (10, 16) then this implies
that  =10 and  =16, and (hence  =4).

19
Prob. Distribution of Continuous r.v.
Eg: The distribution of blood pressure in patients
can be approximated as a normal distribution with
mean 85 mmHg and standard deviation 20 mmHg.
A histogram of 1,000 observations and the normal
curve is shown below.

20
Prob. Distribution of Continuous r.v.

The normal distribution has about 68% of the


observations lying within one standard deviation of
the mean, 95% within two standard deviations and
99.7% within 3 standard deviations.

21
Prob. Distribution of Continuous r.v.
Standard Normal Distribution
To obtain the area under the density curve for a
normal distribution, it is necessary to express
any value of X in terms of the number of
standard deviation units away from  , i.e.
X =  + Z . 𝑓(𝑥) =
1 −
1 𝑥−𝜇 2
𝑒 2 𝜎
𝜎 2𝜋

This can be rearranged to give Z = X − 



22
Prob. Distribution of Continuous r.v.
Since X is a r.v., so is Z. Using the formulas for
functions of random variables we can obtain

EZ  = E X  −
1 1 1 1
= −  =0
   
2
var Z  = 2 var  X  = 2 = 1
1
 

Also it can be shown that Z has a normal


distribution. Thus Z ~ N (0, 1).
This is called the standard normal distribution.

23
Prob. Distribution of Continuous r.v.
Most statistics textbooks include a table of the
standard Normal distribution. It tabulates the area
under the curve of the N (0,1) density function.

Other normal tables may give other areas, e.g.

24
Table of Normal Distribution, P ( Z  z )
z 0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
0.0 0.5000 0.5040 0.5080 0.5120 0.5160 0.5199 0.5239 0.5279 0.5319 0.5359
0.1 0.5398 0.5438 0.5478 0.5517 0.5557 0.5596 0.5636 0.5675 0.5714 0.5753
0.2 0.5793 0.5832 0.5871 0.5910 0.5948 0.5987 0.6026 0.6064 0.6103 0.6141
0.3 0.6179 0.6217 0.6255 0.6293 0.6331 0.6368 0.6406 0.6443 0.6480 0.6517
0.4 0.6554 0.6591 0.6628 0.6664 0.6700 0.6736 0.6772 0.6808 0.6844 0.6879
0.5 0.6915 0.6950 0.6985 0.7019 0.7054 0.7088 0.7123 0.7157 0.7190 0.7224
0.6 Eg:
0.7257 0.7291 0.7324 0.7357 0.7389 0.7422 0.7454 0.7486 0.7517 0.7549

P(Z<0.21) = 0.5832
0.7 0.7580 0.7611 0.7642 0.7673 0.7703 0.7734 0.7764 0.7794 0.7823 0.7852
0.8 0.7881 0.7910 0.7939 0.7967 0.7995 0.8023 0.8051 0.8078 0.8106 0.8133
0.9 0.8159 0.8186 0.8212 0.8238 0.8264 0.8289 0.8315 0.8340 0.8365 0.8389
1.0 0.8413 0.8438 0.8461 0.8485 0.8508 0.8531 0.8554 0.8577 0.8599 0.8621
1.1 0.8643 0.8665 0.8686 0.8708 0.8729 0.8749 0.8770 0.8790 0.8810 0.8830
1.2 0.8849 0.8869 0.8888 0.8907 0.8925 0.8944 0.8962 0.8980 0.8997 0.9015
1.3 0.9032 0.9049 0.9066 0.9082 0.9099 0.9115 0.9131 0.9147 0.9162 0.9177
1.4 0.9192 0.9207 0.9222 0.9236 0.9251 0.9265 0.9279 0.9292 0.9306 0.9319
1.5 0.9332 0.9345 0.9357 0.9370 0.9382 0.9394 0.9406 0.9418 0.9429 0.9441
1.6 0.9452 0.9463 0.9474 0.9484 0.9495 0.9505 0.9515 0.9525 0.9535 0.9545
1.7 0.9554 0.9564 0.9573 0.9582 0.9591 0.9599 0.9608 0.9616 0.9625 0.9633
1.8 0.9641 0.9649 0.9656 0.9664 0.9671 0.9678 0.9686 0.9693 0.9699 0.9706
1.9 0.9713 0.9719 0.9726 0.9732 0.9738 0.9744 0.9750 0.9756 0.9761 0.9767
2.0 0.9772 0.9778 0.9783 0.9788 0.9793 0.9798 0.9803 0.9808 0.9812 0.9817
2.1 0.9821 0.9826 0.9830 0.9834 0.9838 0.9842 0.9846 0.9850 0.9854 0.9857
2.2 0.9861 0.9864 0.9868 0.9871 0.9875 0.9878 0.9881 0.9884 0.9887 0.9890
2.3 0.9893 0.9896 0.9898 0.9901 0.9904 0.9906 0.9909 0.9911 0.9913 0.9916
2.4 0.9918 0.9920 0.9922 0.9925 0.9927 0.9929 0.9931 0.9932 0.9934 0.9936
2.5 0.9938 0.9940 0.9941 0.9943 0.9945 0.9946 0.9948 0.9949 0.9951 0.9952
2.6 0.9953 0.9955 0.9956 0.9957 0.9959 0.9960 0.9961 0.9962 0.9963 0.9964
2.7 0.9965 0.9966 0.9967 0.9968 0.9969 0.9970 0.9971 0.9972 0.9973 0.9974
2.8 0.9974 0.9975 0.9976 0.9977 0.9977 0.9978 0.9979 0.9979 0.9980 0.9981
2.9 0.9981 0.9982 0.9982 0.9983 0.9984 0.9984 0.9985 0.9985 0.9986 0.9986
3.0 0.9987 0.9987 0.9987 0.9988 0.9988 0.9989 0.9989 0.9989 0.9990 0.9990
25
Prob. Distribution of Continuous r.v.
The P (Z ≤z ) table gives area under the curve from
− to z , where 0 < z < 3.09
For other values, we perform some manipulations.
Eg:
P (Z ≥−z ) =P (Z ≤z )

P (Z ≤−z ) = 1 − P (Z ≥−z )

P (−z ≤ Z ≤z ) = 1 −  P (Z ≤ −z )
26
Prob. Distribution of Continuous r.v.
Probabilities for normal distributions other than the
standard normal distribution N (0, 1) are obtained
by using the formula:

X −
Z=

to convert from X ~ N (,  ) to Z ~ N (, ) and


then using the table of probabilities for the standard
normal distribution N (0, 1).

27
Prob. Distribution of Continuous r.v.

Normal distribution = =


X~N(,2)

𝑥 = 63

63 − 60
Standard Normal 𝑧=
4
Z~N(0,1)

where Z=(X-)/

28
Prob. Distribution of Continuous r.v.
Eg: A machine fills bottles with 300 ml of soft
drinks. However, the actual quantity filled varies
according to the normal distribution with  =298
ml and  =3 ml.

What is the probability that an individual bottle


contains less than 295 ml?

29
Prob. Distribution of Continuous r.v.
Solution
Let X denote the quantity in an individual bottle.
Given X ~N (298,32), we want to find P (X <295)

295 − 298 − 3
If X =295 then Z = = = −1
3 3
P (X <295) = P (Z <−1) = 1−P (Z <1)
= 1−0.8413 (from tables)
= 0.1587
About 16% of bottles would have less than 295 ml.

30
Approx. to Binomial Distribution
For large n or p near 0.5 the binomial distribution
approximately follows the normal distribution.

32
Approx. to Binomial Distribution
If X ~ B (n, p ) where n is large and p not too near
0 or 1, then X can be approximated by a normal
distribution with E (X )=n p and var(X ) = n p q ,
where q =1−p.

X − np
So Z = is approximately N (0, 1).
npq

This approximation is reasonably good when


np > 5 and n (1 – p ) > 5.

33
Approx. to Binomial Distribution
Continuity Correction and Accuracy
For more accurate values of binomial
probabilities, the approximation is improved
using the continuity correction. This method
considers that each whole number occupies
the interval from 0.5 below to 0.5 above it.

When an outcome X is to be included in the


probability calculation, the normal approximation
uses either (X −0.5) or (X +0.5).

34
Approx. to Binomial Distribution
Binomial Distribution XB~B(n,p)
Binomial r.v.
Approx by P(XB<8) ≠ P(XB≤8)
Normal Distr
=np Approx by Normal distr
2=np (1-p)
P(XB<8) ≅ P(XN<7.5)
P(XB≤8) ≅ P(XN<8.5)

P(XB>8) ≅ P(XN>8.5)
P(XB≥8) ≅ P(XN>7.5)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
35
Approx. to Binomial Distribution

Eg: In a particular faculty 60% of students are


men and 40% are women. In a sample of 50
students what is the probability that more than
half are women?
Solution: Letthe
• 1st compute r.v. X be probability
theapproximate the number withofnowomen
in the sample
continuity and X ~ B(50, 0.4).
correction
• 2nd compare the actual result and check the accuracy of
E (the
X)= n p =approximation
above 20, nq =30 and var(X ) =n p q = 12.
We
• 3rdapproximate X by X N ~ probability
compute the approximate N (20, 12).with continuity
correction and compare all results

36
Approx. to Binomial Distribution
We need to find P (X > 25). Note: not P (X ≥25)
No continuity correction More than ½
25 - 20 are women
So P(X > 25) = P( Z > = 1.44 )
12
= 1 − P ( Z  1.44)
= 1− 0.9251 = 0.075

The exact ans. calculated from binomial probabilities


is: P( X  25) = P( X = 26) + P( X = 27) +  + P( X = 50)
= 0.0573

37
Approx. to Binomial Distribution
The approximate probability, using the continuity
correction, is
Continuity correction

 25.5 − 20 
P( X  25) = P Z  
 12 
= P ( Z  1.59)
= 1 − P ( Z  1.59)
= 0.0559 Compare to 0.0573

which is a more accurate approximation than the


original approximation (without correction) of
0.075.
38
Approx. to Binomial Distribution

The value 25.5 was chosen as the outcome 25


was not to be included but the outcomes 26, 27,
…, 50 were to be included in the calculation.

Similarly, if the example required the probability


that less than 18 students were women, the
continuity correction would require the
calculation
 17.5 − 20 
P( X  18) = P Z  
 12 

39
Summary
◼ Random Variables
◼ Expected Values and Variance
◼ Discrete Distributions
1) Binomial
2) Poisson
3) Geometric
◼ Continuous Distributions
1) Uniform
2) Exponential
3) Normal and Standard Normal
◼ Normal Approximation to Binomial
40
Distribution Probability Mean Variance

𝑛 𝑥
X~B(n,p) 𝑃(𝑋 = 𝑥) = 𝑝 1−𝑝 𝑛−𝑥
𝑛𝑝 𝑛𝑝(1 − 𝑝)
𝑥

𝑒 −𝜇 𝜇 𝑥
X~Pois() 𝑃(𝑋 = 𝑥) =  
𝑥!
1 1−𝑝
X~G(p) P 𝑋 = 𝑥 = (1 − 𝑝) 𝑥−1
𝑝
𝑝 𝑝2

1 2
𝑎<𝑥<𝑏 𝑎+𝑏 𝑎−𝑏
X~U(a,b) 𝑓 𝑥 = ቐ𝑏 − 𝑎
0 otherwise 2 12

1 1
X~Exp() 𝑓 𝑥 = 𝜆𝑒 −𝜆𝑥
𝜆 𝜆2
1 1 𝑥−𝜇 2
−2 𝜎
X~N( ) 𝑓(𝑥) = 𝑒  
𝜎 2𝜋
41

You might also like