Transcription of STAT 340/CS 437 PROBLEM SOLUTIONS.
1 STAT 340/CS 437 The following data gives the arrival times and the service times that eachcustomer will require for thefirst 13 customers in a single server queue. Onarrival the customer either enters service if the server is free or joins the waitingline. When the server completes work on a customer, the next one in the queue( the one that has been waiting the longest) enters Times12 31 63 95 99 154 198 221 304 346 411 455 537 Service Times40 32 55 48 18 50 47 18 28 54 40 72 12(a)Determine the departure times of the 13 customers(b)Repeat (a) when there are two servers and a customer can be served byeither one.
2 (c)Repeat (a) under the new assumption that when the server completes a ser-vice, the next customer to enter service is the last to join the theone who has been waiting the least : a) 52, 84, 139, 187, 205, 255, 302, 320, 348, 402, 451, 527, ) 52, 63, 118, 143, 136, 204, 245, 239, 332, 400, 451, 527, ) 52, 84, 139, 157, 207, 254, 272, 320, 348, 402, 451, 527, Code% Matlab code for question ONE%Dataarrival =[12 31 63 95 99 154 198 221 304 346 411 455537];service=[40325548185047182854407 212];%%%%%%%%%%%% a) %%%%%%%%%%%%%%%%%%%%%%%departure(1)=arri val(1)+service(1);for i=2:13if arrival(i)<departure(i-1)\departure(i)=departure(i-1)+service(i);else\departure(i)=arrival(i)+service(i);endend%%%%%%%%%%%% b) %%%%%%%%%%%%%%%%%%%%%%%%departure2(1)=arrival(1)+service(1);departure2(2)=arrival(2)+service(2);for i=3:13if arrival(i)<min(departure2(i-1),departure2(i-2))\departure2(i)= min(departure2(i-1),departure2(i-2))+service(i);else\departure2(i)=arrival(i)+service(i); The continuous random variableXhas probability density function givenbyf(x)=cx,0<x<1 FindcandP[X>1/2].
3 Sincefis a probability density function we need tofind the constantcso thatR10f(x)dx=1orR10cxdx=1givingc= (X>12)=Z11/2f(x)dx=x2|11/2=(1 1/4) = 3 IfXandYhave joint probability density function given byf(x, y)=2exp{ (x+2y),0<x< ,0<y< findP[X<Y].The joint probability density function isf(x, y)=2e (x+2y),0<x< and0<y< .ThereforeP(X<Y)=ZZ{(x,y);x<y}f(x, y)dxdy=Z 0{Zy0f(x, y)dx}dy= airplane needs at least half its engines to safely complete its each engine independently functions with probabilityp,for what values ofpis a two engine plane safer than a three engine plane?Letcbe the number of engines required to safely complete the mission.}
4 Thenwhen there arenengines,c=1whenn=2andc=2whenn= of engines that operate properly isX,a binomial random variable the probability that the mission is successful isP2=P(X 1) =2X1 2x px(1 p)2 xwhenn=2P3=P(X 2) =3X2 3x px(1 p)3 xwhenn=32 When is the two-engine plane better? WhenP2>P3or for values ofpforwhich2p(1 p)+p2 3p2(1 p)+(1 p)31+2p3 p2 p 0and this is true for all0 p a binomial(n, p)random variableXshow thatp(i)=P[X=i]firstincreases and then decreases reaching its maximum value wheni=[p(n+1)],the largest integer less than or equal top(n+1).IfXhas a binomial distribution so thatP(X=i)= ni pi(1 p)n i,we canobtain the ratioP(X=i)P(X=i 1)=(n i+1)pi(1 p)Note that this ratio is greater than one if(n i+1)p>i(1 p)or equivalently ifi<(n+1) a similar argument this ratio is smaller than one ifi>(n+1) means that the terms are increasing (X=i)>P(X=i 1)aslong asi<(n+1)pand subsequently the terms are decreasing.
5 It follows thatthe maximum value ofP(X=i)is achieved wheniis the largest integer lessthan or equal to(n+1)pori=[(n+1)p].6. independent binomial random variables with parameters(n, p)and(m, p)respectively, argue without calculations thatX+Yis bino-mial(m+n, p).LetXbe binomial(n, p)andYbe Binomial(m, p).Then we can obtainXasthe number of successes innindependent trials of an experiment in which theprobability of a success on each trial the number of successesinmindependent trials of an experiment with the same probability os successon each trial. ThereforeX+Yis the total number of successes onn+ follows thatX+Yis Binomial(n+m, p).
6 7. a Poisson( )random variable show that(a)E(X)= 3(b)var(X)= The expected value of a Poisson random variable isE(X)= Xx=0xP(X=x)= Xx=0x xe x!= e x Xx=1 x 1(x 1)!= .Note also thatE(X(X 1)) = Xx=0x(x 1) xe xx!= 2e x Xx=2 x 2(x 2)!= follows thatvar(X)=E(X2) 2=E(X(X 1)) +E(X) 2= .8. independent Poisson random variables with parameters 1and 2respectively. Use question number 6 and a limit theorem for binomialrandom variables to argue heuristically thatX+Yhas a Poisson( 1+ 2)distribution. Then give an analytic proof of this heuristic argument is as follows. A binomial(n, p)random variable withasmallvalueofpand largenis approximately Poisson( )with = approximately Binomial(n1,p)andYBinomial(n2,p)wheren1= 1/pandn2= 2/pandpis chosen very small.
7 By it follows thatthe sumX+Yis approximately binomial(n1+n2,p)which is, sincen1+n2islarge andpis small is approximately Poisson((n1+n2)p)or Poisson( 1+ 2).The formal argument is as follows. SupposeXhas aP oisson( 1) distribution4andYhas aPoisson( 2)distribution and they are independent. ThenP[X+Y=k]=kXi=0P(X=i, Y=k i)=kXi=0 i1e 1i! k i2e 2(k i)!=1k!e ( 1+ 2)kXi=0 ki i1 k i2=( 1+ 2)kk!e ( 1+ 2)and this is the Poisson distribution with parameter( 1+ 2).So the sum ofindependent Poisson random variables is also Poisson with the parameters an exponential random variable with rate parameter show that(a)E(X)=1 (b)var(X)=1 an exponential random variableX,with probability density functionf(x)= e x,x >0E(X)=Z 0x e xdx=1/.
8 AndE(X2)=Z 0x2 e xdx=2/ the variance isvar(X)=E(X2) (EX)2=2/ 2 1/ 2=1/ ,B, andCare waiting at a bank having two tellers when itopens in the morning. Persons A and B each go to a teller andCwaits in the times required to serve customers are independent exponential( )randomvariables, what is the probability thatCis the last to leave the bank? (Nocomputation is required)Let us suppose thatBleaves the bank by the memoryless propertyof the Exponential distribution, at the moment thatAleaves the bank,Chasremaining service time which is exponentially distributed with parameter ,andso doesB.
9 These two service times have the same continuous exponentialdistribution are independent. Therefore the probability that C s service time isthe larger independent exponential random variables with rateparameters and respectively. Show thatP[X<Y]= + .The joint probability density function, sinceXandYare independent expo-nential isf(x, y)= e xe y,x >0,y > (X<Y)=ZZ{(x,y);x<y}f(x, y)dxdy=Z 0{Zy0 e xdx} e ydy= + .12. a Poisson process in which events occur at a rate is the probability that not events occur between 10 AM and 2 (t)be the number of events occurring in an interval of properties of a Poisson process,N(t)has a Poisson distribution with para-meter given by twhere is the intensity of the Poisson process.
10 In this casethe intensity is =.3and soN(4)has a Poisson distribution with [N(4) = 0] =e a Poisson process with rate ,defineN(s)=the number of events inthe interval[0,s].FindP[N(s)=k|N(t)=n]fors< a Poisson process, recall thatN(t)is the number of events in the interval[0,t].Therefore fors<tand0 k n,P[N(s)=k|N(t)=n]=P[kevents in[0,s]andn kevents in[s, t]]P[nevents in[0,t]]=n!( s)ke s( (t s))n ke (t s)k!(n k)!( t)ne t= nk st k 1 st n conditional distribution of the number of events in a subinterval given thenumber in an interval is independent exponential random variables, show thatthe conditional distribution ofXgivenX+Y=tis the uniform distributionon(0,t).