0% found this document useful (0 votes)
19 views31 pages

2-Random Variables

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)
19 views31 pages

2-Random Variables

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/ 31

Random Variables and Probability Distributions

2-Random Variables and Probability Distributions

TeacherµQiang Ma(êr)

maqiang809@scu.edu.cn
Random Variables and Probability Distributions

Contents

1 Random variables

2 Discrete random distribution

3 Continuous probability distributions

4 Joined Probability Distributions


Random Variables and Probability Distributions
Random variables

Random variables

Motivation:
definition, computation and properties of probability
P (.): only set function, not real function
Can we use real functions to solve probability?
Yes, we need random variable and distribution function

Definition 1
A random variable is a function that associates a real number with each
element in the sample space, which can be denoted by X, Y, Z.

X : S → R: Mapping from sample space S to the real number set R.


Example 2
Flip a coin twice, the sample space S = {HH, HT, T H, T T }, let the
random variable X be the number of heads.
Random Variables and Probability Distributions
Random variables

Example 3
Consider the simple condition in which components are arriving from the
production line and they are stipulated to be defective or not defective.
Define the random variable X by

1, defective
X=
0, not defective

X is called Bernoulli random variable.


Example 4
Let X be the random variable defined by the waiting time, in hours, be-
tween successive speeders spotted by a radar unit. The random variable
X takes on all values x for which x ≥ 0.
Random Variables and Probability Distributions
Random variables

Discrete and continuous sample spaces

Definition 5
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.

A random variable is called a discrete random variable if its set of


possible outcomes is countable.
Definition 6
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.

When a random variable can take on values on a continuous scale, it is


called a continuous random variable.
Random Variables and Probability Distributions
Discrete random distribution

Frequently, it is convenient to represent all the probabilities of a ran-


dom variable X by a formula.
Such a formula would necessarily be a function of the numerical values
x that we shall denote by f (x), g(x), r(x), and so forth.
f (x) = P (X = x); that is, f (3) = P (X = 3)
The set of ordered pairs (x, f (x)) is called the probability distribution
of the discrete random variable X.

Definition 7
The set of ordered pairs (x, f (x)) is a probability function of the discrete
random variable X if, for each possible outcome x,
1 f (x) ≥ 0.
P
x f (x) = 1.
2

3 P (X = x) = f (x).
Random Variables and Probability Distributions
Discrete random distribution

Example 8
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
computers, find the probability distribution for the number of detectives.
Random Variables and Probability Distributions
Discrete random distribution

Example 8
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
computers, find the probability distribution for the number of detectives.
Solution: 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. Now

    
17 3 17 3

    
2 0 68 1 1 51
P (X = 0) = f (0) =   = , P (X = 1) = f (1) =   = ,
20 95 20 190
   
2 2
  
17 3
  
0 2 3
P (X = 2) = f (2) =   = ,
20 190
 
2
Random Variables and Probability Distributions
Discrete random distribution

Example 8
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
computers, find the probability distribution for the number of detectives.
Solution: 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. Now

    
17 3 17 3

    
2 0 68 1 1 51
P (X = 0) = f (0) =   = , P (X = 1) = f (1) =   = ,
20 95 20 190
   
2 2
  
17 3
  
0 2 3
P (X = 2) = f (2) =   = ,
20 190
 
2

Then the probability distribution of X is

x 0 1 2
68 51 3
f (x)
95 190 190
Random Variables and Probability Distributions
Discrete random distribution

There are many problems where we may wish to compute the proba-
bility that the observed value of a random variable X will be less than
or equal to some real number x.
Writing F (x) = P (X ≤ x) for every real number x, we define F (x)
to be the cumulative distribution function of the random variable X.

Definition 9
The cumulative distribution function(CDF) F (x) of a discrete random vari-
able X with probability distribution f (x) is
X
F (x) = P (X ≤ x) = f (t), for − ∞ < x < ∞.
t≤x

The cumulative distribution function of the previous examples is




 0, x < 0,
 68 , 0 ≤ x < 1,

F (x) = 95187
 , 1 ≤ x < 2,
 190


1, x ≥ 2.
Random Variables and Probability Distributions
Discrete random distribution

Properties of CDF

1 Domain: (−∞, +∞). Range: [0, 1]


F (−∞) = lim F (x) = 0, F (+∞) = 1
x→−∞

2 Monotonicity: non-decreasing
∀x1 < x2 , F (x1 ) ≤ F (x2 )
3 Continuity: right continuous
F (x0 + 0) = lim+ F (x) = F (x0 )
x→x0

4 P (a < X ≤ b) = F (b) − F (a), P (X = a) = F (a) − F (a − 0)


Random Variables and Probability Distributions
Continuous probability distributions

Continuous probability distribution and density function


A continuous random variable has a probability of 0 of assuming ex-
actly any of its values.
P (X = a) = F (a) − F (a − 0) = F (a) − F (a) = 0
Consequently, its probability distribution cannot be given in tabular
form.
In dealing with continuous variables, f (x) is usually called the prob-
ability density function, or simply the density function, of X.

Figure 3.1: Typical density function


Random Variables and Probability Distributions
Continuous probability distributions

A probability density function is constructed so that the area under


its curve bounded by the x axis is equal to 1 when computed over the
range of X for which f (x) is defined.
The probability that X assumes a value between a and b is equal to
the shaded area under the density function between the ordinates at
x = a and x = b.
Z b
P (a < X < b) = f (x)dx.
a
Random Variables and Probability Distributions
Continuous probability distributions

Definition 10
The function f (x)is a probability density function(pdf) for the continuous
random variable X, defined over the set of real numbers, if
1 f (x) ≥ 0, for all x ∈ R.
R∞
2
−∞
f (x) = 1.
Rb
3 P (a < X < b) = a f (x)dx.

Definition 11
The cumulative distribution function F (x) of a continuous random variable
X with density function f (x) is
Z x
F (x) = P (X ≤ x) = f (x)dx, for − ∞ < x < ∞.
−∞

We have the relations


dF (x)
P (a < X < b) = F (b) − F (a), f (x) =
dx
Random Variables and Probability Distributions
Continuous probability distributions

Example 12
Suppose that the error in the reaction temperature, in ◦ C, for a controlled
laboratory experiment is a continuous random variable X having the prob-
ability density function

 x2
f (x) = , −1 < x < 2,
0,3 elsewhere.

1 Verify that f (x) is a density function.


2 Find P (0 < X ≤ 1).
3 Find the cumulative distribution function F (x).
Random Variables and Probability Distributions
Continuous probability distributions

Example 13
The proportion of people who respond to a certain mail-order solicitation
is a continuous random variable X that has the density function

 2(x + 2)
, 0 < x < 1,
f (x) =
0, 5elsewhere.

1 Show that P (0 < X < 1) = 1.


2 Find the probability that more than 1/4 but fewer than 1/2 of the
people contacted will respond to this type of solicitation.
Random Variables and Probability Distributions
Joined Probability Distributions

joint probability distribution

There will be situations,where we may find it desirable to


record the simultaneous outcomes of several random vari-
ables.
If X and Y are two discrete random variables, the proba-
bility distribution for their simultaneous occurrence can be
represented by a function with values f (x, y) for any pair
of values (x, y) within the range of the random variables X
and Y .
It refers as the joined probability distribution of X and Y .
f (x, y) = P (X = x, Y = y).
Random Variables and Probability Distributions
Joined Probability Distributions

joint probability distribution

Definition 14
The function f (x, y) is a joint probability distribution of the discrete ran-
dom variables X and Y if
1 f (x, y) ≥ 0 for all (x, y),
P P
y f (x, y) = 1
2
x
3P (X = x, Y = y) = f (x, y)
PP
For any region A in the xy plane, P [(X, Y ) ∈ A] = A f (x, y).

Example 15
Two ballpoint pens are selected at random from a box that contains 3
blue pens, 2 red pens, and 3 green pens. If X is the number of blue pens
selected and Y is the number of red pens selected, find
1 The joint probability function f(x, y),
2 P [(X, Y ) ∈ A], where A is the region {(x, y)|x + y ≤ 1}.
Random Variables and Probability Distributions
Joined Probability Distributions

Solution: (a)

Figure 4.1: Joint Probability Distribution

(b) The probability that (X, Y ) fall in the region A is

P [(X, Y ) ∈ A] =P (X + Y ≤ 1) = f (0, 0) + f (0, 1) + f (1, 0)


3 3 9 9
= + + =
28 14 28 14
Random Variables and Probability Distributions
Joined Probability Distributions

When X and Y are continuous random variables, the joint density


function f (x, y) is a surface lying above the xy plane.
P [(X, Y ) ∈ A], where A is any region in the xy plane, is equal to the
volume of the right cylinder bounded by the base A and the surface.

Definition 16
The function f (x, y) is a joint density function of the continuous random
variables X and Y if
1 f (x, y) ≥ 0, for all (x, y),
R∞ R∞
2
−∞ −∞
f (x, y)dxdy = 1
RR
3 P [(X, Y ) ∈ A] = A
f (x, y)dxdy, for any region A in the xy plane.
Random Variables and Probability Distributions
Joined Probability Distributions

Example 17
A privately owned business operates both a drive-in facility and a walk-in
facility. On a randomly selected day, let X and Y , respectively, be the
proportions of the time that the drive-in and the walk-in facilities are in
use, and suppose that the joint density function of these random variables
is (2
(2x + 3y), 0 ≤ x ≤ 1, 0 ≤ y ≤ 1,
f (x, y) = 5
0 elsewhere

1 Verify condition 2 of Definition 16.


1 1 1
2 Find P [(X, Y ) ∈ A], where A = {(x, y)|0 < x < , <y< }
2 4 2
Random Variables and Probability Distributions
Joined Probability Distributions

Given the joint probability distribution f (x, y) of the discrete random


variables X and Y , the probability distribution g(x) of X alone is
obtained by summing f (x, y) over the values of Y
Similarly, the probability distribution h(y) of Y alone is obtained by
summing f (x, y) over the values of X.
We define g(x) and h(y) to be the marginal distributions of X and
Y , respectively.
When X and Y are continuous random variables, summations are
replaced by integrals.

Definition 18
The marginal distributions of X alone and of Y alone are
X X
g(x) = f (x, y), h(y) = f (x, y)
y x

for the discrete case, and


Z ∞ Z ∞
g(x) = f (x, y)dy, h(y) = f (x, y)dx
−∞ −∞

for the continuous case.


Random Variables and Probability Distributions
Joined Probability Distributions

Figure 4.2: Joint Probability Distribution

x 0 1 2
The marginal distribution of X is 5 15 3
f (x)
14 28 28
y 0 1 2
and the marginal distribution of Y is 15 3 1
f (y)
28 7 28
Random Variables and Probability Distributions
Joined Probability Distributions

Definition 19
Let X and Y be two random variables, discrete or continuous. The con-
ditional distribution of the random variable Y given that X = x is
f (x, y)
f (y|x) = ,
g(x)
provided g(x) > 0. Similarly, the conditional distribution of X given that
Y = y is
f (x, y)
f (x|y) = ,
h(y)
provided h(y) > 0.
Random Variables and Probability Distributions
Joined Probability Distributions

Figure 4.3: Joint Probability Distribution

What is the conditional distribution of X given Y = 0?


Random Variables and Probability Distributions
Joined Probability Distributions

Figure 4.3: Joint Probability Distribution

What is the conditional distribution of X given Y = 0?


P (X = k, Y = 0)
P (X|Y = 0) = , k = 0, 1, 2.
P (Y = 0)
Random Variables and Probability Distributions
Joined Probability Distributions

Example 20
The joint density for the random variables (X, Y ), where X is the unit
temperature change and Y is the proportion of spectrum shift that a certain
atomic particle produces, is

10xy 2 , 0 < x < y < 1



f (x, y) =
0 elsewhere,

(a) Find the marginal densities g(x), h(y), and the conditional density
f (y|x).

(b) Find the probability that the spectrum shifts more than half of the
total observations, given that the temperature is increased by 0.25
unit.
Random Variables and Probability Distributions
Joined Probability Distributions

Solution: (a) By definition


Z ∞ Z 1
10
g(x) = f (x, y)dy = 10xy 2 dy = x(1 − x3 ), 0 < x < 1.
−∞ x 3
Z ∞ Z y
h(y) = f (x, y)dx = 10xy 2 dy = 5y 4 , 0 < y < 1.
−∞ 0

Now
f (x, y) 3y 2
f (y|x) = = , 0 < x < y < 1.
g(x) 1 − x3
(b) Therefore,
1 1
3y 2
Z Z
1 8
P (Y > |X = 0.25) = f (y|x = 0.25)dy = 3
dy =
2 1/2 1/2 1 − 0.25 9
Random Variables and Probability Distributions
Joined Probability Distributions

Definition 21
Let X and Y be two random variables, discrete or continuous, with joint
probability distribution f (x, y) and marginal distributions g(x) and h(y),
respectively. The random variables X and Y are said to be statistically
independent if and only if
f (x, y) = g(x)h(y)
for all (x, y) within their range.
Random Variables and Probability Distributions
Joined Probability Distributions

Example 22
Suppose that the shelf life, in years, of a certain perishable food product
packaged in cardboard containers is a random variable whose probability
density function is given by
 −x
e , x>0
f (x) =
0 elsewhere

Let X1 , X2 ,and X3 represent the shelf lives for three of these containers
selected independently and find P (X1 < 2, 1 < X2 < 3, X3 > 2).
Random Variables and Probability Distributions
Joined Probability Distributions

Example 22
Suppose that the shelf life, in years, of a certain perishable food product
packaged in cardboard containers is a random variable whose probability
density function is given by
 −x
e , x>0
f (x) =
0 elsewhere

Let X1 , X2 ,and X3 represent the shelf lives for three of these containers
selected independently and find P (X1 < 2, 1 < X2 < 3, X3 > 2).
Solution: We can assume that the random variables X1 , X2 ,and X3 are
statistically independent, having the joint probability density

f (x1 , x2 , x3 ) = f (x1 )f (x2 )f (x3 ) = e−x1 e−x2 e−x3 = e−x1 −x2 −x3 ,

for x1 > 0, x2 > 0, x3 > 0, and f (x1 , x2 , x3 ) = 0 elsewhere. Hence


Z ∞Z 3Z 2
P (X1 < 2, 1 < X2 < 3, X3 > 2) = e−x1 −x2 −x3 dx1 dx2 dx3
2 1 0
=(1 − e−2 )(e−1 − e−3 )e−2 = 0.0372

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy