Professional Documents
Culture Documents
Roll No BY408016
Course Code 3452
Registration No. 19PCL02707
Assignment No.2
Question No.1
If some automation, FA1, has n1 states and some other automation.
FA2, has n2 states, what is the maximum number of states possible
in the machines the algorithms in this produce for the automata
corresponding to,
• FA1 + FA2
• FA1FA2
• (FA1)
Answer:
The possible states are as follows,
i) n1*n2 ii)
n1+n2 iii)
n1+1
Answer:
We have to prove that class of regular languages is closed under
complementation.
So, Let L be the regular language over the input alphabet set S.
Then complement of L, i.e L' is a set of all strings over S* (any
combination of input alphabet) that are not in L.
Since there exist finite automata M' for the language L', L, is a
regular language.
Hence regular languages are closed under complementation.
Question No. 3
Find a CFG that generate the regular language defined by (aaa +
b) over the alphabet = {a, b}.
Answer:
Consider the regular language (aaa+b) *,
This language gives one or more occurrence of either “aaa” or “b”. The
language does not give null string.
The possible stings generated can be {aaa, aaaaaa, aaab, aaabb, b, bb,
baaa, …..}
“A” can be erased from above. So, whenever it appears on the right side of
a production, we replace it with another production without the A.
Based on this, let the given CFG. And, if it is not, we use the λ productions
then that generates the same language.
S -> AB | ABC
A -> BA | BC | lambda | a
B -> AC | CB | lambda | b C -> BC | AB | A | c
S -> A | B | C | AB | ABC
A -> BA | BC | B | C | a
B -> AC | CB | C | b
C -> BC | AB | A | c
(i.e., AB both are λ then C need to generate in S. For remaining, they also
need to generate the same result)
Question No.5
Find a PDA (nondeterministic) that accepts all PLAINDROMES
where the alphabet is = {a, b}.
Answer:
A Push-Down Automata that accepts all PALINDROMES where the
alphabet is = {a, b}, is provided below