News for hackers. Stuff that matters.
Re:How to leave academia (for science PhDs) by dxbydt on Thursday April 05, 2012 @03:26PM (#3804174)
uh, nope.

     xyz => 1 sits on seat x, 2 on seat y, 3 on seat z
     So the only possibilities are:
     123: 1 sits on seat 1, 2 on seat 2, 3 on seat 3
     213: 1 sits on seat 2, 2 on seat 1, 3 on seat 3
     231: 1 sits on seat 2, 2 on seat 3, 3 on seat 1
     321: 1 sits on seat 3, 2 on seat 2, 3 on seat 1

     passenger 3 is happy twice out of 4, hence 50%
In the code, the happyLast variable counts the number of times the last passenger is happy ( happy == when he gets his assigned seat)
Re:How to leave academia (for science PhDs) by graphene on Thursday April 05, 2012 @03:37PM (#3804224)
ah, right, I read it as

xyz => seat 1 is occupied by passenger x, seat 2 by y and seat 3 by z