CS150 HW4 Set Nov. 6 Due Nov. 21, Thursday, 5pm Total: 65 pts Q1 (a) [5 pts] Construct a CFG for the set of all binary strings of the form 0^i 1^j 0^k, where i,j,k > 0 and i+k = j. (b) [optional, 5 bonus pts] Construct a CFG for the set of all binary strings of the form 0^i 1^j 0^k, where i,j,k > 0 and i+k = 2j. Q2 [10 pts] For the grammar in Ex. 5.1.2 on P.182 (or P.180 in the 2nd ed) and string 010101, give the leftmost derivation and parse tree. Q3 [20 pts] P.216 (or P.214 in the 2nd ed) Ex.5.4.5 This question concerns the grammar from Exercise 5.1.2, ... For your convenience, the grammar of Ex. 5.1.2 is repeated here: S -> A1B A -> 0A | eps B -> 0B | 1B | eps Hint: For part a, show that the leftmost derivation is unique for any given input string, similar to the example given in the lecture notes (after slide 169). Q4 [10 pts] P.233-4 (or P.228 in the 2nd ed) Ex.6.1.1: b), c) Suppose the PDA P = ... Q5 [20 pts] Design a PDA to accept each of the following languages. You may use either PDAs that accept by final state or ones that accept by empty stack, whichever is more convenient. a) The set of all binary strings with more 1's than 0's. b) The language in Q1(a). For each PDA, please show the transition diagram instead of a sequence of transitions.