Hacker News new | past | comments | ask | show | jobs | submit login

Yes, and it is how real stores work, which is the point.



Except that the "primary" queue doesn't feed into the shortest register queue, it feeds into the register queue that the person at the front of the primary queue anticipates will empty the fastest. That's the premise that underlies the whole article: people get in the line they predict will move the fastest, and everyone uses different variables and judgment to make that prediction. Those variables and those predictions don't show up when your model is based on distributions.

The register queues are not independent, but they are not related as simply as you say.


>everyone uses different variables and judgment to make that prediction. Those variables and those predictions don't show up when your model is based on distributions.

Sorry but that's simply not true. everyone uses different variables and judgment to make a phone call, yet phone calls follow an exponential distribution! everyone uses different variables and judgment to hit the internet, yet network traffic follows a Lavalette distribution. everyone uses different variables and judgment to buy stocks, yet equity prices follow a lognormal distribution.

Individual behavior in aggregate will almost always follow some distribution, regardless of each individual using different variables and judgment for himself. The whole point of statistics is to uncover the underlying probability distribution given tons of (seemingly random) data. Math does the opposite ( ie. given the distribution, a mathematician can tell you how to derive nice things like the moment generating function & the first & second moments & density functions & related family of distributions & so on, & in general give you n sample variates that fit the distribution. By saying "everyone uses different variables and judgment" you are in essence saying its just too complicated, but even if that were true, that is just another distribution ( white noise )


"Phone calls follow an exponential distribution"

I'm confused as to the meaning there. What is it about phone calls that follow an exponential distribution? Their duration? Their quantity per capita per time of day?


>I'm confused as to the meaning there. What is it about phone calls that follow an exponential distribution?

Sorry for the confusion. Lemme clarify a bit. Say you work at an office. 9am to 5pm. 8 hours a day.

scala> 60x60x8

res45: Int = 28800

So a phone call can arrive in any one of those 28,800 seconds. Putting it another way, the probability p of getting a phone call at any particular second is very remote, but the number of seconds aka trials is n=28800 ie. very large. Anytime you have very small p and very large n, that's a nice candidate for a particular member of the exponential family of distributions. In this case, the arrival times of phone calls to your office will be Poisson.

Say you hire an office assistant to count the number of phone calls every day, and she tells you after a month that your office averages say 24 calls a day. That 24 is your mu, the mean of the Poison distribution.At that point you know everything you need to know about the distribution, because Poisson is a discrete distribution whose probability p is specified entirely by the mean mu!

So you can go off and compute the probability p like so:

scala> import scala.math.{exp,pow}

scala> def fact(n:Int):Int = { if( n>1) nfact(n-1) else 1}

scala> def p(mu:Int,n:Int) = {pow(mu,n)exp(-mu)/fact(n)}

The chances of your office getting 4 or fewer phone calls by noon is then easy to figure out. Since you average 24 calls in 8 hours, you should average 9 calls by noon. So the probability of getting 4 or fewer calls would be

scala> (0 to 4).map(p(9,_)).sum

res46: Double = 0.05496364149510491

So you have a 5% chance of getting 4 or fewer calls by noon. If someone offers to bet a million dollars that your office will get 4 or fewer calls by noon, the odds of winning that bet are 1 in 19.

edit:formatted for better readability.


Thanks for explaining it that way, I think I understand better now.

Would you agree, though, that customers wouldn't simply enter the shortest available line?


>Would you agree, though, that customers wouldn't simply enter the shortest available line?

I don't agree with that at all. In reality, some would and some wouldn't do what you suggest. If all of them did exactly what you are suggesting ( some sort of extreme rational agent), the distribution wouldn't be exponential. But then, all human beings don't buy low & sell high, nor do all of us withdraw money from the same ATM at the same time, nor do we make phone calls at the same time, or hit the internet at the same time. Aggregate behavior distributions modelling aggregate behavior of individual humans work well except in very extreme conditions such as 911 when everybody does indeed make the phone call at the same time thus jamming up the airwaves and killing the shape of the nice Erlang distribution at the telephone exchange.


Right. I wonder what would happen if we try to include a measure of perceived fairness from the customer's point of view into this type of analysis. I always feel I'm picking the wrong queue at stores... single queues going to whatever cash is open seem fairer, if that makes sense.


Perceived fairness is very hard to quantify objectively. Is it fair if there are queues for people buying less than X items? If there are queues for people not paying cash? For frequent flyers? That you, by sheer misfortune, end up in the slow queue three times in a row? Should pensioners wait for people having work to do? Should fit people make room for the elderly? To what extent? Etc.

Instead, I think you should do the math; it will teach you that the probability that a given queue is slow is smaller than the probability that, given a person in a queue, that person is in a slow queue.

So, you spend more time in slow queues than in fast ones. Once you know that, train yourself to accept it.


That's because if there are 4 lines there is generally a 75% chance that one of the other lines was faster.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: