def test_statistic(y, z): """Checks if two means are different, tempered by the sample size of 'y' and 'z'""" delta = z.mean() - y.mean() sd_y = y.standard_deviation() sd_z = z.standard_deviation() if sd_y + sd_z: delta /= memo_sqrt(sd_y / len(y) + sd_z / len(z)) return delta
def test_memo_sqrt(self): assert_equal(base.memo_sqrt(4), 2) assert_equal(base.memo_sqrt(9), 3) assert_equal(base.memo_sqrt(4), 2)
def f2(xs): e = sum((x + (1 / memo_sqrt(i+1))) ** 2 for i, x in enumerate(xs)) return 1 - math.exp(-e)
def f2(xs): e = sum((x + (1 / memo_sqrt(i + 1)))**2 for i, x in enumerate(xs)) return 1 - math.exp(-e)
def f2(xs): gxs = g(xs) a = 1 - memo_sqrt(xs[0] / gxs) - (xs[0] / gxs) a *= math.sin(10 * math.pi * xs[0]) return gxs * a