A probabilistic framework for windows of opportunity