0% found this document useful (0 votes)
2 views35 pages

3 - Random Variables (Discrete and Continuous Probability Distributions)

The document outlines the concepts of random variables, including discrete and continuous probability distributions, and their applications in statistical analysis. It defines random variables, provides examples of their use in various scenarios, and explains the probability mass function and cumulative distribution function. Additionally, it discusses the characteristics of continuous random variables and their probability density functions.
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)
2 views35 pages

3 - Random Variables (Discrete and Continuous Probability Distributions)

The document outlines the concepts of random variables, including discrete and continuous probability distributions, and their applications in statistical analysis. It defines random variables, provides examples of their use in various scenarios, and explains the probability mass function and cumulative distribution function. Additionally, it discusses the characteristics of continuous random variables and their probability density functions.
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/ 35

3: Random Variables

EM 7: Engineering Data Analysis


Second Semester, 2021-2022
Lecture Outline
• Discrete probability distributions
• Continuous probability distributions
• Joint probability distributions
• Marginal and conditional probability
distributions
• Statistical independence

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:

𝑆 = 𝑁𝑁𝑁, 𝑁𝑁𝐷, 𝑁𝐷𝑁, 𝐷𝑁𝑁, 𝑁𝐷𝐷, 𝐷𝑁𝐷, 𝐷𝐷𝑁, 𝐷𝐷𝐷

Where, N denotes non-defective and D denotes


defective. 4
Random Variable
𝑆
= 𝑁𝑁𝑁, 𝑁𝑁𝐷, 𝑁𝐷𝑁, 𝐷𝑁𝑁, 𝑁𝐷𝐷, 𝐷𝑁𝐷, 𝐷𝐷𝑁, 𝐷𝐷𝐷
If concerned with the number of defectives, we
can assign a numerical value of 0, 1, 2, or 3.
These values are random quantities determined
by the outcome of the experiment, assumed by
the random variable X.
DEFINITION: A random variable is a function that associates a real
number with each element in the sample space.

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

For this the assignment of 1 or 0 is arbitrary


through quite convenient. The random variable
for which 0 and 1 are chosen to describe two
possible values is called a Bernoulli random
variable. 9
Example
Statisticians use sampling plans to either
accept or reject batches or lots of material.
Suppose one of these sampling plans involves
sampling independently 10 items from a lot of
100 items in which 12 are defective.

Let X be the random variable defined as the


number of items found defective in the sample
of 10. In this case, the random variable takes on
the values 0, 1, 2, …, 9, 10.
10
Example
Suppose a sampling plan involves sampling
items from a process until a defective is
observed. The evaluation of the process will
depend on how many consecutive items are
observed.
In that regard, let X be a random variable
defined by the number of items observed before
a defective is found. With N a non-defective and
D a defective, sample spaces are 𝑆 = {𝐷} given
𝑋 = 1; 𝑆 = {𝑁𝐷}, given 𝑋 = 2; 𝑆 = {𝑁𝑁𝐷} given
𝑋 = 3; and so on…
11
Random Variable
DEFINITION: If a sample space contains a finite number of possibilities or
an unending sequence with as many elements as there are whole
numbers, it is called a discrete sample space.

DEFINITION: If a sample space contains an infinite number of possibilities


equal to the number of points on a line segment, it is called a continuous
sample space.

In most practical problems, continuous random


variables represent measured data, such as all
possible heights, weights, temperatures,
distances, or life periods, whereas discrete
random variables represent count data, such as
the number of defectives in a sample of k items,
or the number of highway fatalities per year. 12
Random Variable
A random variable is called a discrete random
variable if its set of possible outcomes is
countable.
When a random variable can take on values on
a continuous scale, it is called a continuous
random variable.

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.

Let X be a random variable whose values x are


the possible numbers of defective computers
purchased by the school. Then x can only take
the numbers 0, 1, and 2.
17
Example
3 17
𝑓 0 =𝑃 𝑋=0 = 0 2 = 68
20 95
2
3 17
𝑓 1 =𝑃 𝑋=1 = 1 1 = 51
20 190
2
3 17
𝑓 2 =𝑃 𝑋=2 = 2 0 = 3
20 190
2

The probability distribution of X is:


x 0 1 2
f(x) 68/95 51/190 3/190
18
Discrete Probability
Distributions
There are many problems where we may wish
to compute the probability that the observed
value of a random variable X will be less than or
equal to some real number x. Writing 𝐹 𝑥 =
𝑃(𝑋 ≤ 𝑥) for every real number x, F(x) is the
cumulative distribution function of the
random variable X.
DEFINITION: The cumulative distribution function 𝐹(𝑥) of a discrete random
variable X with probability distribution 𝑓(𝑥) is,

𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = ෍ 𝑓(𝑡)
𝑡≤𝑥

for −∞ < 𝑥 < ∞. 19


Discrete Probability
Distributions
For the random variable M in the stockroom
example, the number of correct matches is:
1 1 5
𝐹 2 =𝑃 𝑀 ≤2 =𝑓 0 +𝑓 1 = + =
3 2 6
The cumulative distribution function of M is:

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.

Probability distribution 𝑓 𝑥 = 𝑃(𝑋 = 𝑥) is,


1 4
𝑓 𝑥 =
16 𝑥

From this, 𝑓 0 = 1/16, 𝑓 1 = 1/4, 𝑓 2 = 3/8,


𝑓 3 = 1/4, and 𝑓 4 = 1/16.
21
Example
Therefore,

𝐹 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,
𝑥
𝐹 𝑥 = 𝑃 𝑋 ≤ 𝑥 = න 𝑓 𝑡 𝑑𝑡
−∞

for −∞ < 𝑥 < ∞.

As a consequence, we can write:


𝑃 𝑎 < 𝑋 < 𝑏 = 𝐹 𝑏 − 𝐹(𝑎)

𝑑𝐹(𝑥)
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

You might also like