CS 321 Fall 2015 Midterm Review Questions. You should finish these questions in 25 minutes. The real midterm will have about 2x as many problems, in 45 minutes. 1. Concepts: Quiz 4 problems 1,2,3. 2. L_1 = number of 0's is a multiple of 4. L_2 = number of 1's is a multiple of 3. Construct an NFA for their intersection. NOTE: it might be easier not to construct machines for L_1 not L_2, but rather focus on the semantics of the languages. This will save you tremendous amount of time in the Midterm. But in general, how would you intersect two NFAs and result in another NFA or DFA? 3. binary number divisible by 4, in 4 states. 4. minimize the above DFA. 5. NFA=>DFA conversion, using the example on page 2 of week4 slides. Convert the resulting DFA to RE. epsilon-closure: (a) If we dropped "the smallest set" in the definition, what other proper subset of Q also qualifies as E(q_2)? (b) If we don't like to use the "subset" notion (\subseteq), how should we modify the second condition in the definition? 6. Prove inductively: |u^n| = n|u|. You can choose either one: (a) by induction on n. (b) by induction on |u|. 7. Write REs: (a) binary numbers, could be negative, commas between three consecutive bits. no leading zeros. Here are four examples: 11,001,011 -101 11 0 but -0 is not allowed. (b) a variable name in C++ must start with a letter (lower or upper case), followed by letters, numbers, and underscores. 8. Which of the following are regular? (a) C++ keywords (b) C++ variable names (C) C++ programs