import math


def create_exponential_decay(inital_value, decay_rate):
    """Creates an exponential decay function.

    Given an initial value (wait time) and decay rate, returns
    a function that exponentially decays over time.
    A smaller decay rate means it decays over a shortened period.
    """

    def exponential_decay(time):
        return inital_value * math.exp(-(1 / decay_rate) * time)

    return exponential_decay