3/22/2021
Chapter 4
Continuous Random Variables and
Probability Distributions
Continuous Random Variables
An Example:
The dimensional length of a manufactured part is subject to
small variations in measurement due to vibrations,
temperature fluctuations, operator differences, calibration,
cutting tool wear, bearing wear, and raw material changes.
This length X would be a continuous random variable that would
occur in an interval (finite or infinite) of real numbers.
The number of possible values of X, in that interval, is
uncountably infinite and limited only by the precision of the
measurement instrument.
Can you think of other examples of continuous variables?
1
3/22/2021
Probability Density Function
A probability density function f(x) describes the probability
distribution of a continuous random variable. It is analogous
to the beam loading.
Figure Probability is determined from the area under f(x) from a to b.
If discrete: probability mass function 3
If continuous: probability density function
Probability Density Function
For a continuous random variable X ,
a probability density function is a function such that
(1) f x 0 means that the function is always non-negative.
(2)
f ( x)dx 1
b
(3) P a X b f x dx area under f x dx from a to b
a
(4) f x 0 means there is no area exactly at x.
*** probability of occurrence of a continuous r.v. is area under the curve (AUC).
***This curve is defined by f(x), i.e. probability density function.
4
2
3/22/2021
Example: Electric Current
Let the continuous random variable X denote the current
measured in a thin copper wire in milliampere (mA). Assume
that the range of X is:
0 ≤ x ≤ 20 and f(x) = 0.05.
What is the probability that a current is less than 10mA?
Figure P(X < 10).
Example: Hole Diameter
Let the continuous random variable X denote the diameter of a hole
drilled in a sheet metal component. The target diameter is 12.5
mm. Random disturbances to the process result in larger
diameters. Probability distribution of X can be modeled by:
f(x)= 20e-20(x-12.5), x ≥ 12.5 mm
If a part with a diameter larger than 12.60 mm is scrapped, what
proportion of parts is scrapped?
Figure 4-5 P X 12.60
20 x 12.5
20e
12.6
dx 0.135
6
3
3/22/2021
Example: Hole Diameter
Example (continued)
f(x)= 20e-20(x-12.5), x ≥ 12.5 mm
Cumulative Distribution Functions
The cumulative distribution function
of a continuous random variable X is,
x
F x P X x f u du for x (4-3)
4
3/22/2021
Cumulative Distribution Functions
Example
Example: Electric Current
For the copper wire current measurement in Exercise 1, the
cumulative distribution function (CDF) consists of three
expressions to cover the entire real number line.
0 x <0
F (x ) = 0.05x 0 ≤ x ≤ 20
1 20 < x
Figure This graph shows the CDF as a
continuous function.
10
5
3/22/2021
Mean and Variance
11
Example: Electric Current
For the copper wire current measurement in Exercise 1, the PDF is
f(x) = 0.05 for 0 ≤ x ≤ 20. Find the mean and variance.
Therefore, we have to integrate ( 0.05 x ) over [0 20] interval.
20 20
0.05 x 2
E X x f x dx 10
0
2 0
3 20
20
0.05 x 10
V X x 10 f x dx 33.33
2
0
3
0
12
6
3/22/2021
Example: Hole Diameter
For the drilling operation in Example 2, find the mean and
variance of X using integration by parts. Recall that f(x) = 20e-
20(x-12.5)dx for x ≥ 12.5.
EX xf x dx
20 x 12.5
12.5 12.5
x 20e dx
20 x 12.5
20 x 12.5 e
xe 12.5 0.05 12.55 mm
20 12.5
V X x 12.55 f x dx 0.0025 mm and 0.05 mm
2 2
12.5
13
Continuous Uniform Distribution
• This is the simplest continuous distribution and analogous to its
discrete counterpart (uniform discrete distr.).
• A continuous random variable X with probability density function
f(x) = 1 / (b-a) for a ≤ x ≤ b
X is a continuous r.v. which is defined between two values;
a and b.
The probability of X to be between a and b is constant.
Therefore, this is a uniform continuous distribution.
Figure Continuous uniform PDF 14
7
3/22/2021
Mean and Variance
• Mean & variance are:
a b b a
2
EX and V X
2
(4-7)
2 12
• Note that b2 - a2 = (b + a)(b - a)
15
Example: Uniform Current
Let the continuous random variable X denote the current
measured in a thin copper wire in mA. Recall that the PDF is
F(x) = 0.05 for 0 ≤ x ≤ 20.
What is the probability that the current measurement is
between 5 and 10 mA?
10
P 5 x 10 0.05dx 5 0.05 0.25
5
16
8
3/22/2021
Normal Distribution
• The most widely used distribution is the normal distribution,
also known as the Gaussian distribution.
• Random variation of many physical measurements are
normally distributed.
• The location and spread of the normal are independently
determined by mean (μ) and standard deviation (σ).
Figure Normal probability density functions with different and 2
17
Normal Probability Density Function
18
9
3/22/2021
Example: Normal Application
Assume that the current measurements in a strip of wire follows a normal
distribution with a mean of 10 mA & a variance of 4 mA2. Let X denote
the current in mA.
What is the probability that a measurement exceeds 13 mA?
The answer requires the integration of normal probability mass function
(see previous slide) over 13 and infinity.
AUC=P(x>13)
Figure Graphical probability that X > 13 for a normal random variable with μ = 10
and σ2 = 4.
19
19
Standard Normal Distribution
A normal random variable with
μ = 0 and σ2 = 1
Is called a standard normal random variable and is denoted as Z.
The cumulative distribution function of a standard normal
random variable is denoted as:
Φ(z) = P(Z ≤ z) = F(z)
Values are found in Appendix Table III and by using Excel and
Minitab.
20
10
3/22/2021
21
Example: Standard Normal Distribution
Assume Z is a standard normal random variable.
Find P(Z ≤ 1.50). Answer: 0.93319
Figure Standard normal PDF
Find P(Z ≤ 1.53): Answer: 0.93699
Find P(Z ≤ 0.02): Answer: 0.50398
22
11
3/22/2021
Example: Standard Normal Exercises
1. P(Z > 1.26) = 0.1038
2. P(Z < -0.86) = 0.195
3. P(Z > -1.37) = 0.915
4. P(-1.25 < 0.37) =
0.5387
5. P(Z ≤ -4.6) ≈ 0
6. Find z for P(Z ≤ z) =
0.05, z = -1.645
7. Find z for (-z < Z < z) =
0.99, z = 2.58
Figure Graphical displays for standard normal distributions.
23
Standardizing
24
12
3/22/2021
Example: Normally Distributed Current-1
From a previous example 9 10 x 10 11 10
with μ = 10 and σ = 2 mA, P 9 X 11 P 2 2 2
what is the probability P 0.5 z 0.5
that the current
P z 0.5 P z 0.5
measurement is between
0.69146 0.30854 0.38292
9 and 11 mA?
Using Excel
Answer: 0.38292 = NORMDIST(11,10,2,TRUE) - NORMDIST(9,10,2,TRUE)
Figure Standardizing a normal random variable. 25
Example: Normally Distributed Current-2
Determine the value for X 10 x 10
P X x P
which the probability 2 2
that a current x 10
PZ 0.98
measurement is below 2
this value is 0.98. z 2.05 is the closest value.
Answer: z 2 2.05 10 14.1 mA.
Using Excel
14.107 = NORMINV(0.98,10,2)
Figure Determining the value of x to meet a specified probability.
26
13
3/22/2021
Example: Shaft Diameter-1
The diameter of the shaft is normally distributed with μ = 0.2508
inch and σ = 0.0005 inch. The specifications on the shaft are
0.2500 ± 0.0015 inch. What proportion of shafts conform to
the specifications? Let X denote the shaft diameter in inches.
Answer: P 0.2485 X 0.2515
0.2485 0.2508 0.2515 0.2508
P Z
0.0005 0.0005
P 4.6 Z 1.4
P Z 1.4 P Z 4.6
0.91924 0.0000 0.91924
Using Excel
0.91924 = NORMDIST(0.2515, 0.2508, 0.0005, TRUE) - NORMDIST(0.2485, 0.2508, 0.0005, TRUE)
27
Example: Shaft Diameter-2
Most of the nonconforming shafts are too large, because the
process mean is near the upper specification limit. If the
process is centered so that the process mean is equal to the
target value, what proportion of the shafts will now conform?
Answer: P 0.2485 X 0.2515
0.2485 0.2500 0.2515 0.2500
P Z
0.0005 0.0005
P 3 Z 3
P Z 3 P Z 3
0.99865 0.00135 0.99730
Using Excel
0.99730 = NORMDIST(0.2515, 0.25, 0.0005, TRUE) - NORMDIST(0.2485, 0.25, 0.0005, TRUE)
By centering the process, the yield increased from 91.924% to
99.730%, an increase of 7.806%
28
14
3/22/2021
29
Empirical Rule: just to understand the normal distr.
P(μ – σ < X < μ + σ) = 0.6827
P(μ – 2σ < X < μ + 2σ) = 0.9545
P(μ – 3σ < X < μ + 3σ) = 0.9973
Figure Probabilities associated with a normal distribution.
30
30
15
3/22/2021
Covariance and Correlation
• Covariance and correlation coefficient as the degree of linear
relationship between two variables.
• Covariance between variables X and Y:
For population: XY
For samples: sXY
• Correlation between variables X and Y:
For population: rXY
For samples: rXY
• Correlation is the normalized version of covariance.
• Scatter plots: The data of two variables are plotted one
against to another.
31
Correlation Coefficient Matrix
EXAMPLE: Three different temperature readings in a process
Covariance btw T1 and T2: s12 = 0.895
Correlation btw T1 and T2: r12 = 0.930
T1 T2 T3
T1 1
T2 0.9302 1
T3 0.2060 0.1669 1
Covariance btw T1 and T3: s13 = 0.634
Correlation btw T1 and T3: r13 = 0.203
32
16
3/22/2021
Covariance and Correlation
Definition
Covariance is used to explain how random variables vary together.
So covariance is a measure of linear relationship between two random variables.
For any two random variables X and Y
-∞ < XY < ∞
33
Covariance and Correlation
• Correlation coefficient explains the relationship between two random variables, too.
• Different than covariance, correlation coefficient changes between -1and +1.
• For this reason, correlation coefficient can be more practical measure to tell the
relationship among variables.
34
17
3/22/2021
Bivariate Normal Distribution
The surface and contour plots of different bivariate normal distributions.
Figure. Examples of bivariate normal distributions.
35
Bivariate Normal Distribution
Definition
36
18
3/22/2021
Bivariate Normal Distribution
• Covariance and correlation coefficient
• X is a data matrix with dimension 42 x 7
• In Matlab, covariance and correlation matrices can be determined
>> load x.dat
>> x(1:10,1:5) %AS ONE PART OF THE DATA, THE FIRST 10 READINGS FOR 5 VARIABLES
8 98 7 2 12
7 107 4 3 9
7 103 4 3 5
10 88 5 2 8
6 91 4 2 8
8 90 5 2 12
9 84 7 4 12
5 72 6 4 21
7 82 5 1 11
8 64 5 2 13
>> cov(x(:,3),x(:,5)) %COV BETWEEN VAR3 AND VAR5
1.5221 2.3148
-- This is Covariance matrix, a symmetric matrix
2.3148 11.3635
>> corrcoef(x(:,3),x(:,5)) %CORR COEFF BETWEEN VAR3 AND VAR5
1.0000 0.5566 -- Correlation
0.5566 1.0000 coefficient matrix 37
Bivariate Normal Distribution
𝑆11 𝑆12
Sample Covariance Matrix = 𝑆 = where S12 = S21
𝑆21 𝑆22
1 𝑟12
Sample Correlation Coefficient Matrix = r = where r12 = r21
𝑟21 1
38
19
3/22/2021
Bivariate Normal Distribution
Example
Figure
39
20