def quadratic_session_score(i, length):
    """Function penalizes old elements in sequence more than the new events. The past elements have much smaller
       weights than the new ones. It follows a quadratic function.

    Parameters
    ----------
    i : int
        Element position, i+1 must be less than length.

    length : int
             Length of a sequence.

    Results
    -------
    result : float
             Session rank between 0 and 1.
    """

    c = i / length
    result = c*c
    return result