def decremental_mean(mu_i, n, x):
    """
    Calculates the mean after removing x from a vector with given mean and size.

    :param mu_i: Mean before removing x.
    :param n: Number of elements before removing x.
    :param x: Element to be removed.
    :return: New mean.
    """

    delta = (mu_i - x) / float(n - 1)
    mu_f = mu_i + delta

    return mu_f