def get_confidence(pair, sup, variants, total):
    """
    Given a long-term dependency rules, variants of the event log and total number of traces
    It calculates the support value of the rule.
    
    Parameter:
        pair (dict) : Long-term dependency rules
        support (dict) : support of the rule
        variants (dict) : Unique traces with the count of those traces
        total (str) : Total number of traces in Event log
    
    Returns:
        conf (str): Confidence value of the rule
    """
    lhs_c = 0
    for item in variants:
        trace = item['variant'].split(",")
        for i in range(0, len(pair[0])):
            if not repr(pair[0][i]) in trace:#item['variant']: 
                continue
            else:
                lhs_c += item['count']
                break
    sup_c = round((lhs_c / total),3)
    conf = round((sup / sup_c), 3)
    return conf