Bathroom Conflicts

May 04, 2010 21:57

Today I was sitting on my computer and realized I had to take a piss. Just as I was about to get up I heard my bathroom door close and the shower turn on. I hate it when this happens.

This situation got me to thinking "Who is better off (in terms of not being able to use the bathroom when one wants to), two people sharing one bathroom or four people sharing two bathrooms?" Given that I took a probability class this should have been trivial, but it seems like I have forgotten alot of it. For instance I couldn't remember how to calculate "4 choose 2" anymore.

Anyways, in an attempt to keep my mind busy I decided to calculate which was better. First I needed to decide on a good metric for "best". Originally I was just going to calculate the percentage of the time a bathroom was not in use, but then I decided that was too complicated. Instead I decided to calculate the odds that someone would want to use the bathroom but couldn't.

In my model of the system everyone has probability p of wanting to go to the bathroom during some time span (say, five minutes). This probability stays the same all day. A "conflict" occurs when the number of people who want to use the bathroom is larger than the number of bathrooms. I assume that someone who occupies the bathroom does so for exactly one time span.

A better model would factor in a few more things:
a) once someone uses the bathroom they are less likely to do so again shortly there-after
b) if a conflict arises then one person is near guaranteed to use the bathroom in the next time span
c) some people might use the bathroom for more (or less) than exactly one time span

Given that it is now after 9:30 and I haven't gone running, made dinner, ate dinner, or worked on the grant I'm supposed to tonight, I'm going to stick with the rudimentary model.

I did some calculations on paper and found expressions for the conflict probability for the two situations:

1 Bathroom:
P(conflict) = p^2

2 Bathrooms:
P(conflict) = 6*p^2*(1-p)^2 + 4*p^3*(1-p) + p^4

I opened up Excel and found the conflict probabilities for p=0.01
1 Bath -> 0.0001
2 Bathes -> 0.000592

Then I started to wonder how this changes with p. Are there always about six times more conflicts in two bathroom residences? Here's the result in graph form. One has p ranging from 0 to 100% and the other only has more reasonable p values of 0 to 1%.



Here's the ratio of two baths, four people over one bath, two people versus p:



From here we can see that (at least between 0.1% and 1%) that the relationship is linear and that the ratio decreases as p increases.

Next I decided to do an asymtotic check. What happens as p->0? Does the ratio blow up? A quick check shows that it approaches 6. Looking up at the equations above this makes sense. For small p the terms with the lowest order in p will dominate. Since (1-p) -> 1 for small p, the two bathroom case approaches six times the one bathroom case.

Hooray for summer!
Previous post Next post
Up