def RC(annotation, prediction):
    """
    Kendall rank correlation coefficient
    """
    number_con = 0.0
    number_dis = 0.0
    for i in range(0, len(prediction)):
        for j in range(i + 1, len(prediction)):
            if annotation[prediction[i]][0] < annotation[prediction[j]][0]:
                number_con += 1
            else:
                number_dis += 1
    return (number_con - number_dis) / len(prediction) / (len(prediction) - 1) * 2