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);
}

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 ) ; }
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
