def calculate_average_error(actual_hist, noisy_hist):
    """
        Calculates error according to the equation stated in part (e).

        Args: Actual histogram (list), Noisy histogram (list)
        Returns: Error (Err) in the noisy histogram (float)
    """
    error = 0.0
    for i in range(len(actual_hist)):
        error += abs(actual_hist[i] - noisy_hist[i])

    error = error / len(actual_hist)
    return error