@Override
    public double variance() {
        double r = (double) m / N;
        return n * (N - n) * r * (1 - r) / (N - 1);
    }
@Test
    public void testVariance() {
        System.out.println("variance");
        HyperGeometricDistribution instance = new HyperGeometricDistribution(100, 30, 70);
        instance.rand();
        assertEquals(4.454545, instance.variance(), 1E-6);
        instance = new HyperGeometricDistribution(100, 30, 80);
        instance.rand();
        assertEquals(3.393939, instance.variance(), 1E-6);
        instance = new HyperGeometricDistribution(100, 30, 60);
        instance.rand();
        assertEquals(5.090909, instance.variance(), 1E-6);
    }