question: static private String calcThreshold ( double scoreThreshold , double lambda ) { final double logProbThreshold = Math . log ( 1 - scoreThreshold / 0.999 ) ; int maxNum = 1000000 ; if ( calcLogProb ( maxNum , lambda ) > logProbThreshold ) { return ">1e6" ; } int minNum = 1 ; while ( minNum < maxNum ) { final int midNum = ( maxNum + minNum ) / 2 ; final boolean passThreshold = calcLogProb ( midNum , lambda ) <= logProbThreshold ; if ( passThreshold ) { maxNum = midNum ; } else { if ( midNum == minNum ) { break ; } minNum = midNum ; } } return Integer . toString ( maxNum ) ; }
target:  Calculates the minimal number of instances required to achieve a score as high as the given scoreThreshold for the given lambda.