def eval_assignment(observations_a, observations_b, assignment):
    """ Compute the two means according to the given assignment as follows: if
    the i-th bit in the assignment is set to 0, the i-th observation will not
    be changed between observations_a and observations_b, if it is 1 the
    i-th observation will be changed between the two

    Examples
    --------
    >>> eval_assignment([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], int("000", 2))
    (2.0, 5.0)
    >>> eval_assignment([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], int("100", 2))
    (3.0, 4.0)
    >>> eval_assignment([1.0, 2.0, 3.0], [4.0, 5.0, 6.0], int("111", 2))
    (5.0, 2.0)
    >>> eval_assignment([1.0], [2.0, 3.0], int("11", 2))
    Traceback (most recent call last):
     ...
    ValueError: The observation lists must have the same length
    """
    if not (len(observations_a) == len(observations_b)):
        raise ValueError("The observation lists must have the same length")
    n = len(observations_a)
    sum_a = 0
    sum_b = 0
    for i in range(n):
        if assignment & (1 << (n - i - 1)):  # i = 1, change position
            sum_a += observations_b[i]
            sum_b += observations_a[i]
        else:
            sum_b += observations_b[i]
            sum_a += observations_a[i]
    return (sum_a / n, sum_b / n)