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,070 thoughts on “Urinal protocol vulnerability

  1. The solution is obvious: you just make a sequence of 1-stall urinals with a blind between them, Thus making every urinal optimal and giving a 100 % coverage.

  2. Pingback: Simulasi memilih tempat kencing optimal di toilet pria dengan Urinal Man - uTekno

  3. Can we see the analog transform for when there are no urinals but instead a trough? I image trough length and average hip width may cause multivariable problems…

  4. Why don’t they just leave a big space between each urinal and/or put a divider between each urinal so people can have privacy, like at an ATM machine? DUH!

  5. What about guys who go together in groups of two or more to the movies and won’t sit next to each other…IN A PACKED THEATER. No one assumes your gay dude…unless you hold hands or make out with your friend, no one thinks you’re gay. Get over it.

  6. I interpreted the mens room as always leaving 1 space between you and your nearest neighbor, instead of having the first and last urinals occupied by default.

    Here is my formula for efficiency based on the occupation of urinals in a 1 3 5 7 9… fashion, always leaving 1 urinal between you and another guy.
    n= number of urinals

    maximum number of guys that n can accommodate=
    ((5-(-1)^n+(2*n))/4)-1

    efficiency in percent =
    ((((5-(-1)^n+(2*n))/4)-1)/n)*100

    max is 66.67% lowest is always 50 as N/Men=2
    apologies for all the brackets i just took this straight off of excel.

  7. Credit to Peter Sach.

    The algorithm becomes more complex when you start to dictate where the first person goes. Then it is possible to fill more numbers of urinals optimally, according to the rules above. for example, 7 urinals can be filled optimally if the first person uses urinal 3 (or 5 by symmetry). Under this regime, the smallest number of urinals that is filled sub optimally (i.e. f<floor((n+1)/2) is 15. Then n=16 to 22 can be filled optimally, before 23 being a pain. Have a go!

    ***SPOILER ALERT***
    A few observations for calculation of the optimal places to stand (brute force on a computer)
    1. Symmetry. only need to check positions 1 to floor((n+1)/2)
    2. Starting at the end is the same as starting in the middle – the first three occupied urinals are the same.
    3. Starting at an even urinal will never lead to a more optimal packing than choosing a specific odd numbered urinal – since filling in every second urinal towards the first will lead to the first urinal being empty.
    4. If any gap between a two occupied urinals is even, this will be filled sub optimally – e.g. 4.. only one of the 4 will be filled.
    5. Gaps of length 2^k – 1 will always be filled optimally – so aim for these! this means that if n = 2^k + 2^l +1 for some k,l then there is an optimal choice of the first urinal at i=2^k +1. This gets more and more complicated for more levels of decomposition.

    I'm sure someone out there has developed a function that tells you the maximum number of filled urinals for a given n, and where the first person should start. It is almost always not in at an end, or the middle, except for the above mentioned n=2^k + 1.

    Then all you need as a bathroom designer is for the first person entering the bathroom to be a mathematician, and well, who doesn't have a maths degree?

    New job: Stand in bathrooms telling people where to pee…

  8. Some phenomenal work there. My slight beef with it is that the second entrant going to the far end would, where n>4, be in violation of lads’ compliance regs 101.

    To put distance between you and the next man is good manners, but to maximise distance is to show fear.

    By major beef is that the idea of optimum numbers of urinals suggests that there is a problem going next to another dude. There isn’t. What this guy’s functions are describing is the point at which it is polite to go next to another dude i.e. when there are no big gaps left.

    In fact, I would argue where n>10 one man gaps will be filled under lads’ best practice optimisation protocols while larger gaps still exist.

    For instance, where n=10 I suggest order would go:

    1, 4, 6, 8, 3, 2, 10, 5, 9

    This assumes that a dude won’t walk more than 7 past the first available urinal to find one with a gap.

    I have filled 3 before 2 because, although 2 is closer, it requires a sharper turn, implying preference. Also, the approach to 3 is open to the guy at 4 whereas the approach to 2 is blind to the guy at 1. Transparency is key in the current regulatory environment.

  9. Or…you can just be a fucking adult and urinate wherever there is an available urinal regardless of where anyone else may also be urinating. Urinating next to another male isn’t going to turn you gay and and you can usually trust that you won’t get anyone else’s urine on you.

  10. My brother recommended I might like this web site. He was entirely right. This post truly made my day. You can’t imagine simply how much time I had spent for this information! Thanks!

  11. Pingback: Quora

  12. I abide with the one urinal apart policy. That means, I find an even number (n) of urinals pointless when they could’ve had the same capacity with n-1 urinals.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>