Assignment 2
Assignment 2
Q 1:
Construct a DFA that accepts all strings over the alphabet Σ = {0, 1} where the total number of 1’s is divisible by 3.
Q 2:
Construct a DFA that accepts all strings over the alphabet Σ = {a, b} that do not contain the substring ”ab”.
Q 3:
Construct a DFA that accepts all binary strings where the total number of 0’s is odd, and the total number of 1’s is even.
Q 4:
Construct a DFA that accepts strings over Σ = {a, b} where every string starts and ends with the same symbol.
Q 5:
Construct a DFA that accepts all strings over Σ = {a, b} where the substring ”ba” does not appear.
Q 2:
Construct an NFA that accepts all strings over Σ = {a, b} containing the substring ”abba”.
Q 3:
Construct an NFA that accepts all strings over Σ = {0, 1} where the number of 1’s is at least 2.
Q 4:
Construct an NFA that accepts strings over Σ = {a, b} where the string starts with ”a” and contains ”bb” anywhere in the
string.
Q 5:
Construct an NFA that accepts all strings over Σ = {a, b} containing at least one occurrence of ”aa” or ”bb”.