import math


def expected_unanchored_L2_discrepancy(num_points, dimension):
    """Expected value for unanchored L2 discrepancy of random uniform points.

    Note that this is the square root of :math:`\\mathrm{E}(T^2)`, i.e.
    ``sqrt(1.0 / n * (6 ** -d) * (1 - 2 ** -d))``. For details see
    [Morokoff1994]_.

    """
    assert num_points > 0
    assert dimension > 0
    return math.sqrt(1.0 / num_points * (6 ** -dimension) * (1 - 2 ** -dimension))