public static Gaussian fromBinomial ( final double probability , final long totalPopulation ) { if ( 0. >= totalPopulation ) { throw new IllegalArgumentException ( ) ; } if ( 0. >= probability ) { throw new IllegalArgumentException ( ) ; } if ( 1. <= probability ) { throw new IllegalArgumentException ( ) ; } if ( Double . isNaN ( probability ) ) { throw new IllegalArgumentException ( ) ; } if ( Double . isInfinite ( probability ) ) { throw new IllegalArgumentException ( ) ; } return new Gaussian ( probability * totalPopulation , Math . sqrt ( totalPopulation * probability * ( 1 - probability ) ) ) ; }
From binomial gaussian .