First, it generates ten random numbers from normal distribution and calculates the mean of ten numbers and stores this in an ArrayList. Similarly, it does this for ten lac times. Then, it gives the total mean of ten lac values which is a positive value like this: 0.000142. But it generates negative values as it approaches to infinity. I want positive values... How I will achieve this task? Someone tell me, thankspackage statistics; import java.util.ArrayList; import java.util.Iterator; import java.util.Random; import org.apache.commons.math3.distribution.NormalDistribution; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; public class NewClass { public static void main(String[] args) { double mean=0.0; ArrayList store_mean=new ArrayList(); Iterator it; DescriptiveStatistics stats = new DescriptiveStatistics(); Random gaussian = new Random(); for(int i=1; i<=1000000; i++) { for (int idx = 1; idx <= 10; ++idx) { // System.out.println("Generated : " + gaussian.nextGaussian()); stats.addValue(gaussian.nextGaussian()); } mean = stats.getMean(); stats.clear(); store_mean.add(mean); } it=store_mean.iterator(); while(it.hasNext()) { stats.addValue((double) it.next()); } mean=stats.getMean(); System.out.println("Total Mean="+mean); }