Given two binary strings x, y of the same length n, define x ⊕ y to be their bitwise exclusive-OR. This is the same as their mod-2 sum as bit-vectors; in particular, 1 + 1 = 0 without a carry. For example, 1011 ⊕ 0110 = 1101, 0n ⊕ y = y regardless of y, 1n ⊕ y flips each bit of y, and ⊕ = where is the empty string. Now let n be even and recall the definition from lecture of x belonging to the language D of "double words": x ∈ D if (and only if) there is a string u such that x = uu. Define: x ∼ y ≡ x ⊕ y ∈ D. For example, 1100 ∼ 0110 because 1100 ⊕ 0110 = 1010 which is a double word, and 1001 ∼ 1100 on similar grounds. (a) Find all the strings x such that x ∼ 0000. (3 pts.) (b) Find all the strings x such that x ∼ 1011. (6 pts.) (c) Is this ∼ an equivalence relation? Prove your answer, especially regarding whether transitivity holds or fails. (3 + 3 + 12 = 18 pts., for 27 total, next problem overleaf)
Let A ⊕ B = (A ∪ B) - (A ∩ B) stand for the symmetric difference of the sets A and B. This is analogous to the Boolean xor (exclusive-or) operation, since A ⊕ B = { x : x ∈ A xor x ∈ B }; and it is analogous to problem (1) but we prefer to use the ⊕ notation on strings and keep ⊕ for sets. (Here when A and B are languages, i.e. subsets of Σ∗ for some alphabet Σ, it is understood that x refers to strings over Σ.) (a) Under what condition(s) does A ⊕ B = ∅? Same for A ⊕ B = Σ∗ , and A ⊕ B = A. (b) Is it the case that for all languages A, B, C over any alphabet Σ, (A⊕B)⋅C = A⋅C⊕B⋅C? Prove your answer, or give a counterexample. (c) Let A be the language of binary strings with an odd number of 1's, and let B be the language of strings that do not have a 11 in them; DFAs for these languages have been given in lecture. Using the Cartesian product construction, design a DFA M such that L(M) = A ⊕ B. Also say for each state q of M what it means in terms of whether an odd or even number of 1s have been seen thus far, and whether a 11 has happened. (6+9+12 = 27 pts., for 54 total on the set; second problem is overleaf)