Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27125
Joined: Oct 14, 2009
January 4th, 2017 at 4:50:22 PM permalink
Suppose you're at a large outdoor festival that has n public outhouses. Assume they are all vacant and in varying degrees of cleanliness. Your object is to use the cleanest one. However, you can only check them one at a time. Furthermore, once you check an outhouse you must immediately accept or reject it. If you reject it, you can't go back to it.

The question is what strategy will maximize your odds of success? Given this optimal strategy, what are the chances of success?

As always, please put answers and solutions in spoiler tags. Free beer to the first correct answer to each of the two questions.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
TomG
TomG
  • Threads: 16
  • Posts: 2466
Joined: Sep 26, 2010
January 4th, 2017 at 5:19:11 PM permalink
Where's the poll question about beers in outhouses?

Whenever I see a math video on youtube there will always be a something on the right side about how math can help you find the right person to marry: reject the first 0.37N, then pick the first one that is better than any you've ever seen. There is a roughly 37% chance you'll find the best place to go poop depending on the size of N.

There's something about 100 divided by e involved here
TheoHuxtable
TheoHuxtable
  • Threads: 7
  • Posts: 61
Joined: Feb 24, 2016
January 4th, 2017 at 5:20:29 PM permalink
Walk past the first n/e outhouses and determine which of those outhouse's was the cleanest. Enter the next outhouse which is as clean or cleaner than the one which was just determined.
Views are my own...
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
January 4th, 2017 at 5:39:11 PM permalink


Walk past the row of outhouses. Observe the number of footprints leading to and from the doors. Choose the one with the least tracks. If it is fouled despite little use, pick the next - least tracks evident.

If the House lost every hand, they wouldn't deal the game.
monet0412
monet0412
  • Threads: 9
  • Posts: 627
Joined: Feb 18, 2016
January 4th, 2017 at 5:41:58 PM permalink
Locate the Park Manager. Ask him to help you locate the nearest porter/janitor. Ask or better yet... BRIBE the Park Manager and porter/janitor to close the nearest restroom and clean and disinfect it. Wait for him to reopen the restroom and only allow you to use it until you have relieved yourself. After you have finished they may reopen the restroom to the public.


Drive to your nearest store that carries bathroom cleaning supplies and an out of order sign. Close one restroom of your choice. Clean it spic and span. Now pick and use this restroom and reopen it when finished


Perhaps this is better. Pay your friend to go buy a bunch of cleaning supplies for bathrooms and have him clean one of them while you stand guard. When he is finished you choose this restroom out of the blue and determine that it is by far the most clean facility in the festival and you can now urinate in peace.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6743
Joined: Jun 22, 2011
January 4th, 2017 at 7:29:51 PM permalink
This is a variation of the Secretary (or Sultan's Dowry) Problem.

What I would like to see is a proof of the answer...

There's a follow-up question: what is the solution if you are told that if you use the method for the first problem, you will be wrong?
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27125
Joined: Oct 14, 2009
January 4th, 2017 at 7:36:07 PM permalink
It looks like this problem is more common than I thought. TomG was the first to answer both parts correct.


1. Yes, check out the first n/e outhouses and then pick the next one after them that is cleaner than the best of that set.
2. As n approaches infinity, the probability of success approaches 1/e.

Interesting how e is in both answers.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
onenickelmiracle
onenickelmiracle
  • Threads: 212
  • Posts: 8277
Joined: Jan 26, 2012
January 4th, 2017 at 11:49:24 PM permalink
What I would do would turn to the left, since most people turn to the right, then walk to the farthest one away, since others are least likely to walk to the farthest away. It's always better being long on wisdom.
I am a robot.
odiousgambit
odiousgambit
  • Threads: 327
  • Posts: 9776
Joined: Nov 9, 2009
January 5th, 2017 at 2:11:26 AM permalink
I went back to the toilet thread at DT and it didn't help me a bit.

Make Monty Hall appear and indicate the one you picked might be the cleanest, then show you another outhouse and say "the cleanest is one of the two". Answer to part 2: pick the other one Monty suggests
Last edited by: odiousgambit on Jan 5, 2017
the next time Dame Fortune toys with your heart, your soul and your wallet, raise your glass and praise her thus: “Thanks for nothing, you cold-hearted, evil, damnable, nefarious, low-life, malicious monster from Hell!”   She is, after all, stone deaf. ... Arnold Snyder
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
January 5th, 2017 at 3:34:11 AM permalink
Quote: onenickelmiracle

What I would do would turn to the left, since most people turn to the right, then walk to the farthest one away, since others are least likely to walk to the farthest away. It's always better being long on wisdom.



At least with public restrooms, I believe the first stall tends to be the cleanest (typically). Unless it's an airport or some casino bathrooms, where there are many stalls, in which case the last one is cleanest. But the ones in the middle tend to be dirtiest, or at least, most frequently used.
onenickelmiracle
onenickelmiracle
  • Threads: 212
  • Posts: 8277
Joined: Jan 26, 2012
January 5th, 2017 at 4:01:36 AM permalink
Quote: RS

Quote: onenickelmiracle

What I would do would turn to the left, since most people turn to the right, then walk to the farthest one away, since others are least likely to walk to the farthest away. It's always better being long on wisdom.



At least with public restrooms, I believe the first stall tends to be the cleanest (typically). Unless it's an airport or some casino bathrooms, where there are many stalls, in which case the last one is cleanest. But the ones in the middle tend to be dirtiest, or at least, most frequently used.

You keep looking after the first stall is clean or are you looking for a dirty one?
I am a robot.
RS
RS
  • Threads: 62
  • Posts: 8626
Joined: Feb 11, 2014
January 5th, 2017 at 4:27:46 AM permalink
Quote: onenickelmiracle

Quote: RS

Quote: onenickelmiracle

What I would do would turn to the left, since most people turn to the right, then walk to the farthest one away, since others are least likely to walk to the farthest away. It's always better being long on wisdom.



At least with public restrooms, I believe the first stall tends to be the cleanest (typically). Unless it's an airport or some casino bathrooms, where there are many stalls, in which case the last one is cleanest. But the ones in the middle tend to be dirtiest, or at least, most frequently used.

You keep looking after the first stall is clean or are you looking for a dirty one?


What, I can't live my life on the wild side?
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6743
Joined: Jun 22, 2011
January 5th, 2017 at 9:03:09 AM permalink
Quote: ThatDonGuy

This is a variation of the Secretary (or Sultan's Dowry) Problem.

What I would like to see is a proof of the answer...



I found one that shows that, as the number of secretaries / daughters / stalls approaches infinity, not only is the solution "skip the first 1/e of the selections, then take the first one that is better than all of the ones before it," but the probability of success is also 1/e.

Melco
Melco
  • Threads: 1
  • Posts: 14
Joined: Feb 16, 2015
January 5th, 2017 at 11:37:57 AM permalink
I'm not sure I'd want to optimize my algorithm for the cleanest bathroom... because it only guarantees you success a portion of the time. Which means you will end up at the last outhouse 1 minus that, despite its condition, and you will be forced to use it.

I'd think there is a threshold of bathroom that would be tolerable vs. intolerable. To maximize finding at least a tolerable bathroom, you can sample less and choose from more.

I believe the answer to maximizing your expected bathroom experience is looking at the first sqrt(N) outhouses, then picking the one that is the cleanest after that. In this case, you'd look at the first 10, then pick the first outhouse that is cleaner than the cleanest of that 10.


Not sure how to calculate the odds of finding an "acceptable" bathroom is under this method until we define the threshold for acceptable.
TumblingBones
TumblingBones
  • Threads: 29
  • Posts: 529
Joined: Dec 25, 2016
January 5th, 2017 at 1:58:58 PM permalink
Quote: Wizard

It looks like this problem is more common than I thought. TomG was the first to answer both parts correct.


1. Yes, check out the first n/e outhouses and then pick the next one after them that is cleaner than the best of that set.
2. As n approaches infinity, the probability of success approaches 1/e.

Interesting how e is in both answers.


I would argue that while this is the correct solution for the Sultan/Secretary problem, it is sub-optimal for the Outhouse problem as stated. The sultan's daughters form an non-ordered set that must be visited in a sequence imposed by the sultan. The outhouses however can be ordered or partially ordered due to fixed positions that are known a-priori. Furthermore, you determine the sequence in which you examine the outhouses. This can be taken advantage of via a minor modification to improve the solution. As beachbumbabs noted.....


... context (i.e., traffic analysis) can be exploited. Assume however there are no footprints (e.g., the outhouses are located on asphalt). You can still infer that outhouses closer to the audience will see more usage than those farther way (i.e., there is a correlation between location and cleanliness). If so, skipping the 1st n/e and then picking the next one that is cleaner than the best of that set will always result in picking the ((n/e)+1) member of the set. The optimal solution for an ordered set would be to uniformly sample the set. If the outhouses are clustered in groups around the festival grounds then the sampled set should include a proportional number of outhouses from each cluster. Thus the optimal solution is to use a uniform distribution to randomly select the n/e outhouses that form the initial set.
Last edited by: TumblingBones on Jan 5, 2017
My goal of being well informed conflicts with my goal of remaining sane.
  • Jump to: