0% found this document useful (0 votes)
9 views41 pages

NUFYP Mathematics: 7.1 Continuous Random Variables (CRV) - Part 1

This document discusses continuous random variables (CRVs). It defines key concepts like the probability density function (PDF) and cumulative distribution function (CDF) for CRVs. The PDF describes the relative likelihood of a CRV taking on a given value, while the CDF gives the probability that a CRV will be less than or equal to a particular value. The document provides examples of calculating probabilities and finding PDFs and CDFs for CRVs.
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)
9 views41 pages

NUFYP Mathematics: 7.1 Continuous Random Variables (CRV) - Part 1

This document discusses continuous random variables (CRVs). It defines key concepts like the probability density function (PDF) and cumulative distribution function (CDF) for CRVs. The PDF describes the relative likelihood of a CRV taking on a given value, while the CDF gives the probability that a CRV will be less than or equal to a particular value. The document provides examples of calculating probabilities and finding PDFs and CDFs for CRVs.
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/ 41

Foundation Year Program

NUFYP Mathematics

7.1
Continuous Random Variables (CRV)
– part 1
Foundation Year Program

Learning outcomes:
7.1.1 Define a probability density function of a
continuous random variable.
7.1.2 Define a cumulative distribution function
of a continuous random variable.
7.1.3 Find probabilities using a probability
density function or a cumulative distribution
function.
Foundation Year Program

Preview: 7.1 Continuous Random Variables I

Probability density Mean, Variance,


function Mode
(pdf) (Lecture 7.2)
Continuous Random
Variables (CRVs)
Cumulative Median and
distribution function Quartiles
(cdf) (Lecture 7.2)

3
Foundation Year Program

Revisit: Discrete random variables (DRV)


• We have been studying discrete random variables.
• We saw that, because the variable X was discrete, X
could only take specific values in a range.
• Also, we could express the probabilities using a
function, called a probability function.
• We used the summation notation, σ 𝑃(𝑋 = 𝑥), to
sum the probabilities.
• The sum of all of the probabilities equalled one.
෍ 𝑃(𝑋 = 𝑥) = 1
Foundation Year Program

Continuous Random Variables (CRV’s)


• Continuous random variables (length, time, etc.) can
take any value.
• As with DRV’s, we can express the probabilities for
CRV’s using a function called a probability density
function (pdf).
• Again as with DRV’s, for CRV’s the sum of all of the
probabilities is equal to one.
• We will use a method of integration to sum all of
the probabilities since the Sigma notation only
works for discrete values of X.
Foundation Year Program

Consider the histogram which shows the variable 𝑡, the


time in seconds taken by 100 children to do their
homework.

Recall:
Area of a bar = frequency density × class width
= 𝑘 × frequency

Total area = 𝑘 × total frequency


Foundation Year Program

Total area = 𝑘 × total frequency


Given that the total frequency is 𝑛, to make the total
area equal to 1,
1
𝑘=
𝑛
1
Using 𝑘 = , we can rescale the histogram as follows.
𝑛

𝑛 = 100 → 𝑘 = 0.01

Note that the


numbers are
changed to make
the total area 1
Foundation Year Program

• Imagine we measure the time more finely, then


each bar will be narrower.
• If we repeat this process, the resulting
histograms will approach a smooth curve
satisfying the following conditions:

1) The curve is above the 𝒙-axis


2) The area between the curve and the 𝒙-axis is
equal to 1.
This curve is the probability density function (pdf) of
a continuous random variable 𝑿 where 𝑿 is the time
taken in seconds to do the homework.
Foundation Year Program

This red line is the probability density function, 𝒇(𝒙)

𝒇 𝒙 =𝟎 The total area under the curve is 1.


outside the range We can use definite integrals to find
an area.
Foundation Year Program

Interpretation of probability density functions

• 𝑓 𝑥 is a pdf.

• The area under a pdf


shows the probability that
the random variable will
take a value in that range.
• For example, the shaded area
shows the probability that
this CRV will take a value
between 1 and 2.
• 𝑓(𝑥) itself is not the probability, e.g., 𝑃 𝑋 = 1 ≠ 𝑓(1)
Foundation Year Program

Properties of pdf
If 𝑋 is a continuous random variable with pdf 𝑓(𝑥) then:
1. 𝑓 𝑥 ≥ 0 everywhere since we cannot have negative
probabilities.
𝑏
2. 𝑃 𝑎 < 𝑋 < 𝑏 = ‫𝑓 𝑎׬‬ 𝑥 𝑑𝑥


3. ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 1
Foundation Year Program

Example 1
Which of the following could be a probability density
function?
Need to check:

(1) 𝑓 𝑥 ≥ 0
everywhere

(2) ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 1
Foundation Year Program

Solution
(a)
Start with a sketch of f(x) for the given values of x.

This is not a pdf

(To be a pdf, f(x) must be positive for all values of x.)


Foundation Year Program

(b)

1
This is a pdf for 𝑘 = 4

(1) 𝑓(𝑥) is positive between 𝑥 = 3 and 𝑥 = 5 if 𝑘 > 0

(2) The total area under pdf between 𝑥 = 3 and 𝑥 = 5 should


be 1.
1 1
Total area = × 2 × 4𝑘 = 4𝑘 = 1 if 𝑘 =
2 4
Foundation Year Program

(c) This is not a pdf

For any values of 𝑘, some part of the graph is below the 𝑥-axis,
i.e., 𝑓 𝑥 < 0. Hence, this cannot be a pdf.
Foundation Year Program

Example 2
The random variable 𝑋 has probability density function:

a) Sketch 𝑓(𝑥).
b) Find the value of 𝑘.
Foundation Year Program

Solution

Total area =
+
1
= 𝑘 + × 2 × 4𝑘 = 5𝑘 = 1
2
1
So, 𝑘 =
5
Foundation Year Program

Alternative solution: You can also


use definite integrals to find the
total area
Foundation Year Program

Your turn!
The random variable 𝑋 has probability density
function:

Find the value of k and sketch the pdf.


Foundation Year Program

Solution
Foundation Year Program

Example 3
The random variable 𝑋 has the probability density
function:
3𝑥 2ൗ 0≤𝑥≤2
𝑓 𝑥 =ቐ 8,
0, otherwise

Find 𝑃 0.5 ≤ 𝑋 ≤ 1.2 to 2 decimal places.


Note: Now that 𝑋 is continuous, it can take any value.
Foundation Year Program

Solution
Remember from earlier that:
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 = න 𝑓 𝑥 𝑑𝑥
𝑎
So, we need to integrate 𝑓(𝑥) between 0.5 and 1.2:
1.2 1.2
3𝑥 2 𝑥3
𝑃 0.5 ≤ 𝑋 ≤ 1.2 = න 𝑑𝑥 =
0.5 8 8 0.5
1.23 0.53
= − = 0.200375 = 0.20 (2 d.p.)
8 8

Do you notice anything about the inequality signs?


Foundation Year Program

• Our formula used P(a < X < b) (less than signs),


but the question was to find P(0.5 ≤ X ≤ 1.2) (less than
or equal to).

• Why was this not a problem?


Can we really do this?

• To answer this, consider how to find P(X = 0.5):


Foundation Year Program

How to find P(X = 0.5)?


• We would try and find the area between the curve
and the x axis at the particular value of X = 0.5.
• In other words, the area of a straight vertical line.
• Since in geometry, a line has no width and therefore
no area, then the area of a straight line is zero.

• Alternatively, consider the limits of the definite


0.5+𝑎
integration lim ‫׬‬0.5−𝑎 𝑓 𝑥 𝑑𝑥; the upper and lower
𝑎→0
limits would both be 0.5, and therefore the value
would be zero.
P(X = 0.5)=0
Foundation Year Program

• If X is a continuous random variable then


P(X = k) = 0, for any real constant k

• This leads us to the conclusion that, if X is a


continuous random variable then,
P(X ≤ k) = P(X < k), for any real constant k

• There is no difference between < and ≤


(similarly, > and ≥) for continuous random variables!
Foundation Year Program

Cumulative distribution function (cdf)


• The cumulative distribution function (cdf) for CRV’s
is the same definition as for DRV’s:

𝑥
𝐹 𝑥 = 𝑃(𝑋 ≤ 𝑥) = ‫׬‬−∞ 𝑓(𝑡) 𝑑𝑡

We used 𝑥 already, so we
write 𝑓 as a function of 𝑡,
not 𝑥, to avoid confusion.
We call 𝑡 a dummy variable
Foundation Year Program

Relationship between 𝑭(𝒙) and 𝒇(𝒙)


• We can find 𝐹(𝑥) by integrating 𝑓(𝑥)
• We can find 𝑓(𝑥) by differentiating 𝐹(𝑥).

• If 𝑋 is a continuous random variable with cdf 𝐹(𝑥)


and pdf 𝑓 𝑥 ,
𝑑 𝑥
𝑓 𝑥 = 𝐹(𝑥) and 𝐹 𝑥 = ‫׬‬−∞ 𝑓 𝑡 𝑑𝑡
𝑑𝑥
Foundation Year Program

Example 4
The random variable X has probability density function:

Find
a) F(2.5), b) F(x).

(Although the question doesn’t say ‘continuous random


variable’, this is implied by the terminology probability
density function. Remember, DRV’s have probability
functions.)
Foundation Year Program

Solution

𝑓(𝑥)

𝐹(2.5)

2.5 1 2.5
a) 𝐹 2.5 = ‫׬‬−∞ 𝑓 𝑡 𝑑𝑡 = ‫׬‬−∞ 𝑓 𝑡 𝑑𝑡 + ‫׬‬1 𝑓 𝑡 𝑑𝑡 =
2.5
t 2

= ( 2.5 − 1) =
2.5
1 1 2 21
0+න 𝑡 𝑑𝑡 =  
1 4  8 1 8 32
Foundation Year Program

Solution
b) To find F(x) we need to use the definition:
𝑥
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = න 𝑓 𝑡 𝑑𝑡
−∞
First, find 𝐹(𝑥) for 𝑥 < 1 and 𝑥 > 3, outside of the given
range.
For 𝑥 < 1,
𝑥 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 = න 0 𝑑𝑡 = 0
−∞ −∞
For 𝑥 > 3,
𝑥 3 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 = න 𝑓 𝑡 𝑑𝑡 + න 0 𝑑𝑡 = 1
−∞ −∞ 3
Foundation Year Program

b) For 1≤ 𝑥 ≤ 3,
Method 1 (definite int.) Method 2 (indefinite int.)

Using the fact that 𝐹 3 = 1,

9 1
+ 𝐶 = 1, 𝐶=−
8 8
Foundation Year Program

So, the cdf function 𝐹 𝑥 is

0 ,𝑥 < 1
𝑥2 1
𝐹 𝑥 = ൞8 −8 ,1 ≤ 𝑥 ≤ 3
1 ,𝑥 > 3

Caution!
Don’t forget to define 𝐹(𝑥) over the whole range (−∞, ∞)
Foundation Year Program

Example 6
The random variable X has probability density function:

Find F(x).
This time f(x) has two parts defined and so we need to
consider the two parts separately. We can use either
method 1 or 2 as above; it is personal preference.
Foundation Year Program

Solution
From the range given in pdf, we know that 𝐹 𝑥 = 0 for
𝑥 ≤ 1 and 𝐹 𝑥 = 1 for 𝑥 > 4.
Let’s consider the range 1 < 𝑥 < 2
1 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 + න 𝑓 𝑡 𝑑𝑡
−∞ 1

𝑥
= 0+ ‫׬‬1 0.2𝑑𝑡

= 0 + 0.2 𝑥 − 1 = 0.2(𝑥 − 1)
Note: A cdf of a continuous random variable is continuous.
This implies that we can write 1 ≤ 𝑥 ≤ 2 instead of 1 < 𝑥 < 2 for
𝐹 𝑥 = 0.2(𝑥 − 1)
Foundation Year Program

For 2 ≤ 𝑥 ≤ 4,

2 𝑥
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 + න 𝑓 𝑡 𝑑𝑡
−∞ 2
𝑥
= 𝐹 2 + න 𝑓 𝑡 𝑑𝑡 We find 𝐹(2) using
2 𝐹 𝑥 = 0.2 𝑥 − 1 for 1 < 𝑥 < 2

𝑥 𝑥
1 𝑡2 𝑡
= 0.2 2 − 1 + න 5
𝑡−1 𝑑𝑡 = 0.2 + −
10 5 2
2

𝑥2 𝑥 𝑥2 𝑥
= 0.2 + − −
10 5
0.4 − 0.4 = −
10 5
+15
Foundation Year Program

Again, we must write out 𝐹(𝑥) in full across the whole


range (–∞, ∞):

You can confirm that 𝐹(𝑥) is continuous by plugging the endpoints


of each interval into the two neighboring functions.
1 1 𝑥2 𝑥 1
For example: at 𝑥 = 2, 5
𝑥 −5 = 10
− 5
+5
Foundation Year Program

Example 7
The random variable X has cumulative distribution
function:

a) Find P(X ≤ 1.5).


b) Find P(0.5 ≤ X ≤ 1.5).
c) Find P(X = 1).
d) Find the probability density function, f(x).
Foundation Year Program

Solution

a) By the definition of a cdf,


1 3
𝑃 𝑋 ≤ 1.5 = 𝐹 1.5 = × 1.5 + × 1.52 = 0.6375
5 20

b) 𝑃 0.5 ≤ 𝑋 ≤ 1.5 = 𝐹 1.5 − 𝐹 0.5


1 3
= 0.6375 − × 0.5 + × 0.52 = 0.5
5 20

c) 𝑃 𝑋 = 1 = 0
Foundation Year Program

Solution (continued)
𝑑 1 3
d) 𝑓 𝑥 = 𝐹 𝑥 = + 𝑥,
𝑑𝑥 5 10
1 3
+ 𝑥 ,0 ≤ 𝑥 ≤ 2
𝑓 𝑥 = ൝5 10
0 , othewise
Note: we can solve (b) using a pdf as we saw in Example 3.

1.5 1 3 𝑥 3 2 1.5
𝑃 0.5 ≤ 𝑋 ≤ 1.5 = ‫׬‬0.5 5 + 𝑥 𝑑𝑥 = + 𝑥
10 5 20 0.5

1.5 3 2
0.5 3 2
= + 1.5 − + 0.5 = 0.5
5 20 5 20
Foundation Year Program

Learning outcomes:
7.1.1 Define a probability density function of a
continuous random variable.
7.1.2 Define a cumulative distribution function
of a continuous random variable.
7.1.3 Find probabilities using a probability
density function or a cumulative distribution
function.
Foundation Year Program

Preview: 7.2 Continuous Random Variables II

Probability density Mean, Variance,


function Mode
(pdf) (Lecture 7.2)
Continuous Random
Variables (CRVs)
Cumulative Median and
distribution function Quartiles
(cdf) (Lecture 7.2)

41

You might also like