Download Sums and other functions of random variables

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Transcript
1.6 Sums and Other Functions of Random Variables
We have seen some examples of sums of random variables.
Example 1. We roll a die twice. Let X1 = result of first roll and X2 = result of second roll. Let T be the
sum of the two rolls. Then T is the sum of X1 and X2, i.e. T = X1 + X2. In section 1.3 we found the
probablility mass function of T.
Example 2. We flip a coin n times. Let Xk = 1 if the kth flip is a head and Xk = 0 it the kth flip is a tail. Let
N = the number of heads in the n flips. Then N = X +  + X . Recall from section 1.6 that N has a
1
n
binomial distribution.
In general, we want to find the probablility mass function fS(s) of the sum S = X + Y of two random variables
X and Y or S = X +  + X of n random variables X , …, X .
1
n
1
n
Consider the case S = X + Y and let X = {x0, x1, …, xn} and Y = {y0, y1, …, ym} be the set of values X and
Y take on. Then S = {s = x + y: x  X and y  Y} is the set of values S takes on. If s is one of these
values then
(1)
fS(s) = Pr{S = s} =
 Pr{X = x and Y = y} =
(x,y): x + y = s
 f(x, y)
(x,y): x + y = s
where fX,Y(x, y) is the joint probability mass function of X and Y and in the sums we are summing over those
pairs (x, y) where x  X and y  Y and x + y = s. We can write this as
n
(2)
fS(s) =
 f(x, s - x) =  f(xi, s – xi)
x  X
i=0
with the understanding that f(x, s - x) = 0 if the pair x is not in X or s – x is not in Y.
Example 3. Mary is making two investment, one the Angolian Oil Company and the other in Speedy
Computer Corporation. Suppose
1.
The profit X from the Angolian Oil investment will be either $0, $1000 or $2000
2.
The profit Y from the Speedy Computer investment will be either $0, $1000 or $2000.
3.
The joint probability mass function fX,Y(x, y) is given by the following table.
Y=0
Y=1
Y=2
X=0
f(0, 0) = 0.05
f(0, 1) = 0.10
f(0, 2) = 0.15
X=1
f(1, 0) = 0.15
f(1, 1) = 0.20
f(1, 2) = 0.10
X=2
f(2, 0) = 0.10
f(2, 1) = 0.10
f(2, 2) = 0.05
1.6 - 1
For simplicity we are measuring the values of X and Y in units of thousands of dollars so X = 1 or Y = 1
means $1000.
We want to find the probability mass function fS(s) of the sum S = X + Y of the profits from the two
investments.
Solution. Here is the same table where we also include the value of S for each combination of values of X
and Y.
X=0
X=1
X=2
Y=0
Y=1
Y=2
f(0, 0) = 0.05
f(0, 1) = 0.10
f(0, 2) = 0.15
S=0
S = 1000
S = 2000
f(1, 0) = 0.15
f(1, 1) = 0.20
f(1, 2) = 0.10
S=1
S=2
S=3
f(2, 0) = 0.10
f(2, 1) = 0.10
f(2, 2) = 0.05
S=2
S=3
S=4
From the table we can find the pairs (x, y) that have given sums. One has
fS(0) = f(0, 0) = 0.05
fS(1) = f(0, 1) + f(1, 0) = 0.10 + 0.15 = 0.25
fS(2) = f(0, 2) + f(1, 1) + f(2, 0) = 0.15 + 0.20 + 0.10 = 0.45
fS(3) = f(1, 2) + f(2, 1) = 0.10 + 0.10 = 0.20
fS(4) = f(2, 2) = 0.05
Note that to compute fS(s) we are summing the diagonal of the above table where X + Y = s.
Finding the probability mass function for some other function of one or two random variables is similar to
the sum. In the table for the joint probability mass function one simply replaces the values of the sum by
the value of whatever function of the two random variables we are considering.
Problem 1. In Example 3, find the probability mass function of Z = X – Y.
Things are a little simpler in the case where X and Y are independent. Then f(x, y) = fX(x)fY(y) so (2) can be
rewritten as
n
(3)
fS(s) =
 fX(xi)fY(s - xi)
i=0
A sum of this form is often called the convolution of the functions fX(x) and fY(y). If we let gs(y) = fY(s – y),
then (3) can be written as
n
(4)
fS(s) =
 fX(xi)gs(xi) = <fX, gs >
i=0
1.6 - 2
The term <fX, gs > on the right is the inner product of two vectors. The first, fX, is the vector of fX(x) values
in increasing order of the value of x. The second gs is the vector of fY(y) values in decreasing order of the
value of y and shifted so the value of f(x) is in the same position as gs(x) = fY(s – x). Both vectors are
padded on the left and/or right so they are the same length.
Example 4. In Example 3 suppose that the assumptions are changed to the following.
1.
The profit X from the Angolian Oil investment will be either $0, $1000 or $2000 with
probabilities 0.3, 0.5 and 0.2 respectively.
2.
The profit Y from the Speedy Computer investment will be either $0, $1000 or $2000
with probabilities 0.1, 0.6 and 0.3 respectively.
3.
The return from the two investments are independent.
Solution. The vector fX is (0.3, 0.5, 0.2). The corresponding vector of x values is (0, 1, 2). The vector of
fY(y) values in decreasing order of the value of y is (0.3, 0.6, 0.1). The corresponding vector of y values is
(2, 1, 0). To compute fS(0) we must align the vectors (0.3, 0.5, 0.2) and (0.3, 0.6, 0.1) so that corresponding
elements correspond to the sum of the x and y values being 0. This alignment is when the 0.3 at the
0
0 0.3 0.5 0.2 
beginning of the first vector is over the 0.1 at the end of the second, i.e. 0.3 0.6 0.1 0
0 . Now we
multiply corresponding component and add.
fS(0) = (0.3)(0.1) = 0.03
0 0.3 0.5 0.2
To compute fS(1) we shift the bottom vector one position to the right so that it is 0.3 0.6 0.1 0  and
again multiply corresponding component and add.
fS(1) = (0.3)(0.6) + (0.5)(0.1) = 0.18 + 0.05 = 0.23
0.3 0.5 0.2
To compute fS(2) we shift the bottom vector one more position to the right so that it is 0.3 0.6 0.1 and
repeat.
fS(2) = (0.3)(0.3) + (0.5)(0.6) + (0.2)(0.1) = 0.09 + 0.3 + 0.02 = 0.41
0.5 0.2
For fS(3) we have 0.3 0.6 so
fS(3000) = (0.5)(0.3) + (0.2)(0.6) = 0.15 + 0.12 = 0.27
0.2
For fS(4) one has 0.3 so
fS(4) = (0.2)(0.3) = 0.06
Consider the special case X = {0, 1, … , n} and Y = {0, 1, … , m} with m  n. Then
S = {0, 1, … , n + m} and the formula (3) becomes
1.6 - 3
min{n, k}
(5)
 fX(i) fY(k - i) =
fS(k) =
i = max{0, k-m}




k
 fX(i) fY(k-i)
for k = 0, … , m
i=0
k
 fX(i) fY(k-i)
for k = m, … , n
i = k-m
n
 fX(i) fY(k-i)
for k = n, … , n+m
i = k-m
Example 5. John is very lucky and when ever he buys a raffle ticket he either makes a profit of $0, $1 or
$2 each with probability 1/3. Suppose he buys two raffle tickets and the outcome of the two tickets are
independent of each other. Let S be the amount of profit he makes on the two tickets. Find the probability
mass function of S.
Solution. T = U + V where U is the profit on the first ticket and V is the profit on the second ticket. Then
U and V are independent and both have probability mass function f given by f(0) = f(1) = f(2) = 1/3. Then
(5) becomes
 
=

 
k

i=0
f (k) =  2
 i =k-2f(i) f(k-i)
k
 f(i) f(k-i)
(6)
for k = 0, 1, 2
1
9
for k = 0, 1, 2
1
9
for k = 2, 3, 4
i=0
2
T
for k = 2, 3, 4
 k + 1 for k = 0, 1, 2
9
=  5-k
for k = 2, 3, 4
 9
i = k-2
In the special case where X = Y = {0, 1, … , n, … } then (5) becomes
k
(7)
fS(k) =
 fX(i) fY(k - i)
i=0
Example 6. Suppose that X and Y have Poisson distributions with means  and  respectively. Find the
probability mass function of S = X + Y.
Solution. One has fX(i) =
 i e -
i!
k
fS(k) =
for i = 0, 1, 2, ….

i e-  k-i e-
i=0
i!
and fY(j) =
e-(+)
=
(k-i)!
k!
k

 j e -
j!
for j = 0, 1, 2, …. . Using (5) one has
k -(+)
ki k-i = ( + ) e
i
k!
i=0
where we have used the binomial theorem discussed at the end of section 1.6. So S is again a Poisson
random variable with mean  + .
We can extend (5) to the case where the values of X and Y are equally spaced with the same spacing h, i.e.
X = {a + ih: i = 0, … , n} and Y = {b + jh: j = 0, … , m} for some a and b and m  n. Then
S = {a + b + kh: k = 0, … , n + m}. Then the random variables U = (X – a)/h and V = (Y – b)/h have the
property that U = {0, 1, … , n} and V = {0, 1, … , m} so we can apply (5) to them to get the probability
1.6 - 4
mass funtion of U + V. Then X + Y = a + b +h(U + V) and we can get the probability mass function of
X + Y from that of U + V.
Example 7. Suppose that each day a newsstand either makes a profit of $100, $200 or $300 each with
probability 1/3 and each day is independent of any other day. Let S be the amount of profit the newsstand
makes in a two day period. Find the probability mass function of S.
Solution. S = X + Y where X is the profit the newsstand makes in the first day and Y is the amount of profit
in the second day. Let U = (X – 100)/100 and V = (Y – 100)/100. Then U and V have the same probability
mass function as in Example 5. So the sum T = U + V has probability mass function given by (6). Then
X + Y = 200 +100T so the probability mass function of S = X + Y is
 s - 100
900
fS(k) =  700 - s
 900
for s = 200, 300, 400
for k = 400, 500, 600
As we have seen, finding the probability mass function of the sum of just two random variables requires
some effort even in the case where they are independent and have the same distribution. Finding the
probability mass function of the sum S = X +  + X of n random variables X , …, X is usually more
1
n
1
n
difficult and it may not be possible to find a simple formula for it. One case which one can handle is the
sum of independent Bernoulli random variables which was seen in section 1.4 to have a binomial
distribution. As one can see from Example 6, the sum of independent Poisson random variables is again
Poisson with the mean being the sum of the means. Sometimes finding the probability mass function of a
sum of random variables is easier using moment generating functions. The moment generating function of a
n
random variable X is M(t) =
 etxifX(xi) and how they are used is discussed in various books.
i=0
1.6 - 5