Urinal protocol vulnerability

When a guy goes into the bathroom, which urinal does he pick?  Most guys are familiar with the International Choice of Urinal Protocol.  It’s discussed at length elsewhere, but the basic premise is that the first guy picks an end urinal, and every subsequent guy chooses the urinal which puts him furthest from anyone else peeing.  At least one buffer urinal is required between any two guys or Awkwardness ensues.

Let’s take a look at the efficiency of this protocol at slotting everyone into acceptable urinals.  For some numbers of urinals, this protocol leads to efficient placement.  If there are five urinals, they fill up like this:

The first two guys take the end and the third guy takes the middle one.  At this point, the urinals are jammed — no further guys can pee without Awkwardness.  But it’s pretty efficient; over 50% of the urinals are used.

On the other hand, if there are seven urinals, they don’t fill up so efficiently:

There should be room for four guys to pee without Awkwardness, but because the third guy followed the protocol and chose the middle urinal, there are no options left for the fourth guy (he presumably pees in a stall or the sink).

For eight urinals, the protocol works better:

So a row of eight urinals has a better packing efficiency than a row of seven, and a row of five is better than either.

This leads us to a question: what is the general formula for the number of guys who will fill in N urinals if they all come in one at a time and follow the urinal protocol? One could write a simple recursive program to solve it, placing one guy at a time, but there’s also a closed-form expression.  If f(n) is the number of guys who can use n urinals, f(n) for n>2 is given by:

The protocol is vulnerable to producing inefficient results for some urinal counts.  Some numbers of urinals encourage efficient packing, and others encourage sparse packing.  If you graph the packing efficiency (f(n)/n), you get this:

This means that some large numbers of urinals will pack efficiently (50%) and some inefficiently (33%).  The ‘best’ number of urinals, corresponding to the peaks of the graph, are of the form:

The worst, on the other hand, are given by:

So, if you want people to pack efficiently into your urinals, there should be 3, 5, 9, 17, or 33 of them, and if you want to take advantage of the protocol to maximize awkwardness, there should be 4, 7, 13, or 25 of them.

These calculations suggest a few other hacks.  Guys: if you enter a bathroom with an awkward number of vacant urinals in a row, rather than taking one of the end ones, you can take one a third of the way down the line.  This will break the awkward row into two optimal rows, turning a worst-case scenario into a best-case one. On the other hand, say you want to create awkwardness.  If the bathroom has an unawkward number of urinals, you can pick one a third of the way in, transforming an optimal row into two awkward rows.

And, of course, if you want to make things really awkward, I suggest printing out this article and trying to explain it to the guy peeing next to you.

Discussion question: This is obviously a male-specific issue.  Can you think of any female-specific experiences that could benefit from some mathematical analysis, experiences which — being a dude — I might be unfamiliar with?  Alignments of periods with sequences of holidays? The patterns to those playground clapping rhymes? Whatever it is that goes on at slumber parties? Post your suggestions in the comments!

Edit: The protocol may not be international, but I’m calling it that anyway for acronym reasons.

1,135 replies on “Urinal protocol vulnerability”

  1. Include both pissing length and rate of entry into the toilet, and you’ve got a classic queuing problem complicated by the Akwardness factor.

    Like

  2. I think there’s a certain math to picking theatre seats. I either pick a seat behind the rail so I can put up my feet, or I pick a seat down below with no other seats behind it so that no one’s bratty kid will kick me. Then I put my feet in armrests in front of me so no one will feel compelled to sit there. Also, there must be at last one seat between movie goers unless absolutely necessary, and never sit on the ends unless you are in a hurry.

    Like

  3. Women need to lift their own toilet seats more often, maybe then they would notice the brown “dots” under the seat and the “red” smears under the front of the seat and bowel.

    Like

  4. Yeah, I’m really interested in seeing what you can come up with for the continuous distribution of positions in a trough-style urinal, like a stadiums (stadia…)

    Like

  5. So if you could come up with a female theory for which the abbreviation is 2GIRLS… (or in the spirit of this one, ZGIRLS)

    Zero Germ Insertion of Really Long Sanitary (devices)?

    Like

  6. At my workplace, we have 3 stalls and 2 urinals. TWO URINALS. As you could expect, the urinals dont get used. On the odd occasion that they do get used, only one ever gets used at a time.

    Like

  7. Surely there must be something “mathy” that can be said about women’s long(er) bathroom lines?

    Like

  8. Awkward arrangements are made more comfortable (and therefore efficient) by the inclusion of the ‘half-stall’ projecting walls between urinals. I propose that we pension congress to pass legislation requiring these in all facilities, and to regulating the size of these walls (i.e. as large as possible) to reduce awkwardness in the US.

    Since Congress is primarily male, I’m sure they will understand and respond favorably to this proposal, although we may have to convince Republicans that this is a necessary intervention of ‘Big Government’.

    Like

  9. As a long time Language geek with a fear of math, I must congratulate you on this demonstration–I sent it to my Engineer father with the note “See, if we’d done problems like this, I might have gotten better than a D in Trig. Time to go back for that math degree…thanks.

    Like

  10. …if you want to take advantage of the protocol to maximize awkwardness, there should be 2, 4, 7, 13, or 25 of them.

    There, fixed that for you. (Credit: my wife)

    Like

  11. To the gentleman asking about trough-style urinals, this is a trick question. The only appropriate position for a trough-style urinal is nowhere near it. Are we living in the goddamn dark ages?!

    Like

  12. Actually, your description of how guys choose urinals is exactly how I would have said girls choose stalls (at least here in Australia) – even with a wall in between it’s rude to choose a stall next to someone if you don’t have to, and it’s best to optimise distance.

    Like

  13. Yes! I agree with Fred…. kind of. I’d really like to see something to do with long waiting lines for toilets.

    Basically, women take longer @the bathroom, so it might be argued that there should be more stalls in the ladies toilet. So my question is, what is the optimal ratio of stalls in ladies v stalls, urinals etc in men’s toilets, to minimise situations where there is a HUGE line for the ladies and plenty of spare in the mens? Please. If this is possible.

    Like

  14. I think it would be interesting to see an optimal distribution of homework load across a desk. (i.e. proper placement of a computer, calculator, answer sheet, note sheet, textbook, cell phone, etc.) all the things you need, optimized for best workflow. I am writing this while doing some calculus, and i find that all of these things are necessary, but i have trouble organizing everything so it is optimal for getting work done.

    Like

  15. Brilliantly put – but still at a loss as to why my old high school bathroom had four urinals within two inches of each other, without dividers. Every single bathroom was the same.

    If jaywalking is a crime, then divider-less stalls certainly are.

    Like

  16. There will be discontinuities in the function – ruining your protocol, xkcd –
    if some of the users are GAY (am I allowed to say that here?), because they will then be interested in seeing the other guys////gays equipment.

    Like

  17. Fuck it. I like to CREATE discord. I always take the one next to the guy there. Too bad for him if he feels awkward. That’s what he gets for being an American twit. Believe me, this nonsense is NOT found outside of the USA.

    Like

  18. It seems that the simplest way to achieve maximum efficiency would be to consider only every other (i.e. every odd numbered unit, starting with 1 from left) as an option. From there the current standard rule or maximizing distance between people can be adhered to, provided only those units are used.

    Not only does this guarantee a minimum of 50% efficiency, but it is simple to explain and understand.

    Or, better yet, maintainers of mens restrooms can place an “Out of Order” sign on every other unit, forcing efficiency.

    Like

  19. mklprc, you are mistaken. The fact that you don’t do this does not indicate that no one outside of America does. Australians certainly do.

    Oh, and Eunoia, gay guys don’t want to stand next to someone else who’s peeing any more than straight guys do.

    Like

  20. Actually, this certainly extends as far as Australia, so it qualifies for International.

    @ da5id: How do you know this was a waste of time unless you took the time to read it? 🙂

    Like

  21. @mzhang
    You think you had it bad, at my high school, the upstairs restroom was about 10 urinals that looked like toilets. No dividers whatsoever. You couldn’t get close to them. You had to stand there junk flapping in the breeze. One time I ended up pissing next to one of my teachers. Awkward.

    Like

  22. What about the Trough? What is a guy to do when I walk into the restroom and instead of urinals there’s just one long trough?

    Like

  23. It seems to me there’s a flaw in the math, because 4 is even less awkward than 3, and just as efficient as 6. And as mentioned above 2 is the obviously the worst idea ever.

    Also, I really hated those people in my high school that took urinal 2 of a row of 5 first, so the next person had to walk by (it was pretty narrow too), and the third was out of luck.

    I vote all but 2 stalls (within reason, some places may need more) of every mens washroom get torn out and replaced with urinals. I don’t think I’ve ever seen more than 2 in use at a time.

    Like

  24. Women bathroom lines are long because, what, a 4th of all women hover over the seat and spray every where? And then don’t clean up the seat.

    Those stalls are then declared a no-pee zone unless you’re in a rush and second or third in line. You decide you will clean up that ladies pee and the lady in-front of you will make a “hmph” noise because she didn’t want to, but really has to go as well.

    For any number of stalls in one washroom, there is also a number of these “dirty” seat stalls. (Though it might just be that we take our sweet time peeing, and always have to go, but I swear this is a factor in it.)

    I’m sure there’s some math in it.

    Like

  25. Hilbert actually solved the awkwardness problem long ago, with the lesser-known Hilbert’s urinal. Similarly modelled to Hilbert’s hotel it guarantees no awkwardness whatsoever. Ever. 🙂

    Like

  26. You stole this bit from the “Alphabet of Manliness” by Maddox, which by the way, is the only book you’ll ever need to read.

    Like

  27. You stole this bit from “the Alphabet of Manliness,” by Maddox which, by the way, is the only book you’ll ever need to read.

    Like

  28. Truth be told, the problem of stalls in female restrooms is altered by the fact that when we do enter with good friends (which we all know is frequently) or female family members and we’re both only there to pee, we will take stalls next to each other in order to continue our conversations, especially in bathrooms where there are few other people, or if we’ve had alcohol. Rule of thumb: never invite another girl to the bathroom with you if you aren’t just going to pee.

    Like

  29. People seem to seat themselves this way, too, at least in groups where they don’t know each other. I’ve observed similar behavior in large lecture classes – especially ones with rectangular seating areas – wherein one person will sit off to one side, another will sit far to the opposite side, and then people begin sort of halving the distances.

    Obviously it works a little bit differently in a two-dimensional space than in a linear arrangement, but the basic principle seems the same: each person chooses the spot that more or less maximizes their distances from each other person.

    Like

  30. i have one for you-
    given that if a woman is on birth control, she has a 28 day cycle, which means that the timing of her period changes from month to month (since most months are 30 or 31 days), and given that most women’s periods are between 4 and 7 days of length-
    when is the best time to add a day to the placebo pills (the last seven of a pack) in order to result in a 29 (or 30, if you’re really feeling brave, or are not currently having sex, or are using additional birth control methods) day cycle, and manage one’s cycle in order to avoid holidays?
    ex: my birthday is august 29th, my anniversary is oct. 2nd- some years i can manage to have my period on my birthday, my anniversary, halloween, thanksgiving, christmas, and have cramps for valentines day, all at once. if i could find some way to advantageously add a day or two to my cycle earlier in the year, that would be incredibly useful.

    Like

  31. I was actually at a music festival recently where, in addition to the usual rows of porta potties, there are also men’s urinal tents which consist of a long trough up against one wall of the tent with a pitch to one end where the drain is. This year, someone had the brilliant idea that the urinal trough in the beer tent should be in the MIDDLE OF THE TENT so that more guys could fit around it. This, of course, created the ultimate awkward situation where one would be forced to stand DIRECTLY ACROSS from other peeing guys. Even beer couldn’t help this layout and, after the first day, it was moved back to the wall where it belonged.
    Another point that should be brought up is the effect alcohol has on distribution patterns. Early in the day these troughs could accomidate about 3 guys. By the end of the night it was upwards of 8….

    Like

  32. You forgot to mention the standard solutions when all options are too awkward: You go to the mirror and pretend to comb your hair or straighten up your tie until the slots “open up” a bit more. If you have to go REAL, REAL BAD, for goodness sake!… use a doored stall.

    Love the mathematical analysis… 😀

    Like

  33. I think I’m gonna have to print this out and put it in the bathroom by my lab.

    Like

  34. Pingback: spaetzblog
  35. What about when there are two or more walls that have urinals on them? Then it’s not so bad, as you’re offset by 90 degrees from your wee-neighbour. But you must be careful to avoid elbow contact, in case he thinks you’re nudging him….

    Like

  36. There is something interesting with this model. If an user knows it, then he can make unnecessary to make to know to the rest. That is an example of a difference of lidership in a population that thought they are in a good way of evolution, but with him will be better.

    That is an evolution for the Dawkins theory of memes.

    Like

Comments are closed.