def calc_expected_value(counts_dict):
    """Returns the expected value of the histogram of the counts provided as a dict, if the results can be
    interpreted as binary numbers """
    result = 0
    for key in counts_dict.keys():
        result += int(key, 2) * counts_dict[key]
    return result