CMPS 260 Spring 2024
April 17 exam
             
Name____________________
 

1_____
2_____
3_____
4_____
5_____
Total_____
There are five problems. You will be graded based upon your best four answers.

1. Let L1 be the language over the alphabet {a,b} containing precisely those strings that end with b and have an even number of occurrences of a.
More formally, L1 = { xb | x ∈ {a,b}* and #a(x) is even }

(a) Present a (preferably, minimal) DFA that accepts L1.
(b) Present a regular expression that denotes L1.


2.
M1 M2
Consider the DFA's M1 and M2 pictured to the right.

(a) In the space below, fill in the missing entries in the table that describes the semi-DFA M obtained by applying the cartesian product construction. (A semi-DFA is a DFA except that the final/accepting states are left unspecified.) It is understood that [p0,q0] is the start/initial state, due to p0 (respectively, q0) being the initial state of M1 (resp., M2). (You can draw the transition diagram describing M in the space to the right, but it is not required.)

δ
stateab
[p0,q0]
              
              
[p0,q1]
              
              
[p1,q0]
              
              
[p1,q1]
              
              

(b) Which state(s) of M should be designated as final/accepting for the resulting DFA to accept the intersection of L(M1) and L(M2)?

(c) Which state(s) of M should be designated as final/accepting for the resulting DFA to accept the union of L(M1) and L(M2)?

(d) Suppose that [p0,q1] were the lone state in M to be designated as final/accepting. What language is accepted by that DFA? (Try to express it in terms of L(M1), L(M2), and set operators, as opposed to referring to a's and b's.)


3. Let L3 be the language over the alphabet {a,b} containing precisely those strings that either have aba as a suffix or do not have baa as a substring. Present an NFA that accepts L3.

Hint: Make use of the relaxed requirements of NFA's (compared to DFA's) to make the task easier. Among these are λ-transitions, not having to explicitly show the dead state (or transitions going to it), and multiple transitions from the same state with the same label.


4.
Present a regular expression that describes the language accepted by the DFA shown to the right.

Hint: As building blocks, devise regular expressions describing


5. Let M be a six-state minimal DFA with input alphabet {a} and having only one final/accepting state.

(a) Suppose that L(M) is finite. Describe L(M), exactly. (There is only one possibility.)
(b) Suppose that L(M) is infinite and that aa is the shortest member of L(M). Then L(M) is one of three possible languages. Describe them, exactly.