Wednesday, November 14, 2012

Odd Even Rationing and Queue Effects

In a thread over at Bob Murphy's I made the case that segregating drivers into Odd and Even days for buying gas will usually just make things worse. I gave several abstract reasons why. Later Bob collected these and his own contributions into a coherent statement, since revised, and he plans another post to lay out the arguments more fully. (Here) In support I am going to present a simple numerical example to illustrate what I think is the main effect: unbalancing queues.

Left to themselves drivers will join lines when they are shorter and avoid them when they are longer. This smoothes out the queue lengths. Odd/Even prevents drivers from doing this. How?
Imagine Bob has an odd plate and is driving on an even day. He sees a shortish line but cannot join it.
Or next day Bob is wondering if he has enough gas. He'd like to wait and see, but the rationing makes waiting risky: he might not be able to wait two days. He'll join the line even if it is long.
Or perhaps there are just more odd-plated drivers where Bob lives, so the lines are longer on odd days.

Odd/Even rationing unbalances queues.

Consider then two queues.
Each driver in the queue takes one time period to get and pay for gas.
This isn't realistic, as some buy more gas, and some piddle around with cash, but it will do as a first approximation.
And let's further assume that new cars arrive at one per time unit at the end of the queue.
This is more subtle.
Drivers are reluctant to queue when the line gets long, and eager to queue when it shortens. So we will generally reach a period of approximate equilibrium where the line reaches a steady length. Not exact but close enough for government work. I'll discuss the other cases below in case this assumption worries you.

We can think of just the people in the queues at a given moment.
So lets put 3 people in queue Even and 5 people in queue Odd

Even: a b c
Odd : P Q R S T

(This is 5-3 split is perfectly fair on my part: I am examining the effects of unbalancing the queues, and a difference of 2 is the smallest relevant difference.  S's arrival would lengthen one queue no matter what but T was compelled to join the longer queue when he arrived.  Add another Odd driver and it gets even worse. So this example shows the smallest effect of forced unbalancing.)

What's the total amount of waiting and filling for these folks?
In Even it is 1 for a, then 2 for b (he waits for a then spends his time) and 3 for c (who starts when b is done). Total 6.
And in queue Odd it is 1 + 2 + 3 + 4 + 5. Total 15.
Grand total 21.

What if T could move into queue Even? Then we get 1 + 2 + 3 + 4 for each queue.
Grand total 20.

So the inability to smooth out queues has made things worse.

This holds even if the queues keep getting longer until say 9 pm or if some people randomly take longer than others.

Now what happens if new people don't arrive as fast as the queue empties? This will happen late at night for example. Then we get shorter or empty queues and the costs are more obvious. For example after 3 periods queue Even is empty and in queue Odd person T is still waiting when he could have found an empty pump. Segregation has cost T and benefitted no-one.

And what happens when people arrive faster at the tail end? Then the queues keep getting longer. Since our population is finite we have to eventually reach the steady state or the shrinking queue case. We already looked at those.

And what if not everyone uses the same amount of time at the pump? Then it gets a bit trickier and all results become probabilistic. But the main effect remains.
Let people use between 1 and 4 units of time once they pull up to the pump.
Then we get queues that look like this, replacing names with pump times:

Odd: 1 3 3 2 1 4 2 1 4

To calculate the time spent pumping and filling start at tail-end Charley.
He waits for everyone ahead. Here that is 1 + 3 + 3 + 2 + 1 + 4 + 2 + 1.
Then he pumps for 4. So his elapsed time is the sum of everyone's pump time up to and including himself. This is true of driver n, his time is the sum of all times of drivers 1 through n.

If you play around you'll find you want (more or less) queues with even pump times.
So segregation by pump time can help. Think of express lanes at the supermarket: lots of fast shoppers in lane Odd and a few with big baskets in lane Even. Imagine 6 odds at a minute each and three evens at 4 minutes each.
Then we get this:

Odd: 1 1 1 1 1 1
Even : 4 4 4

The totals are 21 and 24, which is pretty closely balanced.
In this example odd/even segregation benefits these drivers. But this example is pretty special.  Any arbitrary form segregation can in fact by dumb luck help achieve pump time segregation. Odd/even or bald/hirsute can conceivably give us pump time segregation. Giving blue-eyed drivers priority can also, by blind luck, more the faster drivers to the front of the line. But the chances are remote. In the real world, odd/even is far more likely to make things worse.

It's common sense really, disguised by the time shifting. You ever see the line-up at the women's during intermission?

No comments:

Post a Comment