Random Variables Apr 27
Random Variables Apr 27
Random Variables Apr 27
0 ( ) p s s
Example 3.3.2
Suppose a fair coin is tossed until a head comes
up for the first time. What are the chances
of that happening on an odd-numbered toss?
Example 3.3.4
Is this a discrete probability
function?
Example 3.3.5
Consider tossing two dice, an experiment for which the
sample space is a set of ordered pairs, S = {(i, j) I i = 1, 2,....6; j
= 1, 2,..., 6}.
For many games ranging from Monopoly to craps, what is
more important is the sum of the numbers showing, not the
observed ordered pair.
So the original sample space S of thirty-six ordered pairs is not
a convenient backdrop for discussing the rules.
better to work directly with the sums. The eleven possible
sums (from two to twelve) are the different values of the
random variable X, where X (i, j) = i + j.
The Probability Density Function
Definition 3.3.3. Associated with every discrete
random variable X is a probability density
function (or pdf), denoted p
x
(k), where
Note that p
x
(k) = 0 for any k not in the range of X.
For notational simplicity, we will usually delete all
references to s and S and write p
x
(k) = P(X = k).
Example: recall binomial and hypergeometric
distributions.
EXAMPLE 3.3.6
Consider again the rolling of two dice as
described in Example 3.3.5. Let i and j denote
the faces showing on the first and second die,
respectively, and define the random variable
X to be the sum of the two faces:
X(i,j) =i + j. Find p
x
(k).
Transformations
Theorem 3.3.1. Suppose X is a discrete random
variable with pdf p
x
(k) . Let Y = aX + b, where a
and b are constants. Then
The Cumulative Distribution Function
what if we need to calculate the probability
that the value of a random variable is
somewhere between two numbers,
from the pdf of X,
But calculating this sum from k=s to k=t may
be tedious.
Alternative strategy is to use the difference of
two cumulative probabilities of X:
( ) ( )
t
X
k s
P s X t p k
=
s s =
( ) ( ) ( 1) P s X t P X t P X s s s = s s
The Cumulative Distribution
Function
Definition
Let X be a discrete random variable. For any real
number t, the probability that X takes on a
value is the cumulative distribution
function (cdf) of X (written F
x
(t)).
Formally,
Or, deleting references to s and S,
t s
( ) ({ | ( ) )
X
F t P s S X s t = e s
( ) ( ( ) )
X
F t P X s t = s
Example 3.3.11
Suppose that two fair dice are rolled. Let the
random variable X denote the larger of the
two faces showing:
(a) Find F
x
(t) for t = 1,2,...,6
(b) Find F
x
(2.5).
Question 3.3.1
An urn contains five balls numbered 1 to 5. Two
balls are drawn simultaneously.
(a) Let X be the larger of the two numbers
drawn. Find p
x
(k).
(b) Let V be the sum of the two numbers drawn.
Find p
v
(k).
Question 3.3.4
Suppose a fair die is tossed three times. Let X be
the number of different faces that appear
(so X = 1,2, or 3). Find p
x
(k).
Continuous Random Variables
Because a continuous sample space has an
uncountably infinite number we cannot assign
a probability to each point as we did in the
discrete case using the function p(s).
But we can use the following example to
illustrate how we might define probabilities on
a continuous sample space
Illustration
Suppose an electronic surveillance monitor is turned on
briefly at the beginning of every hour and has a 0.905
probability of working properly, regardless of how long it
has remained in service.
Let random variable X denote the hour at which the
monitor first fails
p
x
(k) is the product of k individual probabilities:
p
x
(k) = (P(X = k)
= p(monitor fails for the first time at the kth hour)
= p(monitor functions properly for first k -1 hours monitor
fails at the kth hour)
1
(0.905) (0.0905), 1, 2, 3,...
k
k
= =
probability histogram of p
x
(k) for k values
ranging from 1 to 21 with superimposed
exponential curve :
height of the kth bar is p
x
(k), and since the width of each
bar is 1, the area of the kth bar is also p
x
(k).
The area under the exponential curve closely
approximates the area of the bars.
0
0.01
0.02
0.03
0.04
0.05
0.06
0.07
0.08
0.09
0.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
p
x
(
k
)
Hour when machine first fails
0.1
0.1
x
y e
=
So the probability that X lies in some given
interval is similar to the integral of the
exponential curve above that interval.
Example:
Probability that the monitor fails sometime during
the first four hours is
the corresponding area under the exponential
curve is the same up to four decimal places:
4 4
1
0 0
(0 4) ( ) (0.905) (0.095) 0.3297
k
X
k k
P X p k
= =
s s = = =
4
0.1
0
0.1 0.3297
x
e dx
=
}
Instead of defining probabilities for individual
points, define probabilities for intervals of
points
those probabilities will be areas under the
graph of some function like
the shape of the function will reflect the
desired probability "measure" to be
associated with the sample space
0.1
0.1
x
y e
=
Definition 3.4.1. A probability function P on a set
of real numbers S is called continuous if there
exists a function f(t) such that for any closed
interval [a, b] subset of S, .
Comment: suppose a function f(t) has the ff. properties:
1.
2.
If for all A (which is the case for a
probability function that satisfies Defn 3.4.1), then P will
satisfy the (Kolmogorov) probability axioms.
([ , ]) ( )
b
a
P a b f t dt =
}
( ) 0, f t t >
( ) 1 f t dt
=
}
( ) ( )
A
P A f t dt =
}
Choosing the function f(t)
The function f(t) is analogous to the function
p(s)=P(outcome is s).
f(t) defines the probability structure of S in the
sense that the probability of any interval in
the sample space is the integral of f(t).
Example 3.4.1
The continuous equivalent of the
equiprobable probability model on a discrete
sample space is the function f(t) defined by
f(t) = 1/(b - a) for all t in the interval [a, b] (and
f(t) = 0, otherwise). This particular I places
equal probability weighting on every closed
interval of the same length contained in the
interval [a, b].
Suppose a=0, b=10, and let A=[1,3], B = [6,8].
Then f(t) = 1/10, and
3 8
1 6
2
( ) (1/ 10) ( ) (1/ 10)
10
P A dt P B dt = = =
} }
Example 3.4.2
Could f(t) = 3t
2
, be used to define the
probability function for a continuous sample
space whose outcomes consists of all the real
numbers in the interval [0, 1]?
0 1 t s s
Example 3.4.3 The Normal
Distribution
Sample Space: real number line
Probability Function:
The graph can take on different forms
Depending on the values of and
2
1 1
( ) exp , , , 0
2
2
t
f t t
o
o
to
(
| |
= < < < < >
(
|
\ .
(
o
Continuous Probability Density
Functions
Definition 3.4.2. A function Y that maps a subset
of the real numbers into the real numbers is
called a continuous random variable. The pdf
of Y is the function f
Y
(y) having the property
that for any numbers a and b,
Continuous Cumulative
Distribution Functions
For discrete random variables the cdf is a
nondecreasing step function, where the
"jumps" occur at the values of t for which the
pdf has positive probability.
For continuous random variables, the cdf is a
monotonically nondecreasing continuous
function.
Definition 3.4.3. The cdf for a continuous
random variable Y is an indefinite integral of
its pdf:
Theorem 3.4.1. Let F
Y
(y) be the cdf of a
continuous random variable Y. Then
( ) ( ) ({ | ( ) }) ( )
y
Y Y
F y f r dr P s S Y s y P Y y
= = e s = s
}
( ) ( )
Y Y
d
F y f y
dy
=
Question 3.4.1
Suppose
Find
3
( ) 4 , 0 1.
Y
f y y y = s s
(0 1/ 2) P Y s s
Question 3.4.4.
For persons infected with a certain form of
malaria, the length of time spent in remission
is described by the continuous pdf f
Y
(y) = 1/9y
2
,
, where Y is measured in years.
What is the probability that a malaria patient's
remission lasts longer than one year?
0 3 Y s s