Formulation of probability theory problem with subtle condition