24.03.2013 Views

Linear Transformations and Combinations

Linear Transformations and Combinations

Linear Transformations and Combinations

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1 Introduction<br />

<strong>Linear</strong> <strong>Transformations</strong> <strong>and</strong> <strong>Combinations</strong><br />

STA 281 Fall 2004<br />

We are often interested in transformations of r<strong>and</strong>om variables. A transformation is any function<br />

of the r<strong>and</strong>om variable. A simple example is changing units. If X is a r<strong>and</strong>om variable measured in<br />

feet, then the r<strong>and</strong>om variable Y = 12X would measure the same quantity in inches. Only slightly<br />

more complicated is changing temperature scales from Fahrenheit to Celsius. If F is a temperature<br />

measurement in Fahrenheit, than C = (5/9)(F − 32) is the same measurement in Celsius.<br />

We’ve already discussed computing means <strong>and</strong> variances for transformations. In particular,<br />

recall the formula<br />

E[h(X)] = <br />

h(x)P (X = x)<br />

x<br />

To illustrate, suppose a store sells cubic fish tanks where 40% are 1 foot on a side, 50% are 2 feet<br />

on a side, <strong>and</strong> 10% are 3 feet on a side. Let X be the side length for a r<strong>and</strong>omly chosen tank <strong>and</strong><br />

let Y be the volume of a tank. Y is a function of X because Y = X 3 . Finding the mean <strong>and</strong><br />

variance of Y may be done by converting back to X <strong>and</strong> computing the expectations with respect<br />

to the distribution of X. Thus<br />

E[Y ] = E[X 3 ] = (1 3 )(0.4) + (2 3 )(0.5) + (3 3 )(0.1) = 7.1<br />

E[Y 2 ] = E[(X 3 ) 2 ] = E[X 6 ] = (1 6 )(0.4) + (2 6 )(0.5) + (3 6 )(0.1) = 105.3<br />

V [Y ] = E[Y 2 ] − E[Y ] 2 = 105.3 − (7.1 2 ) = 54.89<br />

The st<strong>and</strong>ard deviation of Y is σY = √ 54.89 = 7.4088.<br />

For many transformations (i.e. functions h(X)) we have to go through this general formula.<br />

However, for a particular set of transformations, called linear transformations, the general formula<br />

simplifies considerable <strong>and</strong> thus we can acquire simpler formulas for E[h(X)] <strong>and</strong> V [h(X)]. These<br />

methods apply even if the r<strong>and</strong>om variables are continuous.<br />

2 <strong>Linear</strong> <strong>Transformations</strong><br />

Let X be a r<strong>and</strong>om variable (discrete or continuous). A linear transformation of X is the quantity<br />

aX + b for some constants a <strong>and</strong> b. In problems, you will have to determine these constants from<br />

the given situation.<br />

For example, suppose you are running a carnival. You charge $5 for admission <strong>and</strong> then charge<br />

$2 for tickets that may be used for rides. Suppose further the number of ride tickets a particular<br />

1


person buys, X, is a r<strong>and</strong>om variable. Suppose we want an expression for the amount of money<br />

spent by that particular person. Letting Y denote the amount of money spent, we can find a<br />

function relating Y to X. If a person buys X tickets, then they spent 2X dollars on tickets. In<br />

addition, they spent $5 to enter the carnival. The total amount spent is Y = 2X + 5. Since Y has<br />

the correct form (aX + b, with a = 2, <strong>and</strong> b = 5), we say Y is a linear transformation of X.<br />

If we know the mean <strong>and</strong> variance of X, then there are simple formulas to compute the mean<br />

<strong>and</strong> variance of a linear transformation Y . We derive the formulas for discrete r<strong>and</strong>om variables.<br />

We know that E[X] = <br />

<br />

x xP (X = x) <strong>and</strong> E[h(X)] = x h(x)P (X = x). A linear transformation<br />

is a particular form of h(x), so<br />

The formula applies because E[X] = <br />

x<br />

r<strong>and</strong>om variable.<br />

E[aX + b] = <br />

x (ax + b)P (X = x)<br />

= <br />

x axP (X = x) + bP (X = x)<br />

= <br />

<br />

x axP (X = x) + x bP (X = x)<br />

= a <br />

<br />

x xP (X = x) + b x P (X = x)<br />

= aE[X] + b<br />

<br />

xP (X = x) by definition <strong>and</strong> x P (X = x) = 1 for any<br />

V [aX + b] = E[((aX + b) − (aE[X] + b)) 2 ]<br />

= E[(aX + b − aE[X] − b) 2 ]<br />

= E[a 2 (X − E[X]) 2 ]<br />

= a 2 E[(X − E[X]) 2 ]<br />

= a 2 V [X]<br />

These formulas E[aX + b] = aE[X] + b <strong>and</strong> V [aX + b] = a 2 V [X] apply for any r<strong>and</strong>om variable,<br />

discrete or continuous (we did not derive the calculus, but integrals have many of the properties of<br />

summations, such as factoring out constants <strong>and</strong> breaking sums into two parts, so it makes sense).<br />

The expectation formula is simple to remember, the expectation of a linear transformation is<br />

the same linear transformation of the expectation. The variance requires a little more explanation.<br />

Variance is a measure of spread. Adding a constant b doesn’t change the spread, so it can be<br />

ignored in computed the variance. When we multiply by a, we have to remember the variance is<br />

in squared units, so the constant a is squared in the formula.<br />

Suppose for our carnival example any particular person buys an average of 5 tickets with a<br />

variance of 9 tickets. What is the mean <strong>and</strong> variance of the amount of money spent by a particular<br />

person? We said Y = 2X + 5, so E[Y ] = 2E[X] + 5 = 2(5) + 5 = 15 <strong>and</strong> V [Y ] = 2 2 (9) = 36.<br />

3 <strong>Linear</strong> <strong>Combinations</strong><br />

Often we deal with several r<strong>and</strong>om variables at once. A linear combination of two r<strong>and</strong>om variables<br />

X <strong>and</strong> Y has the form aX + bY + c, where a, b, <strong>and</strong> c are fixed constants found from the problem.<br />

<strong>Linear</strong> combinations can involve many r<strong>and</strong>om variables. A linear combination Y of n r<strong>and</strong>om<br />

variables X1, . . . , Xn is<br />

Y = a1X1 + a2X2 + . . . + anXn + b<br />

where the ai <strong>and</strong> b coefficients are fixed values which, again, are found in the problem.<br />

2


We will not go through the proofs on how to compute the mean <strong>and</strong> variance of a linear<br />

combination, but they are similar to the formulas for a linear transformation of a single r<strong>and</strong>om<br />

variable. The mean of a linear combination is<br />

E[a1X1 + a2X2 + . . . + anXn + b] = a1E[X1] + a2E[X2] + . . . + anE[Xn] + b<br />

so the expectation of a linear combination is the same linear combination of the expectations.<br />

If all the r<strong>and</strong>om variables in the linear combination are independent (don’t forget<br />

this assumption), then the variance of a linear combination is<br />

V [a1X1 + a2X2 + . . . + anXn + b] = a 2 1V [X1] + a 2 2V [X2] + . . . + a 2 nV [Xn]<br />

Two simple linear combinations of two independent r<strong>and</strong>om variables are Z1 = X + Y <strong>and</strong><br />

Z2 = X − Y , where X <strong>and</strong> Y are independent. These may be written Z1 = 1X + 1Y + 0 <strong>and</strong> Z2 =<br />

1X + (−1)Y + 0. Using the formulas, we may derive E[Z1] = E[X] + E[Y ], E[Z2] = E[X] − E[Y ],<br />

<strong>and</strong> V [Z1] = V [X] + V [Y ], V [Z2] = V [X] + V [Y ]. Note that while the variance of a sum is the sum<br />

of the variances, the variance of a difference is also the sum of the variances. If we add independent<br />

sources of noise into a problem, we increase the overall noise of the system.<br />

4 Examples<br />

4.1 Tables <strong>and</strong> Chairs<br />

At a school, each room contains only tables <strong>and</strong> chairs. Suppose that, on average, each room<br />

contains 50 chairs with a st<strong>and</strong>ard deviation of 20 chairs. Suppose further that, on average, each<br />

room contains 5 tables with a st<strong>and</strong>ard deviation of 2 tables. Each chair weighs 10 pounds <strong>and</strong><br />

each table weighs 30 pounds. You select a r<strong>and</strong>om room <strong>and</strong> place all the items in the room into<br />

a 10000 pound truck.<br />

a) Write a formula for Z, the total weight of the truck <strong>and</strong> its contents after the truck has been<br />

loaded with the contents of the room. Z = 10C + 30T + 10000<br />

b) What are the mean <strong>and</strong> variance of Z? E[Z] = 10E[C] + 30E[T ] + 10000 = 10(50) + 30(5) +<br />

10000 = 10650. V [Z] = 10 2 V [C] + 30 2 V [T ] = 10 2 (20 2 ) + 30 2 (2 2 ) = 43600<br />

4.2 Christmas Donations<br />

Each year at Christmas, charity donations are accepted at a local grocery chain. Suppose the<br />

chain donates an initial $100 <strong>and</strong> then customers donate either in Lexington or in Nicholasville. In<br />

Nicholasville, customers donate an average of $2100 each year with a st<strong>and</strong>ard deviation of $100,<br />

while in Lexington customers donate an average of $5500 with a variance of 90000. Suppose further<br />

that the local grocery chain matches the donations. For every dollar donated in Nicholasville, the<br />

local grocery chain gives an additional $0.25 <strong>and</strong> for every dollar donated in Lexington the local<br />

grocery chain gives an additional $0.50. What are the mean, variance, <strong>and</strong> st<strong>and</strong>ard deviation of<br />

the total amount of donations to the charity in a given year?<br />

When we look at this problem, the mean <strong>and</strong> variance are given for two r<strong>and</strong>om quantities.<br />

These are the amount donated by customers in Nicholasville (N) <strong>and</strong> the amount donated by<br />

3


customers in Lexington (L). We are trying to find the mean <strong>and</strong> variance of D, the total amount<br />

of donations. To use the information in the problem, we should determine how D is related to<br />

the quantities L <strong>and</strong> N we know something about. The local grocery chain donates $100 at first,<br />

then customers donate. In addition to customer donations, the local grocery chain also does partial<br />

matching. From Nicholasville, the charity gains 1.25N (each dollar given by a customer matched<br />

with $0.25 from the grocery chain. Similarly, the charity gains 1.50L from Lexington. The total<br />

amount of donations , D, is the sum of these three quantities,<br />

D = 1.25N + 1.50L + 100<br />

Using the formulas for mean <strong>and</strong> variance, we find<br />

4.3 TV, VCR Example<br />

µD = 1.25(2100) + 1.50(5500) + 100 = 10975<br />

σ 2 D = 1.252 (10000) + 1.50 2 (90000) = 218125<br />

σD = √ 218125 = 467.0385<br />

Recall our example with a customer buying a TV or a VCR. From a set of probabilities, we<br />

constructed a probability table<br />

T V T V c<br />

V CR 0.10 0.20 0.30<br />

V CR c 0.50 0.20 0.70<br />

0.60 0.40 1.00<br />

Suppose we are given the information that a TV costs $250 <strong>and</strong> a VCR costs $100. We may also<br />

construct a table showing the costs for each outcome in the probability table.<br />

T V T V c<br />

V CR 350 100<br />

V CR c 250 0<br />

We may compute the mean <strong>and</strong> variance of C directly from the definitions, since we know the costs<br />

<strong>and</strong> probabilities associated with the four outcomes. We find<br />

E[C] = 350(0.1) + 250(0.5) + 100(0.2) + 0(0.2) = 180<br />

E[C 2 ] = 350 2 (0.1) + 250 2 (0.5) + 100 2 (0.2) + 0 2 (0.2) = 45500<br />

V [C] = E[C 2 ] − (E[C]) 2 = 45500 − 180 2 = 13100<br />

Notice that the cost is really just the sum of the amount spent on TVs, Ct, <strong>and</strong> the amount<br />

spent on VCRs, Cv. Note Ct has two possible values, 0 if they didn’t buy a TV, which occurs<br />

with probability 0.4, <strong>and</strong> 250 is they did buy a TV, which occurs with probability 0.6. We may<br />

find that E[Ct] = 250(0.6) + 0(0.4) = 150 <strong>and</strong> E[Cv] = 100(0.3) + 0(0.7) = 30. We may also find<br />

V [Ct] = 15000 <strong>and</strong> V [Cv] = 2100.<br />

We said the total cost is the sum of Ct <strong>and</strong> Cv, so we may write<br />

C = Ct + Cv<br />

Using the formula for expectation, we find E[C] = E[Ct] + E[Cv] = 150 + 30 = 180, which agrees<br />

with our previous calculation, as expected. However, the variances do not sum to V [C], since<br />

4


V [Ct] + V [Cv] = 15000 + 2100 = 17100, not the 13100 we derived previously. Why? The r<strong>and</strong>om<br />

variables Ct <strong>and</strong> Cv are not independent. The events “buy a TV” <strong>and</strong> “buy a VCR” are<br />

not independent because 0.1 = P (T V V CR) = P (T V )P (V CR) = (0.60)(0.30) = 0.18. The<br />

variance formula only applies to independent r<strong>and</strong>om variables.<br />

5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!