solve box-probability