def tp_fp_fn(true_set, subm_set):
    """
    Calculate tp, fp and fn when comparing the true set of tuples and
    the submitted set of tuples by the students.
    """

    true_pos = true_set.intersection(subm_set)
    fals_pos = subm_set - true_set
    fals_neg = true_set - subm_set

    tp = len(true_pos)
    fp = len(fals_pos)
    fn = len(fals_neg)

    return tp, fp, fn