def fast_mean_variance_update(new_sample, old_mean, old_variance, k):
    """
    Return the new mean and variance if one new sample is added.
    """
    new_mean = (k * old_mean + new_sample)/(k+1)
    new_variance = (k-1) * old_variance / k + (new_sample - old_mean)**2/(k+1)
    return new_mean, new_variance