Java tutorial
//package com.java2s; import java.util.*; import static java.lang.Math.*; public class Main { /** * @param mathExpectation math expectation for full list * @return dispersion on full array */ private static double dispersionForFull(double mathExpectation, Map<String, Long> pressingLength) { double sum = 0.0; for (String key : pressingLength.keySet()) { double x = pressingLength.get(key) - mathExpectation; sum += x * x; } return sqrt(sum / (pressingLength.size() - 1)); } }