This is practically impossible to solve for anyone without a mathematics degree.
Unless you happen to realize/find it's the secretary problem, and then it's laughably easy. Basically it's either recognizing the problem, or good googling skills - not python skill.
Created at: 2015/01/12 23:15; Updated at: 2015/02/28 03:50