TCS UT 1 QB
TCS UT 1 QB
● Explain homomorphism.
or
Homomorphism
Σ={0,1)
R.E= 1∗+1∗01∗+1∗01∗01∗
● Which strings are not generated by the given grammar? S -> SaSbS|∈ .Strings : aabb,
Union
If L1 and If L2 are two regular languages, their union L1 U L2 will also be regular.
Example
Intersec�on
If L1 and If L2 are two regular languages, their intersec�on L1 ∩ L2 will also be regular.
Example
Concatena�on
If L1 and If L2 are two regular languages, their concatena�on L1.L2 will also be regular.
Example
Kleene Closure
Example
L1 = (a U b )
L1* = (a U b)*
Complement
If L(G) is a regular language, its complement L'(G) will also be regular. Complement of a language can
be found by subtrac�ng strings which are in L(G) from all possible strings.
Example
● Explain how NFA differs from DFA. Men�on defini�on and an example for each.
L = {anbn for n = 0,1,2,........} Using pumping lemma check whether L is regular or not
regular?
The Pumping Lemma is a property that all regular languages sa�sfy. It is used to prove that certain
languages are not regular.
Theorem
For any regular language L, there exists an integer P, such that for all w in L
|w|>=P
(1)lxyl < P
(2)lyl > 1
S → aSbS|bSaS|∈. Show that the string abab has two parse trees
A CFG is said to be ambiguous if there exists more than one deriva�on tree for the given input
string i.e., more than one Le�Most Deriva�on Tree (LMDT) or RightMost Deriva�on Tree (RMDT).
● Find the regular expression corresponding to each of the following subset {0,1}
Answer assignment no 1 Q5
S→ iCtS | iCtSeS | a
C→b
(i)Le�most deriva�on
(ii)Rightmost deriva�on
(iii)Parse tree
Union : If L1 and L2 are two context free languages, their union L1 ? L2 will also be
context free.
For example,
L1 = { anbncm | m >= 0 and n >= 0 } and L2 = { anbmcm | n >= 0 and m >= 0 }
L3 = L1 ? L2 = { anbncm ? anbmcm | n >= 0, m >= 0 } is also context free.
Kleene Closure : If L1 is context free, its Kleene closure L1* will also be context free.
For example,
L1 = { anbn | n >= 0 }
L1* = { anbn | n >= 0 }* is also context free.