Assignment Questions on FA, RE, and CFG
Set-1 Questions
Q1. Consider the following NFA and answer the following:
Q2. Construct an NFA and a DFA for recognizing the language denoted by the regular expression aa* + bb*
Q3. Write regular expressions for the following languages over the alphabet {0, 1}:
a) The set of all strings that begin with 110.
b) The set of all strings that contain 1011.
c) The set of strings of 0's and 1's with at most one pair of consecutive 1's.
Q.4) The following productions define the grammar of the language consisting of all strings of even length:
S --> AS | ε
A --> aa | ab | ba | bb
Give leftmost and rightmost derivations of the following strings:
a) aabbba
b) baabab
c) aaabbb
Set-2 Questions
Q2. Write regular expressions for the following languages over the alphabet {a, b}:
a) The set of strings containing at least one a and at least one b .
Q3. Convert the following regular expressions to NFA's with ε -transitions.
Q.4) Consider the CFG G defined by productions:
S --> aSbS | bSaS | ε
Prove that L(G) is the set of all strings with an equal number of a's and b's





.png)
.png)

.png)
.png)











