Вы находитесь на странице: 1из 23

ST259 Probability I

Discrete Random Variables and Probability


Distributions
c
Mark
Reesor
mreesor@wlu.ca

Tower

Discrete RVs

Random Variables

Definition: Random Variable


For a given sample space S of some experiment, a random
variable is any rule that associates a number with each
outcome in S. In other words, a random variable is a function
whose domain is S and whose range is the set of real numbers.
Typically use uppercase letters to denote random variables
W, X, Y, Z
X :SR
Use lowercase letters to denote the value of a random
variable associated an outcome
X (s) = x
Tower

Discrete RVs

Random VariablesExample
Jays play a best-of-three series against the Yankees
S = {LL, WW , LWW , WLW , WLL, LWL}
Define X as
X (LL) = 0
X (WLL) = X (LWL) = 1
X (WW ) = X (LWW ) = X (WLW ) = 2
Define Y as
Y (LL) = Y (WW ) = 2
Y (LWW ) = Y (WLW ) = Y (WLL) = Y (LWL) = 3
Define Z as
Z (LL) = Z (WLL) = Z (LWL) = 0
Z (WW ) = Z (WLW ) = Z (LWW ) = 1
Tower

Describe in words X , Y , Z
Discrete RVs

Random Variables Notation

Definition: Any random variable whose only possible


values are 0 and 1 is called a Bernoulli or indicator
random variable
In the above example Z is a Bernoulli RV
If X is a RV and a, b R we write
{X = a} = {s S|X (s) = a}
{X a} = {s S|X (s) a}
{a < X b} = {s S|a < X (s) b} = {a < X } {X b}
and so on

Example: Let X be a RV. Simplify


1
2

{X 15} {X 20}
{X 20} {X 15}0
Tower

Discrete RVs

Random Variables Continuous and Discrete

Definition: A discrete random variable is an RV whose


possible values either constitute a finite set or else can be
listed in an infinite sequence in which there is a first
element, a second element, and so on.
Definition: A random variable is continuous if BOTH of
the following apply
Its set of possible values consists either of all numbers in a
single interval on the number line (possibly infinite in extent)
or all numbers in a disjoint union of such intervals.
No possible value of the variable has positive probability,
that is, P(X = c) = 0 for any possible value c.

Tower

Discrete RVs

Probability Mass Function (pmf)

Definition: The probability distribution or probability


mass function (pmf) of a discrete random variable is
defined for every number x by
pX (x) = p(x) = P(X = x) = P(all s S : X (s) = x)
P
Note: pX (x) 0 for all x and
pX (x)=1
Example: Find the pmf for X , Y , Z in the best-of-three
game series example. Draw a line graph of each pmf.

Tower

Discrete RVs

Probability Mass Function

Example: Two fair dice are tossed. Let X denote the total
of the two faces.
Find the pmf of X and draw its line graph.
Compute P(X 8) and P(3 X < 6).
Find the pmf of Y = (X 7)2

Tower

Discrete RVs

Cumulative Distribution Function

Definition: Let X be a random variable. The cumulative


distribution function (cdf) of X is denoted FX (or simply F )
and is defined by
FX (x) = P(X x),

x R

Note that Fx : R [0, 1]


Example: Find and sketch the cdf for X in the
best-of-three series example.
Exercise: Find and sketch the cdf for Y and Z in the
best-of-three series example.
Tower

Discrete RVs

Properties of Cumulative Distribution Function

If X is any random variable, then


FX (x) FX (y ) whenever x y (cdfs are non-decreasing)
lim FX (x) = 0 and

lim FX (x) = 1

P(X = a) = FX (a) limxa Fx (x) = FX (a) FX (a )


If FX is continous at x = a, then P(X = a) = 0
P(X = a) > 0 iff FX is discontinuous at x = a.
for any numbers a b, P(a X b) = F (b) F (a )

Tower

Discrete RVs

Expected Values
Two evenly matched teams play a best of seven series and
X denotes the length of the series. Give a table that
describes pX
Now suppose we observed a large number, N, of such
series. Let X1 , X2 , . . . , XN denote the lengths of each
series and N4 , N5 , N6 , N7 denote the number of times the
series goes to k games, k = 4, 5, 6, 7.
Would expect
Note also that

Nk
N

PN

i=1 Xi

P7

k =4 kNk

The average length of the series should be


X1 + X2 + + XN
4N4 + 5N5 + 6N6 + 7N7
=
N
N
Tower

Discrete RVs

Expected Value
Definition: Let X be a discrete random variable with set of
possible values D and pmf pX . The expected value or
mean value of X is denoted E[X ] or x is defined via
X
E[X ] = x =
x pX (x)
xD

This
P expected value will exist provided that
xD |x|pX (x) <
If the experiment is repeated a large number of times, and
if Xi =outcome of i th repetition, then
X1 + X2 + + XN
E[X ]
N
and

X1 + X2 + + XN
= E[X ]
N
N
lim

Discrete RVs

Tower

Expected Value

Example: Consider placing a bet of $B. If you place the


bet and you win, you receive $(W + B), otherwise you
receive nothing. Let p be the probability of winning the bet
(if you place the bet).
1

2
3

If p = 0.1, B = 10 and W = 110 what is the expected net


profit from placing the bet? What is the expected net profit
of the person taking (on the other side of) the bet?
Repeat the above with B = 50 and W = 150.
Under what conditions on p, B, and W should you place the
bet? Would you want to take (the other side of) the bet
under these circumstances?
Have you ever bought a lottery ticket? Why?

Tower

Discrete RVs

Expected Value of a Function of a RV


Proposition: If the discrete RV X has set of possible
values DX and pmf pX , then the expected value of any
function h(X ), denoted by E[h(X )] or h(X ) is computed by
E[h(X )] =

h(x)pX (x)

xDX

assuming that

xDX

|h(x)|pX (x) < .

Let Y = h(X ), a discrete RV with set of possible values DY


and pmf pY . Then the expected value can be computed
using either (DY , pY ) or (DX , pX ), namely
X
X
ypY (y ) = E[Y ] = E[h(X )] =
h(x)pX (x)
y DY

xDX
Tower

Discrete RVs

Expected Value of a Function of a RV


Example: Suppose X has pmf pX (x) = 1/3 for
x = 1, 0, 1 and Y = X 2 .
1
2
3

Compute E[Y ] in two ways.


Compute E[X ].
What do the answers imply about E[X ] and E[X 2 ] for any
RV X ?

Really, really important fact: For any RV X and function


g for which E[g(X )] is defined (finite)
E[g(X )] 6= g(E[X ]) (in general)
Proposition: For any constants a, b,
E[aX + b] = aE[X ] + b = aX +b = aX + b
Defining the linear function g(x) = ax + B, we see that
E[g(X )] = E[aX + b] = aE[X ] + b = g(E[X ])
Tower

Note that this only holds for linear functions


Discrete RVs

Expected Value of a Function of a RV

Note: Suppose X is a discrete RV and g1 , g2 , . . . , gn are


functions for which E[gi (X )] is well defined. Then
E[g1 (X ) + g2 (X ) + + gn (X )] = E[g1 (X )] + + E[gn (X )]
Expected value of a sum of functions of X is the sum of the
expected values.
E[X 2 eX + cos(X )] =?
Example: If the mean of 3X 7 is 4, then what is the
mean of X ?

Tower

Discrete RVs

Variance
Defintion: Let X be a discrete RV with pmf pX and
expected value . Then the variance of X , denoted Var [X ]
or X2 or 2 is
Var [X ] = E[(X )2 ] =

(x )2 pX (x)

xDX

The standard deviation (SD) of X is X =

q
X2

In general, variance increases in magnitude with the


likelihood of extreme values.
Variance (standard deviation) measures how spread out
the distribution is
In finance variance (standard deviation) is synonymous
with risk
Discrete RVs

Tower

Example
The percentage returns on three different stocks A, B, C are
random variables with the following pmfs
-5
1
7
r
P(RA = r ) 0.25 0.50 0.25
P(RB = r ) 0.1
0.8
0.1
r
-10
1
12
P(RC = r ) 0.1
0.8
0.1
Exercise: Show that the expected return on all three
stocks is 1%. (e.g., A = B = C = 1).
Question: You have $100 to invest and you can only
invest in a single stock. Which one do you prefer? Why?
Compute the variance of the returns for all three stocks.
Discuss.
In view of the variances of the returns, which stock do you
prefer to invest in? Why?
Discrete RVs

Tower

Shortcut Formula for Variance

Shortcut Formula for 2 : Let X be a discrete RV with pmf


pX and expected value . Then the variance of X can be
computed using the shortcut formula
X
Var [X ] = 2 =
x 2 pX (x) 2 = E[X 2 ] (E[X ])2
xDX

Example: Use the shortcut formula to compute the


variance of stock As return in the previous example.
Fact: If X is a RV and a, b are constants then
Var [aX + b] = a2 Var [X ] = a2 X2
Tower

Discrete RVs

Moments
Definition: Expected values of powers of X are called
moments about 0 or simply moments
E[X ] is the first moment about 0
E[X 2 ] is the second moment about 0
E[X r ] is the r th moment about 0

Definition: Expected values of powers of X are called


moments about the mean or central moments
E[(X )] is the first moment about the mean
what does E[(X )] =?
E[(X )2 ] is the second moment about the mean
Also known as???
E[(X )r ] is the r th moment about the mean
Tower

Discrete RVs

Moment Generating Function


Consider the Bernoulli RV X that is 0 with probability 1/3
and is 1 with probability 2/3.
Compute
E[eX ]
E[e2X ]
E[etX ] for any t R

Plot M(t) = E[etX ] as a function of t


Compute M 0 (t) and M 00 (t) and evaluate these derivatives
at t = 0.
Definition: Let X be a RV. The moment generating
function of X is denoted by MX (t) (or simply M(t)) and is
defined by
MX (t) = E[etX ]
The domain of MX is all t for which E[etX ] is well-defined.
Discrete RVs

Tower

Moment Generating Function

Example: Suppose that X has pmf


 
1 5 x
p(x) =
for x = 0, 1, 2, . . .
6 6
Find the mgf of X and state its domain.
Note: MX (t) = E[etX ] 0 for all t in the domain of the mgf
Note: MX (0) = E[e0X ] = E[1] = 1

Tower

Discrete RVs

Moment Generating Function

Fact: Suppose that MX (t) is well defined on (, ) for


some > 0. Then for any k 0
(k )

MX (0) = E[X k ]
Taking derivatives of mgf and evaluating at zero computes
moments of the RV X .
Example: For the Example on Slide 21, compute the
mean and variance of X using the mgf

Tower

Discrete RVs

Moment Generating Function

Example: Suppose that MX (t) = et


1
2
3

2 /2

Find the mean and variance of X


Compute the mean and variance of Y = eX .
Find the moment generating function of W = 2 3X .

Fact: Let X have mgf MX (t) and Y = aX + b for any


constants a, b. Then MY (t) = ebt MX (at).
Fact: If the mgf exists, it uniquely defines the distribution.
One-to-one correspondence between mgfs and
distributions.
Fact: In mathematics, mgfs are the same as Laplace
transforms.
Tower

Discrete RVs