# Homework Help: Poisson process and exponential distribution arrival times

1. Mar 22, 2015

### lotsofmoxie

1. The problem statement, all variables and given/known data
Customers arrive in single server queue to be serviced according to Poisson process with intensity 5 customers an hour.
(a) If the customers begin to arrive at 8am, find the probability that at least 4 customers arrived between 9am and 10am.
(b) Find the probability that the 6th customer will arrive after 12 noon.
(c) Find the variance of the time of the arrival of the 3rd customer.

If the service times of the customers are independent uniform r.v.’s on [0, 4] and also are independent of the interarrival times:
(d) Find the probability that the second customer to arrive will have to wait before being served.
(e) Find the expected value of the time that the second customer will have to wait before being served.

2. Relevant equations
P(x=x) = (λt)^(x)*e^(-λt)/x!

where lambda = poisson parameter and t=ime interval

3. The attempt at a solution

a) P(at least 4 arrivals between 9-10am)=1-P(0,1,2 or 3 arrivals between 9-10am)
=1-e^(-5*1)(5*1)^(0)/0!+(5*1)^(1)/1!+(5*1)^(2)/2!+(5*1)^(3)/3!)
=0.7349

b)
P(T6>4) = P(number of arrivals between 8-12 is exactly 0, 1, 2, 3, 4, or 5)
= e^(-5*4)*(5*4)^(0)/0!+(5*4)^(1)/1!+(5*4)^(2)/2!+(5*4)^(3)/3!+....)
=0.0000719

c) The 3rd arrival time is the sum of the first three individual arrival times. These are all distributed exponentially with Var=1/λ^2=1/25. Since the three random variables are independent, we can sum their variances to get Var(T3)=1/25+1/25+1/25.

d) Let U = time taken to serve 1st customer
T = time between arrival of 1st and second customer
f(U)=1/(4-0)=1/4 when 0<=u<=4
f(T) = 5e^-5t when t>0, 0 elsewhere
Because of independence, the joint probability density function f(U,T)=1/4*5e^(-5t)
customer has to wait ------> we want P(U>T)=1-P(T>U) because it is easier to integrate

∫ ∫1/4*5e^(-5t)dudt where inner integral is over (4, infinity) and outer is over (0,4)

e) same as d but with the integrand as multiplied by u-t since that is the waiting time

Last edited: Mar 22, 2015
2. Mar 22, 2015

### lotsofmoxie

especially on a, b, c I'm not sure if I'm doing it right (my answer for b seems intuitively too small).

3. Mar 22, 2015

### Ray Vickson

Your methods and answers to (a)-(c) are OK. You did not write down the complete, final solution to (d), so I cannot tell if it is OK or not. (The method you used is fine, but I cannot tell if you made any errors when doing the integrations.)

As for (b): it is small, but that is not too hard to fathom: the mean number of arrivals from 8 to noon is 5*4 = 20, with standard deviation = √20 ≈ 4.472. Your upper limit of 5 arrivals is a bit more than 3.5 standard deviations below the mean, so, the answer should be small. However, it is surprising to see exactly how small it is. Anyway, the answer you give is correct.

4. Mar 22, 2015

### lotsofmoxie

Thank you for responding. It makes sense now.

I'm getting 1-1/e^20 for d). Is this correct?

5. Mar 22, 2015

### Ray Vickson

That is not what I get. If you write out the details, step-by-step, I would be in a better position to comment.

6. Mar 22, 2015

### lotsofmoxie

7. Mar 22, 2015

### lotsofmoxie

Gah

Ok.

∫∫1/4*5e^(-5t)dtdu where inner integral is over (4, infinity) and outer is over (0,4)

Is this the integral you are starting with?

8. Mar 22, 2015

### lotsofmoxie

So starting with the inner integral ∫1/4*5e^(-5t)dt
pull out the 1/4 so we have 1/4 ∫5e^(-5t)dt over (4,oo)
use a substition w=-5t, dw=-5dt--->dt=dw/-5

so the integral becomes 1/4 ∫5e^(w)dw/-5 over (some interval that doesn't matter because I'll convert it back to t before using them)
=-1/4 ∫e^w dw since the 5 and 1/5 cancel and I pulled out the negative
=-1/4(e^(-5*infinity)-e^(-5*4))
=-1/4(0-e^(-20))

=e^(-20)/4

integrating this with respect to u over (0, 4) I get 1/e^20.

Subtracting this from 1 I get 1-1/e^20

where did I go wrong?

9. Mar 22, 2015

### Ray Vickson

No. For $f_T(t) = \lambda e^{-\lambda t} 1\{t > 0 \}$ and $f_U(u) = (1/U) 1\{ 0 \leq u \leq U \}$ we have
$$EW = \int_0^U f_U(u) \, E(W|u) \, du, \; \text{where} \; E(W|u) = \int_0^u (u-t) f_T(t) \, dt$$
You can do the integral to get
$$E(W|u) = \frac{\lambda \, u - 1 + e^{- \lambda u}}{\lambda}$$
The integral $\int_0^U E(W|u) \, du$ is do-able. For $\lambda = 5, U = 4$ I finally get
$$EW = A - B e^{-20}$$
for two constants $A,B$ that I will let you work out for yourself. Numerically, I get $EW \doteq 1.81$ (actually 1.810000000 to 9 decimal places).

10. Mar 22, 2015

### lotsofmoxie

Wait, the problem you just explained was part e, right? I was trying to do d).

Last edited: Mar 22, 2015
11. Mar 22, 2015

### Ray Vickson

OK:
$$P(W=0) = \frac{1}{U} \int_0^U P(T > u) \, du = \frac{1}{U} \int_0^U e^{- \lambda u} \, du =\frac{1}{\lambda U} \left( 1 - e^{-\lambda U} \right).$$
Plug in $U = 4, \lambda = 5$ and see what you get.

I really think that part of your problem stems from using numerical values too soon. It would be better to carry out the computations symbolically as far as you can, then plug in numbers at the last minute. Doing that makes error-tracing much easier. Part of the problem with using numbers throughout is that you may, for example have a '2' somewhere in the calculation, and it is not always easy to tell whether that is something like a 4/2 from the probability distribution parameters (as U/2, say), or a 2 that arises purely from algebra, through squaring or something.

12. Mar 22, 2015

### lotsofmoxie

I got 0.04999999989. I don't see where I went wrong when I did the integral - it didn't seem too messy when I did it putting the numerical values in first, but for some reason it is wrong. I tried plugging it into wolfram alpha, and the answer it gave was the same as the one I calculated, so I'm thinking my integral ∫∫1/4*5e^(-5t)dtdu where inner integral is over (4, infinity) and outer is over (0,4) is set up wrong and does not actually give P(U<T) but I'm really not seeing why.

Last edited: Mar 22, 2015
13. Mar 22, 2015

### lotsofmoxie

****. I wrote my integral down messily and I mistook a u for a 4 in the bounds and never caught my mistake later. It should be ∫∫1/4*5e^(-5t)dtdu where inner integral is over (u, infinity) and outer is over (0,4), which gives the same answer as using your method above.

I really hate myself.

Thanks for all of your help! I really get it now.