You are on page 1of 25

2

Random Variables

Background: A random variable is a function X : R which


associates each outcome with a real number.
Since the outcome of the experiment with sample space is
random, the number produced by the function is random as well.

Classification: (1) A random variable that can take on only a finite


or at most a countably infinite number of values is said to be a
discrete random variable.
(2) A random variable that can take on a continuum of values is
said to be a continuous random variable.

2.1

Discrete Random Variables

Frequency Function: The frequency function (or probability mass


function) p, defined on x1, x2, . . . by p(xi) = P (X = xi) with
P
i p(xi ) = 1, describes completely the probability properties of a
discrete random variable.

Bernoulli Random Variables: A Bernoulli random variable takes on


only two values, 0 and 1, with probabilities 1 p and p,
respectively.
Its frequency function is thus

px(1 p)1x ,
p(x) =

0,

if x = 0 or x = 1,
otherwise.

Binomial Distribution: Suppose that n independent experiments


(or trials) are performed, where n is a fixed number, and that each
trial results in a success with probability p and a failure with
probability 1 p.
The total number of successes, X, is a binomial random variable
with parameters n and p.

The probability that X = k is given by


 
n k
p(k) =
p (1 p)nk .
k
Let X1, X2, . . . , Xn be independent Bernoulli random variables
with P (Xi = 1) = p.
Then Y = X1 + X2 + + Xn is a binomial random variable.

Geometric Distribution: Suppose that a sequence of independent


Bernoulli trials is performed and X is the total number of trials up
to and including the first success.
Then X is a geometric random variable with
p(k) = P (X = k) = p(1 p)k1,

k = 1, 2, 3, . . . .

Negative Binomial Distribution: This is a generalization of the


geometric distribution
Suppose that a sequence of trials each with probability of success
p is performed until there are r successes in all.
Let X denote the total number of trials. Then


k1 r
P (X = k) =
p (1 p)kr ,
k = r, r + 1, . . . .
r1
8

Hypergeometric Distribution: Suppose that an urn contains n


balls, of which r are black and n r are white.
Let X denote the number of black balls drawn when taking m
balls without replacement.

X is a hypergeometric random variable with parameters r, n, and


m, and
 

r
nr
k
mk
 
P (X = k) =
.
n
m

10

Poisson Distribution: A Poisson random variable with parameter


> 0 has a frequency function given by
k e
P (X = k) =
,
k!

k = 0, 1, 2, . . . .

The Poisson frequency function can be used to approximate


binomial probabilities for large n and small p.

11

The Poisson distribution has been used in many areas, such as


(1) analysis of telephone systems
(2) modeling the number of alpha particles emitted from a
radioactive source during a given period of time
(3) modeling the number of freak accidents for a large population
of people in a given time period

12

2.2

Continuous Random Variables

Density Function: For a continuous random variable, the role of


the frequency function is taken by a density function, f (x), such
R
that f (x) 0, f is piecewise continuous, and f (x) dx = 1.
If X is a random variable with a density function f , then
Z b
f (x) dx.
P (a < X < b) =
a

13

Cumulative Distribution Function: The cdf of a continuous


random variable X is defined by
F (x) = P (X x) =

f (u) du.

From the fundamental theorem of calculus, if f is continuous at x,


f (x) = F (x).

14

Exponential Distribution: The exponential density function is

et,
t 0,
f (t) =

0,
t < 0.
The exponential distribution is often used to model lifetimes or
waiting times.

15

The memoryless property of the exponential distribution has


important implications here:
e(t+s)
P (T > t + s | T > s) =
= et = P (T > t).
s
e

16

Gamma Distribution: The gamma density function depends on two


parameters, > 0 (shape) and > 0 (scale):

1 t

t 0,
t e ,
()
f (t) =

0,
t < 0.
The gamma function, (x), is defined as
Z
(x) =
ux1eu du,
0

17

x > 0.

If = 1, the gamma density coincides with the exponential


density.
Gamma densities provide a fairly flexible class for modeling
nonnegative random variables.

18

Normal Distribution: The normal distribution plays a central role


in probability and statistics. The central limit theorem (Ch 5)
justifies the use of the normal distribution in many applications.
The density function of the normal distribution depends on two
parameters, R and > 0:
1
2
2
f (x) = e(x) /2 ,
2

19

< x < .

and are called the mean and standard deviation of the normal
density.
The cdf cannot be evaluated in closed form from this density
function and must be found numerically.
The special case for which = 0 and = 1 is called the standard
normal density. Its cdf is denoted by (tabulated) and its density
by .

20

2.3

Functions of a Random Variable

Proposition
If X N (, 2) and Y = aX + b, then Y N (a + b, a2 2).


X
x
It follows that Z =
N (0, 1) and FX (x) =
.

21

Example A: Scores on a certain standardized test, IQ scores, are


approximately normally distributed with mean = 100 and
standard deviation = 15.
An individual is selected at random. What is the probability that
his score X satisfies 120 < X < 130?

22

P (120 < X < 130) = P

120 100 X 100 130 100


<
<
15
15
15

= P (1.33 < Z < 2)


= (2) (1.33)
= 0.9772 0.9082 = 0.069.
Approximately 7% of the population will have scores in this range.

23

Proposition
(1) Let Z = F (X). Then Z has a uniform distribution on [0, 1].
(2) Let U be uniform on [0, 1], and let X = F 1(U ). Then the
cdf of X is F .
To generate random variables with cdf F , (2) suggests that we
just apply F 1 to uniform random numbers. This is quite practical
as long as F 1 can be calculated easily.

24

Proof: (1) P (Z z) = P (F (X) z) = P (X F 1(z)) =


F (F 1(z)) = z, which is the uniform cdf.
(2) P (X x) = P (F 1(U ) x) = P (U F (x)) = F (x).

25

You might also like