def compare_math_formula(query, formula):
    """Compares two math tuples

    Parameters:
        query: the query math tuple (str)
        formula: the formula math tuple (str)
    Returns:
        same: True if tuples are considered equal (boolean)
    """
    if "'*'" in query:
        # break on the wild card
        query_parts = query.split("'*'")
        index = 0
        # make sure all the parts are in the formula
        while index < len(query_parts) and query_parts[index] in formula:
            index += 1
        same = False
        # if all parts of query are in formula then must be good to go
        if index == len(query_parts):
            same = True
    else:
        # if no wildcards then just a normal str comparison
        same = query == formula
    return same