1. Give regular expression for: {s|s starts with a and had an odd length, or s starts with b and has an even length.} 2. Give regular expression for: {s|the length of s is at least 2} 3. Give state diagrams of DFA's for: Assume the alphabet is {x,y,z}. a. {s|s is any string other than xxx or zyx} b. {s|the length of s is at most 4} 4. Give state diagrams of DFA's for: Assume the alphabet is {a,b}. a. {s|s is any string other than aa or aaa} b. {s|s contains at least 1 a and two b's} 5. Convert the following NFA into a DFA S0:e-move->S1; S1:x->S1; S1:y->S2; S2:z->S2; S2:z->S1; Accept {S1} 6. Convert the following NFA into a DFA S0: (e-move) --> S1; S1: x --> S1; y --> S2; z --> S1; S2: z --> S2; x --> S2; x --> S1; Accept {S2} 7. Show that the following grammar is ambiguous. A => A C A | B; B => x | y; C => a | b; 8. Show that the following grammar is ambiguous. A => a A | B | ; //don't miss the epsilon production B => b B | A; 9. Write a grammar that defines strings of a's and b's such that the string reads the same forward and in reverse (a palindrome). 10. Rewrite the following expression grammar such that it is unambiguous, and defines precedence levels and associativity rules. Precedence should be (highest to lowest) {exp, div, sub}. Associativity is left except for E exp E which should be right associative. E => E exp E | E div E | E sub E | num;