
Now, the first thing to note is that all of my workmates have agreed that the room with the basin in it is straight away far too close for someone on the loo to feel comfortable if someone was in there. Not only that, but the gap in door B means that if you were on the loo, having someone standing in that room would just be horrific. So really, if the loo is occupied, it's not really appropriate for you to come through door A at all. However, if door A is closed, there's no way to know if someone is in there or not. And this is where things get tricky.
The problem can be defined as a number of states and results. The states for each item can be defined as follows (D was only really relevant for the diagram):
Door A: can be open or closed, and locked or unlocked.
Door B: can be locked or unlocked
Toilet C: can be occupied or unoccupied.
Now, the optimal state for you to find the loo in is with door A unlocked and open, and door B unlocked with C vacant. If you were to find A and B as above, with C in the occupied state, then you'd have to question the sanity of the user. So, the real problem is which A&B states imply which C states. Most preferable is being able to predict C from A, as if you can assess the state of B, and C is occupied, you're already in the occupant's personal space at a time I know I wouldn't want you in mine. The other day, I'd locked door A (which is always the best option) and someone UNLOCKED it to put something in the bin at point D. This is downright rude, quite disconcerting, and it made me feel violated for the remainder of the day.
So looking at this logically, there's a finite number of states, and it may well be worth listing them. For the exercise, we'll call A being locked/unlocked A1, and A being open/closed A2. When A1 or B is locked, we'll call that true and unlocked false. With A2, closed is true, open is false. C is true if occupied, or false if unoccupied. So it follows that:
A1 and A2 and B --> !C :someone has done the right thing, and locked A.
A1 and A2 and !B --> C :loo hasn't been unlocked this morning.
Straight away though, there's an issue. You can see that the state of B directly affects the state of C if A1 and A2 are both true. However, when A1 and A2 are both true, you can't ascertain the state of B without already going too far. If !C and you change the state of A1 and/or A2, then you've done precisely what we want to avoid. Anyway, let's continue.
A1 and !A2 and B --> !C :occupant hasn't closed A properly after locking.
A1 and !A2 and !B --> C :someone has pushed button accidentally on their way out the door.
!A1 and A2 and B --> !C :see below
This previous case presents another factor. By observing the state of B when C is occupied, you're effectively looking straight at the occupant on the loo through the gap. This is the most horrible of cases for the observer as you assume that someone would lock door A if they were using the loo, but some people just aren't that cluey. So you glance in at B, realise suddenly that you've just glanced at someone sitting on the loo, and get out of there as quickly as you can. Anyway - let me continue:
!A1 and A2 and !B --> C :Not optimal, as you can't assume B before opening A.
!A1 and !A2 and B --> !C :Occupant must have no inhibitions. Steer clear.
!A1 and !A2 and !B --> C :Best case scenario.
So we can see that there's a direct correlation between B and C: !B --> C and B --> !C. However, being able to assume B based on A1 and A2 is really key to avoid awkwardness in general.
Thankyou for allowing me to waste your life. Consider me however, as I'd been contemplating all of this for HOURS before finally spending the 30 mins it's taken me to post it. I must be crazy, I swear. Anyway - at least you've practiced some logic skills.