[seqfan] New sequence from XKCD - Urinal protocol

David Radcliffe dradcliffe at gmail.com
Wed Sep 2 19:40:20 CEST 2009


An interesting new(?) sequence was described in Randall Munroe's XKCD blog.

Suppose that there is a row of n urinals. The first guy chooses a
urinal at one of the ends, and each subsequent guy chooses a urinal
that is as far as possible from the other guys. No guy will choose a
urinal that is adjacent to an occupied urinal.  Let f(n) be the
maximum number of urinals that can be occupied using this protocol.

Munroe claims that f(n) = 1+2^floor(log[2](n-2)-1)+max(0,
n-(3/2)*2^floor(log[2](n-2))-1) for n>2, but I have not verified this.

http://blag.xkcd.com/2009/09/02/urinal-protocol-vulnerability/




More information about the SeqFan mailing list