I want to know what I am thinking is right. There are two types of buses, B1 and B2. The arrival rate of B1 is r1 and B2 is r2. The arrival of those buses are independent Poisson arrival process.
How long will I wait on the average until the next bus for any types, arrive at the bus stop? I thought this can be regarded as defining new random variable. If we regard inter-arrival time of each types of buses as a random variable I1 and I2, then, new random variable would be V=min(I1, I2). Since I1 and I2 follow Exponential distribution, V also fowllows Exp(r1+r2) by this. Therefore, the mean of V is 1/(r1+r2).
If I define a random variable Y as the time until the 10th bus, Y would follow 10-Erlang distirubiont? I guess it would follow 10-Erlang distribution with lambda (r1+r2). I've leaernd that the sum of Exponential random variables would follow the Erlang distribution. Then, can I think Y as Y=V1+V2+V3+...+V10 ? where the V is define in the first question?
What is the probability of the next three buses that arrive at the bus stop are all type 1? Before type 2 arrives, type 1 must arrive three times. That means the thrid arrival time of type 1 must be smaller than the first arrival time of type 2. The answer would be P(X1 is smaller than X2) where X1~3-Erlang(r1) and X2~1-Erlang(r2). Am I right? I can calculate this probability with double integration for X1 and X2.
I'be searched other questions in the Internet, but similar questions were somewhat different than mine. I want to know if my flow of thinking is wrong or right. Thanks in advance.
mean(rgamma(10^6, 3, 2) < rgamma(10^6, 1, 3))returns about 0.064. – BruceET Oct 22 '16 at 18:58