def METHOD_NAME(state, new, mem=1.0):
    """
    param state: The state to update the average for.
    param new:   The new value to be accumulated into the average.
    param mem:   Memory parameter to determine how to weight the past average.
    """
    prev, size = self.uniqueness[state]
    new_average = float(prev * (size**mem) + new) / ((size**mem) + 1)
    self.uniqueness[state] = new_average, size + 1