def calculate_error_rates(point_to_weight, classifier_to_misclassified):
    """Given a dictionary mapping training points to their weights, and another
    dictionary mapping classifiers to the training points they misclassify,
    returns a dictionary mapping classifiers to their error rates."""
    error_dict = dict()
    for c in classifier_to_misclassified.keys():
        total = 0
        for p in classifier_to_misclassified[c]:
            total += point_to_weight[p]
        error_dict[c] = total
    return error_dict