Say you are on a side street in your car and you want to get onto a larger street.
Assume that you have to cross two lanes of traffic (one for each direction) to get on the road (i.e. you are turning left in the U.S. or turning right in the U.K.)
Also assume that gaps large enough for you to cross arrive in each lane according to a Poisson distribution, and the arrival processes are independent for the two lanes. (Although they don’t have to be identical, let’s say one has parameter lambda1 and the other lambda2)
My question is, and this occurs to me every day when I try to get onto the main road, what is the expected wait for a gap to appear in both lanes (so that I can get onto the main road) as a function of the arrival process parameter.
The expected wait for a gap to appear in just one lane (if you’re turning right in the U.S. or turning left in the U.K.) is quite straightforward. If I recall correctly from ages ago the expected wait is trivially related to lambda .
I want to compare the expected wait for turning left vs turning right.
Are there any math people who know the answer off the top of their heads, or is this something that needs a lot of work?
The waiting time until the first occurrence of a Poisson process (in your case, an empty lane) is exponentially distributed. Using L for lambda, since I don’t know how to use Greek font, the pdf for an exponential distribution is
f(x) = Le[sup]-Lx[/sup]
With two processes with parameters L[sub]1[/sub] and L[sub]2[/sub], the pdf becomes
f(t)= the integral from x=0 to x=t of
( L[sub]1[/sub]e[sup]-L1x[/sup] * the integral from y=0 to y=(t-x) of
L[sub]2[/sub]e[sup]-L2x[/sup] )
Work out that double integral to get the pdf, integrate to get the cdf, and you can figure out the mean wait time.
By the way, do you write actuarial exam questions in your spare time :eek:
It occurs to me, however, that this probably isn’t a good model for your traffic situation. You’ve described a condition where the default is traffic, and you wait for a periodic gap, and once the gap arrives, it lasts . . . forever.
That works if you have a median so that you can go halfway and then wait for a gap in the other lane. If you don’t, you need to specify not only when the gaps arrive but how long they last, and that will make things rather more complicated.
Also I gave a formula for F(t), not f(t). And the last little “x” should be a “y”. It’s hard to do math posts without typos.
Thinking about this for just a moment, is it reasonable, as Freddy points out, to assume that the gaps are a poisson process? It seems more reasonable to me that the cars would arrive as Poisson process with high frequency. Perhaps. Thoughts, anyone?
No, there is no median. If there was a median, then the expected time to get on the road would just be the expected time to cross lane 1 plus the expected time to get on lane 2. It would be trivial.
In the current setup, you have to wait for a “good gap” to arrive at the same time in both lanes. I define “good gap” in a particular lane as a gap that is long enough to enable you to cross than lane. It in no way has to last forever.
I think assuming the cars arrive as a Poisson process is incorrect when there is a lot of traffic. With a lot of traffic, you usually have a steady stream of cars, occasionally broken by gaps.
If you ignore the gaps that are too small for you, and just focus on the “good gaps”, you can consider the situation as being a steady stream of cars and bad gaps, occasionally broken by good gaps.
I assume the good gaps are Poisson distributed, which might be a stretch, but, hey, it’s good enough for some basic calculations.
Then you need to specify how long a gap lasts relative to your two lambdas. The Poisson process models point-in-time events such as the beginning or end of a gap; the probability that such an event will occur at the same time in both lanes is infinitesimal.
I agree. It seems we need to assume that we have success at time t if a good gap arrives in lane 1 at time t, and a good gap arrives in lane 2 anywhere between t-delta and t+delta, where delta can be a model parameter.
(i.e. let’s find the answer with delta included)
We have two states for a lane to be in, ‘good’ and ‘bad’ . State changes occur at random times according to some distribution, most likely differing for whichever state you’re in (thus the ‘bad’ state can last longer). This could be done by having two Poisson variables.
The trick is to then figure out the probability of what state a single lane is in at any given time, then the probability that two lanes together are both in the good state.
That may be more (or just the same as) difficult, and I apologize for not working it out.
Well, the probability of success when you first hit the intersection is simple enough–it’s the probability that each lane has had a gap event within the previous delta, or (1-e[sup]-L1delta[/sup])(1-e[sup]-L2delta[/sup]). But from there your wait time depends on the initial state–you can find neither lane open, or one lane open at any time within its gap interval. And if neither lane is open, either one can open first. I’m afraid it’s beyond me.
OK, so I ended up simulating this, since I’m mostly interested in a ballpark figure, and don’t care too much about getting a closed-form expression (although it would be nice )
The number I was after was the “wait ratio”: the ratio of the waiting time to cross two lanes versus just one.
If the two lanes are i.i.d, both with parameter lambda, then the wait ratio is only a function of delta/lambda.
The numbers I got are
It turns out that a good approximation for the wait ratio (for delta/lambda in the range 0.01 to 0.1), is 1+1/(2*delta/lambda), as you can see from the numbers above.
Anyway, the point is that if the “tolerance” in arrival times (delta) is 1/10 the average gap arrival time (lambda), it is about 6 times slower to cross two lanes instead of one.
If the tolerance goes down to 1/100, then it is about 50 times slower to cross two lanes instead of one.
(Which explains why, when I just turn right, turn left into a small parking lot, and then right onto the lane I wanted to get onto, I often get on the road much faster than waiting for both lanes to clear up)
Well, the Poisson process is a basic assumption of traffic modeling, but (I assume) one needs to be speaking of time frames long enough for the arrivals to be independent. At a specific cross street over a short period of time, the car arrivals aren’t independent at all, since cars platoon up behind the relatively slow drivers. The extent to which this happens will be dependent on the characteristics of the road. (For example, if the crossroad is relatively close to a stop sign on the main road, the chance for gaps will be seriously reduced since stop signs have a clearing rate of about five seconds per car and there’s little chance for the cars to group up.)
Generally speaking, then, there are going to be quite a few variables going into the question. If you want to get more specific, I’m sure you can do that.
One might suppose that a good rough & ready assumption would be that the slow drivers are coming independent of each other, since they don’t catch up w/ each other, then guess their incidence in the population and let them arrive w/ the appropriate distribution. Then, getting more complicated, you’d imagine each “vehicle” to be the length of the number of cars in a typical platoon. That might give you back your independence and make the problem more manageable.