3 - Random Variables (Discrete and Continuous Probability Distributions)
3 - Random Variables (Discrete and Continuous Probability Distributions)
2
Discrete Probability
Distributions
3
Random Variable
A statistical experiment is any process by which
several chance observations are generated. It is
often important to allocate a numerical description
to the outcome.
For example, the sample space giving a detailed
description of each possible outcome when 3
electronic components are tested is:
5
Random Variable
Denote capital letter X as a random variable,
with small letter x for one of its values with
defects. The random variable X assumes the
value of 2 for all elements in the subset,
6
Example
Two balls are drawn in succession without
replacement from a bag containing 4 red balls
and 3 black balls. The possible outcomes and
the values of y of the random variable Y, where
Y is the number of red balls, are:
Sample Space y
RR 2
RB 1
BR 1
BB 0
7
Example
A stockroom clerk returns 3 Sample m
Space
safety helmets at random to SJB 3
3 steel mill employees who SBJ 1
had previously checked BJS 1
them. If Smith, Jones, and JSB 1
Brown, in that order, receive JBS 0
one of the three hats, list the BSJ 0
sample points for possible
orders of returning the
helmets, and find the value
m of the random variable M
that represents the number
8
of correct matches.
Example
Consider the simple condition in which
components are arriving from a production line
and they are stipulated to be defective or not
defective. Define the random variable X by:
1, if the component is defective
𝑋=ቊ
0, if the component is not defective
13
Discrete Probability
Distributions
In the case of tossing a coin Sample m
Space
three times, the variable X, SJB 3
representing the number of SBJ 1
heads, assumes a value of 2 BJS 1
with probability of 3/8. JSB 1
From the previous stockroom JBS 0
example, the probability that BSJ 0
no employee gets back the
right helmet (or M assumes
the value of 0), is 2/6 or 1/3.
14
Discrete Probability
Distributions
m 0 1 3 Sample m
P(M = m) 1/3 1/2 1/6 Space
SJB 3
Frequently, it is convenient to
represent all the probabilities of a SBJ 1
random variable X by a formula. BJS 1
We write, JSB 1
𝑓 𝑥 = 𝑃(𝑋 = 𝑥)
JBS 0
so, 𝑓 3 = 𝑃 𝑋 = 3 = 1/6. The
set of ordered pairs, (𝑥, 𝑓 𝑥 ) is BSJ 0
called the probability density
function, probability mass
function, or probability
distribution of the discrete
random variable X.
15
Discrete Probability
Distributions
DEFINITION: The set of ordered pairs (𝑥, 𝑓 𝑥 ) is a probability function,
probability mass function, or probability distribution of the discrete
random variable X if, for each possible outcome x,
1. 𝑓 𝑥 ≥ 0;
2. σ𝑥 𝑓 𝑥 = 1 ;
3. 𝑃 𝑋 = 𝑥 = 𝑓(𝑥)
16
Example
A shipment of 20 similar laptop computers to a
retail outlet contains 3 that are defective. If a
school makes a random purchase of 2 of these
computer, find the probability distribution for the
number of defectives.
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = 𝑓(𝑡)
𝑡≤𝑥
0, for m < 0
1
, for 0 ≤ m < 1
𝐹 𝑚 = 3
5
, for 1 ≤ m < 3
6
1, for m ≥ 3 20
Example
If a car agency sells 50% of its inventory of a certain
foreign car equipped with side airbags, find the
cumulative distribution function of the random
variable X among the next 4 cars sold in this
category.
𝐹 0 =𝑓 0 = 1/16
𝐹 1 =𝑓 0 + 𝑓 1 = 5/16
𝐹 2 =𝑓 0 + 𝑓 1 + 𝑓(2) = 11/16
𝐹 3 =𝑓 0 + 𝑓 1 + 𝑓 2 + 𝑓(3) = 15/16
𝐹 4 =𝑓 0 + 𝑓 1 + 𝑓 2 + 𝑓 3 + 𝑓(4) = 1
22
Probability Histogram
23
Discrete Cumulative
Distribution Function
24
Continuous Probability
Distributions
25
Continuous Probability
Distribution
A continuous random variable has a probability of 0
assuming exactly any of its values. Consequently,
its probability distribution cannot be given in tabular
form.
For example, a random variable is discussed to be
values of heights of all people over 21 years of age.
Between any two values (163.5 and 164.5), there
are infinite number of heights, one of which is 164.
The probability of selecting a person at random who
is exactly 164 and not one of the infinitely large set
of heights close to 164 that you cannot humanly
measure is remote, thus we assign a probability of 0
to the event. 26
Continuous Probability
Distribution
This is not the case, however, if we take the
probability of selecting the person who is at
least 163cm but not more than 165cm tall.
Note that when X is continuous over the interval
𝑋 = 𝑎 to 𝑋 = 𝑏,
𝑃 𝑎 <𝑋 ≤𝑏 =𝑃 𝑎 <𝑋 <𝑏 +𝑃 𝑋 =𝑏
= 𝑃(𝑎 < 𝑋 < 𝑏)
Therefore, it does not matter whether we
include an endpoint of the interval or not. This is
not true, though, when X is discrete.
27
Continuous Probability
Distribution
The probability distribution of a continuous
random variable can be stated as a formula,
usually by a functional notation 𝑓(𝑥). In this,
𝑓(𝑥) is usually called the probability density
function (pdf), or density function, of X.
Since X is defined over a continuous sample
space, it is possible for f(x) to have a finite
number of discontinuities. However, most
density functions that have practical applications
in statistical data are continuous.
28
A pdf is constructed so that the area under its
curve bounded by the x-axis is always equal to 1
when computed over the range of X for which
f(x) is defined.
29
The probability that X assumes a value between a and b is
equal to the shaded area under the pdf between the ordinates
x=a and x=b.
𝑏
𝑃 𝑎 < 𝑋 < 𝑏 = න 𝑓 𝑥 𝑑𝑥
𝑎
30
Continuous Probability
Distributions
DEFINITION: The function 𝑓(𝑥) is a probability density function (pdf) for
the continuous random variable X, defined over the set of real numbers, if,
1. 𝑓 𝑥 ≥ 0, for all 𝑥 ∈ 𝑅.
∞
2. −∞ 𝑓 𝑥 𝑑𝑥 = 1
𝑏
3. 𝑃 𝑎 < 𝑋 < 𝑏 = 𝑥𝑑 𝑥 𝑓 𝑎
31
Example
Suppose that the error in the reaction
temperature, in degree Celsius, for a controlled
laboratory experiment is a continuous random
variable X having the probability density
function,
𝑥2
𝑓 𝑥 = ൞ 3 , −1 < 𝑥 < 2
0, elsewhere
(a) Verify that f(x) is a density function
(b) Find 𝑃(0 < 𝑋 ≤ 1).
32
Continuous Probability
Distributions
DEFINITION: The cumulative distribution function 𝐹(𝑥) of a continuous
random variable X with density function 𝑓(𝑥) is,
𝑥
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = න 𝑓 𝑡 𝑑𝑡
−∞
𝑑𝐹(𝑥)
if and only if, 𝑓 𝑥 = exists.
𝑑𝑥
33
Example
For the density function of the previous example,
find F(x) and use it to evaluate 𝑃(0 < 𝑋 ≤ 1).
Solution:
For the interval −1 < 𝑥 < 2,
𝑥 𝑥
𝑡2 𝑥3 + 1
𝐹 𝑥 = න 𝑓 𝑡 𝑑𝑡 = න 𝑑𝑡 =
−∞ −1 3 9
Therefore,
0, 𝑥 ≤ −1
𝑥3 + 1
𝐹 𝑥 = , −1 ≤ 𝑥 < 2
9
1, 𝑥 ≥ 2
34
Example
The cumulative
distribution F(x) is
expressed graphically
in the figure. Then,
𝑃 0<𝑋≤1
2 1
=𝐹 1 −𝐹 0 = −
9 9
1
=
9
35