############## The following hints are only intended as either hints or as a quick check that you are on the right track. The answers do not correspond to actual exam answers. They may be continously updated during the exam grading. ############## 1a: Yes, can be proven either by closure properties or via a direct argument which constructs an NFA for the intersection. A simple yes answer does not give any points since the statement is not trivially true. In particular, an answer along the lines of "the intersection of A and B is included in A and B" does not give any points since regular languages are not closed under subset. 1b: No, for example is "aa" not included in the first language (also note that the definition of a^+ contains a typo: it should be a^+ = a^*a = \{a\}^*{a}, i.e., the union should be concatenation). 1c: Yes (even if one of the alphabets is empty we can always map everything to the empty string). 1d: Yes (a concrete example is needed to get points). Note that it's in general not sufficient to provide a grammar for a finite language which is not LR(0) since we are asking whether there is a language which is LR(0). 2 State a b {q0} {q0, q1} {q0, q1, q2} {q0,q1} {q0, q1, q3} {q0, q1, q2} {q0,q1,q3} {q0, q1, q3} {q0, q1, q2} {q0,q1,q2} {q0, q1, q3} {q0, q1, q2, q3} {q0, q1, q2, q3} {q0, q1, q3} {q0, q1, q2, q3} 3a We first observe that the state q5 is inaccessible (as discussed during the lecture). Thus, we first remove it, and then use the marking algorithm. The correct answer is then that 1 can be collapsed with 2, and that 3 can be collapsed with 4. 3b The equivalence classes corresponds to the states in the minimal DFA from 3a (follows from the Myhill-Nerode theorem). A short motivation is needed. (also note that the exercise contains a typo: R_L should be R_A). 4a: It is sufficient to give one string in the language and one string outside the language. 4b: this is similar to the exercise in HW2. The regular case is easier since there are less cases to consider. 5: The PDA should (1) read a's and b's and push each element on the stack, (2) read 0, (3) pop elements from the stack. It is easiest to accept by empty stack. Note that since a PDA is allowed to be non-deterministic one is not required to fill in all possible transitions. 6a,b: the important point to remember is that you always need to select the leftmost non-terminal, but you still have a choice between which rule to apply. 6c: try to use the strings in a) and b) in order to modify the grammar and ensure that only one rule is applicable at each stage in the derivation. 7a: Yes: construct a TM which simulates both A and B. Answer yes iff any of the machines answer yes. You should explain why this is computable. 7b: No, it can be the case that A is undecidable but that A U B is trivial. You should provide an example for when this might be the case.