CO1 AND CO2 QUESTIONS FOR PRACTICE
CO1 AND CO2 QUESTIONS FOR PRACTICE
No Descriptive Questions
Construct DFA which accepts even number of 0’s and even number of 1’s over the
A
4 alphabet {0,1} and verify the acceptance of the strings
B Design a NFA which accepts the strings starts with ab over the alphabets {a,b}
Design a DFA for set of all strings does not contain three consecutive 0’s over the
A
5 alphabet {0,1}
B Design NFA for to accept all strings ending with ab over the alphabet {a,b}
Design a NFA , which accepts the strings start with one and end with zero over the
A
alphabets {0,1}
6
Construct a DFA which accepts a language of all binary strings divisible by three over
B
the alphabet {0,1}
Design a DFA that accepts the strings which doesn’t contain three consecutive b’s over
A
the alphabets {a,b}
7
Design a NFA which accepts all string over {0,1}, contains two consecutive zeros or two
B
consecutive ones
Design NFA for string ending with two consecutive a’s or b’s
A
8 and Design DFA for L={w ∈{0,1}* | w contains the substring 0101}
B Design a NFA that recognize the set of all strings with {0,1} starting with the prefix 01
Q. No Short Answer Questions
12 Design DFA Which accept all strings which are ending with 101 over an alphabet {0,1}.
15 Design a DFA for set of all strings with two consecutive 0’s over the alphabet {0,1}
16 Design NFA for to accept all strings ending with 10 over the alphabet {0,1}
Construct a DFA which accepts a language, whose length is divisible by two over the
17
alphabet {0,1}
19 Design NFA for the strings starting with 1, over the alphabets {0,1}
20 Design NFA for the strings with three consecutive 0’s over the alphabets {0,1}
Q. No Descriptive Questions
Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{s}} where
is given by
0 1
B
p p, q p
q r r
r s -
s s s
2
B
A
3
0 1
B p q,s q
q r q, r
r s p
s - p
A
5
B State and prove equivalence of DFA and NFA
A
8
B State and Prove equivalence of NFAs and NFA with Epsilon moves
14
Design a Epsilon NFA for any number a’s followed by any number of b’s followed by
15
number of c’s.
18
19
20
Q. No Descriptive Questions
A
2
A
3
4
B
Show a derivation tree for the string aabbbb with the grammar
7
B SAB, A→aB, B→Sb
A
8
15
16
17
19
Q. No Descriptive Questions
A SAA | 0
1 ASS | 1
S aaaa
A
6
B Briefly discuss the procedures for reduced grammar
1 Define CFG
13
14
15
16
17
18
19
20
Represent all five tuples for NFA and DFA. Explain with suitable example.
Construct DFA which accepts even number of 0’s and even number of 1’s over the
alphabet {0,1} and verify the acceptance of the strings.
Design a NFA which accepts all string over {0,1}, contains two consecutive zeros or two
consecutive ones and verify the acceptance of the strings
5.
a Construct a DFA which accepts a language of all binary strings divisible by three over the
alphabet {0,1}
b Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{s}} where
is given by
6.
a Convert the NFA with ε to NFA without ε for the following
7
With the help of example explain the regular grammar
8
Differentiate between the left linear and right linear grammar and explain the equivalence.
(OR)
Analytically define the NFA and DFA. Explain with suitable example.
Construct a NFA to accept the stings ending with 01, acceptance of the input strings
through extended transition function
5.
a State and Prove equivalence of NFA’s and DFA’s
b Design a DFA for set of all strings does not contain three consecutive 0’s over the alphabet
{0,1}
6. Q.
a Design a NFA that recognize the set of all strings with {0,1} starting with the prefix 01
b State and Prove equivalence of NFAs and NFA with Epsilon moves.
(OR)
Construct equivalent NFA with epsilon transitions for the following regular expression
r=0*+11
11.
a With the help of example explain the equivalence between regular, linear grammar and
finite automata.
b Construct finite automata equivalent to the following regular expression.
((0+1)(0+1))* + ((0+1)(0+1)(0+1))*
(Or)
a Obtain Regular Grammar for the following Finite Automata i.e., any number of zeros
followed by any number of ones.
Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{q,s}} where
is given by
4.
5.
a Convert the following regular expression in to equivalent NFA with epsilon transitions.
r=(10*)*
b Convert the following NFA to its equivalent DFA
(Or)
Find whether the Grammar is Ambiguous or not for the string id+id*id+id*id, and the
productions are EE+E / E*E / id
8
Show a derivation tree for the string aabbbb with the grammar
11.
a Give context-free grammars for the set of palindromes over alphabet{a,b}
b Convert the following grammar into CNF.
S ~S | [SכS] | p | q
Design a DFA for the set of all strings with exactly 3 consecutive zeros, Σ={0,1}
Construct an NFA for the set of all strings such that the third symbol from the right side is
1. Σ={0,1}
Construct DFA for the given NFA where q0 is an initial as well as a final state and q2 is a
final state.
a b
*q0 q0,q1 q0
q1 Ф q2
*q2 q2 q2
5.
a State and prove the equivalence of NFA with ε-transitions and NFA without ε-transitions
b Prove that L= {ww/w in (a+b)*} is not regular
6. Q.
a State and prove the equivalence of NFA and DFA
b Give ordinary NFA for the following transition system where the transition system is an ε-
NFA
Consider the following grammar and remove the ε productions from the grammar.
SABAC, AaA/ε, BbB/ε, Cc
8
Convert the following grammar to equivalent grammar to CNF SbA/aB, AbAA/ aS/a
BaBB/bS/b
Find CFG with no useless symbols equivalent to : S→AB / CA , B→BC / AB, A→a ,
C→aB/ b.
11.
a If the CFG is as below
S 0A | 1B | C
A 0S | 00
B 1| A
C 01 then remove unit productions.
b Generate the grammar for the language
L={anban/n>=1}
a Design a CFG for the language L={a4n/ n>=1} and convert that CFG into CNF .
b Let G=({S,A}, {a,b},P,S) where P(SaAS/a, ASbA/SS/ba) Derive a string
w=aabbaa using LMD and RMD and write its corresponding derivation trees
Represent all five tuples for NFA and DFA. Explain with suitable example.
Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{s}} where
is given by
4.
Give ordinary NFA for the following transition system where the transition system is an ε-
NFA
5.
a Design NFA for string ending with two consecutive a’s or b’s
and Design DFA for L={w ∈{0,1}* | w contains the substring 0101}
b State and Prove equivalence of NFAs and NFA with Epsilon moves
6. Q.
a State and prove equivalence of DFA and NFA
b
CO2 Max.Marks 25
Differentiate between regular grammars, right linear and left linear grammars
10
State and Prove closure properties of regular sets
(Or)
Give DFA accepting the languages such that the set of all strings in which every block of
five consecutive symbols contains at least two 0’s.
Construct DFA for the given NFA where q0 is an initial state and q3 is a final state
0 1
q0 q0,q1 q0
q1 Ф q2
q2 q3 Ф
q3 q3 q3
a State and prove Equivalent of Moore and Mealy machines with suitable example
b Construct NFA without ε for a given NFA with ε where q0 and q2 are the initial and final
states respectively.
a b c ε
q0 q0 Ф Ф q1
q1 Ф q1 Ф q2
q2 Ф Ф q2 Ф
a Construct a NFA which accepts a language aa or bb over the alphabet {a,b} and find the
acceptance of strings.
11.
a Prove that the language L={anb2n/wε{a,b}} is not regular using pumping lemma on regular
sets
b Let r = 1 (1 + 0)*, s= 11*0 and t = 1 * 0 be three regular expressions. Find the relationship
between L(r), L(s) and L(t)
12.
a Prove that regular sets are closed under union, concatenation and kleene closure.
b Construct a DFA with reduced states equivalent to the regular expression r=10+(0+11)0*1
4.
Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{s}} where
is given by
5.
a Construct Finite Automata for the Regular Expression (0+1)*(00+11)(0+1)*
b Construct regular Expression for the given DFA
a Minimize the automata given below
b Construct DFA which accepts even number of 0’s and even number of 1’s over the alphabet
{0,1} and verify the acceptance of the strings
8
Convert the following grammar into CNF.
S aaaaS
S aaaa
Show a left most, right most and derivation tree for the string aabbabab with the grammar
S ~S | [SכS] | p | q
11.
a Briefly discuss the procedures for reduced grammar
b Convert the following grammar into GNF
Design a NFA which accepts the strings starts with ab over the alphabets {a,b}
Construct DFA for the given NFA where q0 is the initial state and q3 is a final state
a b c
q0 q1 Ф Ф
q1 q0 q3 q2
q2 Ф Ф q1
q3 Ф q1 Ф
Construct NFA without ε for a given NFA with ε where q0 and q2 are the initial and final
states respectively.
a b c ε
q0 q0 Ф Ф q1
q1 Ф q1 Ф q2
q2 Ф Ф q2 Ф
5.
a Construct equivalent NFA with epsilon transitions for the following regular expression
r=0*+11
b Prove that L= {ww/w in (a+b)*} is not regular
b Convert the following regular expression in to equivalent NFA with epsilon transitions.
r=(10*)*
Differentiate between linear, regular, CFG and CSG
8
Construct a CFG to generate Equal number of a’s and b’s
10
Write an algorithm for GNF
11.
a
b Construct DFA equivalent to the grammar
AaB/bA/b
BaC/bB
CaA/bC/a
12.
a Transform the grammar SaSaA/A, AabA/b into Chomsky normal form
b Find left most, right most and derivation tree for the string 00110101 with the grammar