question: public static double bernoullis ( double n , double k , double successProb ) { double combo = MathUtils . combination ( n , k ) ; double q = 1 - successProb ; return combo * Math . pow ( successProb , k ) * Math . pow ( q , n - k ) ; }
target:  This will return the bernoulli trial for the given event. A bernoulli trial is a mechanism for detecting the probability of a given event occurring k times in n independent trials