Beautiful Homework #14

1
Gina Giacone
Engr. 323
BHW #14
5-62
Beautiful Homework #14
Problem Statement
5-62) Suppose your waiting time for a bus in the morning is uniformly distributed on
[0,5], while waiting time in the evening is uniformly distributed on [0,10] independent of
morning waiting time.
a) If you take the bus each morning and evening for a week, what is your total
expected waiting time?
(Hint: Define rv’s X1 ,…….,X10 and use a rule of expected value.)
b) What is the variance of your total waiting time?
c) What are the expected value and variance of the difference between morning and
evening waiting time on a given day?
d) What are the expected value and variance of the difference between total morning
waiting time and total evening waiting time for a particular week?
Problem Preparation
A continuous random variable X is said to have a uniform distribution on the interval
[A,B] if the pdf of X is:
 1
 A− B A ≤ x ≤ B

f ( x; A, B) = 
 0
otherwise


According to our intervals, the pdf’s below represent the morning and evening waiting
times
1
5 0 ≤ x ≤ 5

f ( x;0,5) = 
 0 otherwise


⇒ distribution for morning waiting time(Fig. 1)
2
Gina Giacone
Engr. 323
BHW #14
5-62
1
10 0 ≤ x ≤ 10

f ( x;0,10) = 
 0 otherwise


⇒ distribution for evening waiting time (Fig. 2)
Shown below in Figures 1 and 2 are the graphs of the pdf’s for the
above distributions:
PDF
0.25
f(x)
0.2
0.15
0.1
0.05
0
0
1
2
3
4
5
6
10
12
x
Figure 1
PDF
0.12
0.10
f(x)
0.08
0.06
0.04
0.02
0.00
0
2
4
6
x
Figure 2
8
3
Gina Giacone
Engr. 323
BHW #14
5-62
First lets define our random variables :
X1 ,………,X5 = waiting time in the morning
X6 ,………,X10 = waiting time in the evening
The expected or mean value of a continuous rv X with pdf f(x) is:
µ x = E( X ) =
∞
∫ x ⋅ f (x )dx
−∞
So the expected values for X1 and X6 are;
5
1
E ( X 1 ) = ∫ x ⋅ dx = 2.5 units of time ⇒ the expected waiting time for first morning
5
0
10
E( X 6 ) = ∫ x ⋅
0
1
dx = 5 units of time ⇒ the expected waiting time for first evening
10
The variance of a continuous rv X with pdf f(x) and mean value µ is:
σ x2 = V ( X ) =
∞
∫ (x − µ)
2
⋅ f ( x )dx = E[( x − µ ) 2 ]
−∞
V ( X ) = E( X 2 ) − [ E( X )] 2
So the variance for X1 and X6 are;
5
5
5
25
 1
1
V ( X 1 ) = ∫ ( x − 2.5)   dx = ∫  x 2 − x +  dx = units of time2 ⇒ variance for
5
4
12
 5
0
0
the 1st morning
2
10
10
5
25
1
 1
V ( X 6 ) = ∫ ( x − 5)  dx = ∫  x 2 − x + dx = units of time2 ⇒ variance for
10
2
3
 10 
0
0
the 1st evening
2
4
Gina Giacone
Engr. 323
BHW #14
5-62
Here is an alternate solution for finding the variance:
V ( X ) = E( X 2 ) − [E ( X ) ]2
V ( X 1 ) = E( X 12 ) − [E ( X 1 ) ]2
V ( X 6 ) = E ( X 62 ) − [E ( X 6 ) ]
2
First we need find:
5
25
1
2
E ( X 1 ) = ∫ x 2  dx =
units of time2
5
3
 
0
10
100
1
E ( X ) = ∫ x 2  dx =
units of time2
3
 10 
0
2
6
So then we have:
2
25  5 
25
2
st
V ( X1 ) =
−  =
units of time ⇒ variance for the 1 morning
3 2
12
V (X 6 ) =
100
25
2
− (5) =
units of time2 ⇒ variance for the 1 st evening
3
3
Before finding the solutions to the problem, the Proposition for the Distribution of
Linear Combinations on pg. 238 in the text is pertinent to solving this problem
(shown below):
Let X 1 , X 2 ,... X n have mean values µ 1 , µ 2 ,...µ n , respectively , and var iances
σ 1 ,σ 2 ,...σ n , respectively .
1. Whether or not the X i ' s are independen t ,
E (a1 X 1 + a 2 X 2 + L + a n X n ) = a1 E ( X 1 ) + a2 E ( X 2 ) + L + a n E( X n )
= a1 µ1 + a2 µ 2 + L + a n µ n
5
Gina Giacone
Engr. 323
BHW #14
5-62
2. If X 1 ,... X n are independen t ,
V ( a1 X 1 + a2 X 2 + L + an X n ) = a12V ( X 1 ) + a 22V ( X 2 ) + L + a n2V ( X n )
= a12σ 12 + a 22σ 22 + L + a n2σ n2
Solutions
a)
The expected value of a linear combination is the same as the linear combination
of the expected values.
In our case, a1 ,a2 ,…..an =1, so;
Total time to wait ( T0 ) = X1 + … +X10
•
E (T0 ) = E ( X 1 + L X 10 ) = E ( X 1 ) + E( X 2 ) + L + E( X 10 )
X 1 , X 2 , X 3 , X 4 , X 5 ( All are uniformly distributed with same distribution( µ = 2.5, σ = 1.44))
•
X 6 , X 7 , X 8 , X 9 , X 10 ( All are uniformly distributed with same distribution( µ = 5, σ = 2.88))
Therefore since all of the morning waiting times have the same distribution and
mean we can multiply them by five(# of morning random variables) instead of
adding up each one. Likewise for the evening waiting time random variables
which all have the distributions and means. See the proposition on page 238 in the
text. (BE CAREFUL!!! Beth said to watch this step and to be careful about the
coefficient );
•
E (T0 ) = E ( X 1 ) + E ( X 2 ) + L + E ( X 5 ) + E ( X 6 ) + L + E( X 10 )
•
E (T0 ) = 5( E ( X 1 )) + 5( E ( X 6 ))
(Equation 1)
Now all we need to do is plug in what we found for the expected values of X1 and
X6 and then we can find the total expected waiting time.
E (T0 ) = 5(2.5) + 5(5) = 37.5 units of time
6
Gina Giacone
Engr. 323
BHW #14
5-62
b)
Now we are asked to find the variance for the total waiting time. Using our
definition of T0 in part a) and the definition of the variance of a linear
combination of random variables, we know that:
•
•
V (T0 ) = V ( X 1 + L + X 10 ) = V ( X 1 ) + LV ( X 10 )
X 1 , X 2 , X 3 , X 4 , X 5 ( All are uniformly distributed with same distribution( µ = 2.5,σ = 1.44))
X 6 , X 7 , X 8 , X 9 , X 10 ( All are uniformly distributed with same distribution( µ = 5,σ = 2.88))
Like in Equation 1 shown above, we can combine the like random variables with
the same distributions and means. See the proposition on page 238 in the text.
• V (T0 ) = 5(V ( X 1 )) + 5(V ( X 6 )) BE CAREFUL ABOUT COEFFICIENTS!!!!
Once again, all we need to do is plug in the values for the variances of X1 and X6
and then we can find the variance of the total waiting time.
 25   25 
2
V (T0 ) = 5  + 5  = 52.083 units of time
 12   3 
c) Now we are asked to find the expected value of the difference between the
morning and evening waiting time on any given day. First we should look at the
definition for the expected value of the difference of random variable (on pg. 239
in the text).
E ( X 1 − X 2 ) = E( X 1 ) − E( X 2 ) and , if X 1 and X 2 are independent , V ( X 1 − X 2 ) =
V ( X1 ) + V ( X 2 )
Knowing that:
•
X 1 , X 2 , X 3 , X 4 , X 5 ( All are uniformly distributed with same distribution( µ = 2.5,σ = 1.44))
X 6 , X 7 , X 8 , X 9 , X 10 ( All are uniformly distributed with same distribution( µ = 5,σ = 2.88))
Then we can assume that:
•
E ( X 1 − X 6 ) = E( X 2 − X 7 ) = E ( X 3 − X 8 ).... = E ( X 5 − X 10 )...etc
7
Gina Giacone
Engr. 323
BHW #14
5-62
or any other combinations of the random variables for morning waiting time and
evening waiting time. We can do this since each set of random variables for
morning are equal as well as the random variables for evening are equal. Since we
know that any combination of the two random variables (as long as we subtract
the random variable for evening waiting time from the random variable for
morning waiting time) will give us the expected value of the difference of the
two, and knowing that all of the random variables are independent, we result with:
•
E( X1 − X 6 ) = E( X1) − E( X 6 )
Values for X1 and X6 are obtained from above.
E ( X1 − X 6 ) = 2.5 − 5 = −2.5 units of time
The same assumption applies to the variance (with values for X1 and X6 obtained
from above:
V ( X1 − X 6 ) = V ( X1 ) + V ( X 6 ) =
25 25
+
= 10.417 units of time2
12 3
d) The last part of this problem ask us the find the expected value and variance of the
difference between the total morning waiting time and the total evening waiting
time for any particula r week
So first lets start with defining the total waiting time:
•
Total time in morning = X 1 + L + X 5
•
Total time in evening = X 6 + L + X 10
Since all of the random variables are independent, and all of the waiting time for
morning random variables are have the same distributions and means as well as
all of the waiting time for evening random variables have the same distributions
and means, then BE CAREFUL ABOUT COEFFICIENTS!!! See the proposition
on pg. 238 in the text.:
E (total waiting time in morning − total waiting time in evening )
= E[( X 1 + L + X 5 ) − ( X 6 + L + X 10 )]
= E ( X 1 + L + X 5 ) − E ( X 6 + L + X 10 )
= 5(2.5) − 5(5) = −12.5 units of time
8
Gina Giacone
Engr. 323
BHW #14
5-62
Now to find the variance, which is done using the definition for subtracting
variances and knowing that the random variables are all independent (the
proposition on page 238 was used):
•
•
a i = 1 for i = 1........5
a i2 = (1) 2 = 1 for i = 1......5
a i = −1 for i = 6........10
a i2 = ( −1) 2 = 1 for i = 6......10
V (total waiting time in morning − total waiting time in evening)
= V [( X 1 + L + X 5 ) − ( X 6 + L + X 10 )]
= V ( X 1 ) + V ( X 2 ) + L + V ( X 5 ) + V ( X 6 ) + V ( X 7 ) + L + V ( X 10 )
 25   25 
= 5  + 5  = 52.03 units of time2
 12   3 