def symptom_similarity(symptoms_tuple_A, symptoms_tuple_B):
    """
    Args:
        symptoms1: tuple of a set of symptoms present and a set of symptoms absent
        symptoms2: tuple of a set of symptoms present and a set symptoms absent
    Returns:
        present_present + absent_absent - present_absent - absent_present
        where common_present is the number of symptoms present in both patients
        absent_absent is the number of symptoms absent in both patients
        present_absent is the number of symptoms present in patientA and absent          
        in patientB
        absent_present is the number of symptoms absent in patientA and present         
        in patientB
    """
    common_present = len(symptoms_tuple_A[0].intersection(symptoms_tuple_B[0]))
    #identifies number of symptoms that are present in patientA and finds symptoms common to both patients
    absent_absent = len(symptoms_tuple_A[1].intersection(symptoms_tuple_B[1]))
    #identifies number of symptoms that are not present in both patients
    present_absent = len(symptoms_tuple_A[0].intersection(symptoms_tuple_B[1]))
    #identifies number of symptoms present in patient A, but not in patient B
    absent_present = len(symptoms_tuple_A[1].intersection(symptoms_tuple_B[0]))
    #identifies number of symptoms present in patient B, but not in patient A
    return(common_present + absent_absent - present_absent - absent_present)
    #returns the similarity between two patients represented by a numerical value