Expectation of a Poisson Process

Cars pass a certain street location according to a Poisson Process with rate $\lambda$. An old lady and her trusty boyscout want to cross the street at this location. They wait until they can ensure no cars will pass in the next T time units. Find their expected wait time.

I'm approaching this via the double expectation formula, but I'm getting stuck towards the end of the problem.

Let $W$ = a random variable representing the expected wait time
Let $X$ = a random variable representing the time until the first car passes.

Then, I can say: $$E[W] = E[E[W|X=x]]$$

Where $$E[W|X=x] = \begin{cases} 0, & \text{if }x\geq T \\ x + E[W], & \text{if } x < T \end{cases}$$ So Then $$E[E[W|X=x]] = \int_0^\infty E[W|X=x] * \lambda e^{-\lambda x}dx$$ $$= \int_0^T E[W|X=x] * \lambda e^{-\lambda x} + \int_T^\infty E[W|X=x] * \lambda e^{-\lambda x}$$

According to how I defined $E[W|X=x]$, the second integral should drop out because $E[W|X=x] = 0$ for $X \geq T, correct?$

So what I'm left with is the following:

$$E[W] = \int_0^T (x + E[W]) * \lambda e^{-\lambda x}$$

Now I'm not exactly sure how to reduce this further as it is recursive. Also, I saw another solution which does not drop out the second integral as I have, but evaluated it instead, which I found somewhat odd. I'd appreciate any explanation about how to proceed further.

Again, to clarify, I am interested in how to handle the recursive nature of this integral. Not to mention, I did not find the explanation on the "duplicate" to be very straightforward and I would like further clarification. Hence this question is different from the said duplicate and I would appreciate that it be reopened.

• It seems this was addressed in this post, math.stackexchange.com/questions/195560/… – Erik M Mar 24 '14 at 4:48
• meh, not entirely; it confuses me more I think. – audiFanatic Mar 24 '14 at 5:32
• audi: Still confused after the explanation you got over there? – Did Mar 24 '14 at 6:34
• Yes, like I say above, I'm confused about what to do with this recursive integral. I'm gonna go to bed; need to be up in 3 hours. But I will look at this again tomorrow (or technically later today) – audiFanatic Mar 24 '14 at 6:37
• @audiFanatic Your last equation is just (integration by parts) $$E[W] = \frac{1 - e^{-\lambda T}}{\lambda} - T e^{-\lambda T} + (1-e^{-\lambda T})E[W],$$ whose solution is $$E[W]= \frac{1 - e^{-\lambda T} - \lambda T e^{-\lambda T}}{\lambda e^{-\lambda T}}.$$ This is the same as the solution given in the link by Erik. Your integral isn't really recursive per se. I don't know about this other solution you found, but the one at the link is really nice. – Rookatu Mar 24 '14 at 14:40