0% found this document useful (0 votes)
48 views23 pages

CO1 AND CO2 QUESTIONS FOR PRACTICE

The document contains a series of questions related to formal languages, finite automata, and grammars, including descriptive and short answer questions. It covers topics such as the design of NFAs and DFAs, conversion between different types of automata, and the properties of regular expressions and grammars. Additionally, it includes tasks related to the construction of finite automata for specific languages and the analysis of grammars for ambiguity.

Uploaded by

raunakhgnis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views23 pages

CO1 AND CO2 QUESTIONS FOR PRACTICE

The document contains a series of questions related to formal languages, finite automata, and grammars, including descriptive and short answer questions. It covers topics such as the design of NFAs and DFAs, conversion between different types of automata, and the properties of regular expressions and grammars. Additionally, it includes tasks related to the construction of finite automata for specific languages and the analysis of grammars for ambiguity.

Uploaded by

raunakhgnis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

Q.

No Descriptive Questions

A Illustrate the types of formal languages


1
B Represent all five tuples for NFA and DFA. Explain with suitable example.

A Briefly discuss about finite automata’s with suitable examples.


2
B Design an automata to accepts the language given by L={abn /n>=0}

Construct DFA for the language


A
L ={ W/W is a binary number divisible by 5}
3
Construct a NFA to accept the stings ending with 01, acceptance of the input strings
B
through extended transition function

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

Explain the following terms with examples


1
Symbol, Alphabet and String.

2 Design the block Diagram of Finite Automata

3 List out the Applications of Finite Automata

4 How to represent the Finite Automata

5 Explain the transition table and transition Diagram with examples

6 Explain various string Operations

7 What are the different types of Formal languages

8 Explain mathematical representation of DFA

9 Explain mathematical representation of NFA

10 Differentiate Between DFA and NFA

11 Define Finite state Machine

12 Design DFA Which accept all strings which are ending with 101 over an alphabet {0,1}.

13 Design DFA which accepts even no. of 1’s over { 0 , 1 }

14 Design NFA which accepts the strings end with 00 over { 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}

18 Construct a DFA which accepts a language aa or bb over the alphabet {a,b}

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 with ε to NFA without ε

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

Convert the following NFA with ε to NFA without ε

2
B

Convert the following NFA to DFA

A
3

4 A Convert the following NFA with ε to NFA without ε


Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{q,s}}
where  is given by

 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 Design a DFA for residue modulo 4


6
B Write an algorithm for marking pairs of in-equivalent states.

Find minimum state finite automata equivalent to the transition diagram.


7
B

A
8
B State and Prove equivalence of NFAs and NFA with Epsilon moves

Q. No Short Answer Questions

1 Define ε-closure with suitable example.

2 How to optimize the DFA

3 Define Extended Transition function for Epsilon NFA


4

10 What is the need of DFA optimization

11 What are the applications of Epsilon NFA

12 Explain the transition function for equivalence of NFA and DFA

13 Explain the procedure for NFA with Epsilon to DFA

14

Design a Epsilon NFA for any number a’s followed by any number of b’s followed by
15
number of c’s.

16 Differentiate NFA and Epsilon NFA.

17 Differentiate DFA and Epsilon NFA.

18

19

20

Q. No Descriptive Questions

1 A Construct Finite Automata for the Regular Expression (0+1)*(00+11)(0+1)*

B Construct regular Expression for the given DFA


Construct regular Expression for the given DFA

A
2

B Construct Finite Automata for the Regular Expression 10+(0+11)0*1

Construct regular Expression for the given DFA

A
3

B Construct Finite Automata for the Regular Expression (1+01+0010*(€+0+00)

Construct finite automata equivalent to the following regular expression. ((0+1)(0+1))*


A
+ ((0+1)(0+1)(0+1))*

Construct regular Expression for the given DFA

4
B

5 Let G be the grammar P:{SaB/bA, Aa/aS/bAA, Bb/bS/aBB} For the string


A
aaabbabbba find (a)leftmost derivation (b) rightmost derivation (c)parse tree.

B Construct DFA equivalent to the grammar


AaB/bA/b
BaC/bB
CaA/bC/a

A Construct DFA equivalent to the grammar S → aS | bA | b, A → aA | bS | a.


6 Find whether the Grammar is Ambiguous or not for the string id+id*id+id*id, and the
B
productions are EE+E / E*E / id

Show a derivation tree for the string aabbbb with the grammar
7
B SAB, A→aB, B→Sb

Give a verbal description of the language generated by this grammar

Obtain Regular Grammar for the following Finite Automata

A
8

B Show that the language L={wwR : w ϵ {a , b}*}is not inherently ambiguous

Q. No Short Answer Questions

1 Define regular Expression with an example

2 Write the applications of Regular Expressions

3 Define regular set

4 Write about the operation on Regular expressions

5 Define Regular Language

6 List out the properties of Regular expressions

7 State and prove Arden’s theorem

8 Write a procedure to convert Regular Expression to NFA with Epsilon

9 Design the Finite automata for the regular expression (0+1)*00

10 Write the closure properties of regular sets


11

12 Define Ambiguous grammar

13 Differentiate between Leftmost derivation and Rightmost derivation

14 Define derivation tree with example

15

16

17

18 Explain the relation between Regular expression and finite automata

19

20 Define Linear Grammar

Q. No Descriptive Questions

Convert the following grammar into GNF.

A SAA | 0

1 ASS | 1

Remove ε productions from following CFG by preserving meaning of it.


B S  XYX
X0 | ε
Y  1Y | ε
A

Convert the following grammar into CNF.


2
B S  aaaaS

S  aaaa

3 A If the CFG is as below


S  0A | 1B | C
A 0S | 00
B  1| A
C  01 then remove unit productions.
B

Convert the following grammar into CNF.


A
S ~S | [S‫כ‬S] | p | q
4 Find CFG with no useless symbols equivalent to
S  AB | CA
B B  BC | AB
Aa
C  aB | b
A
5
B Give context-free grammars for the set of palindromes over alphabet{a,b}

A
6
B Briefly discuss the procedures for reduced grammar

Convert the following grammar into GNF


A
7 SABb/a, AaaA/B, BbAb

A Transform the grammar SaSaA/A, AabA/b into Chomsky normal form


8
B

Q. No Short Answer Questions

1 Define CFG

2 Define CSG with an example

3 Explain the purpose for the simplification of CFG

4 Explain Removal of Useless Symbols

5 Explain removal of Epsilon production

6 Explain about Removal of Unit productions


7 Define Context Free Language

8 Write the form of productions in CNF

9 Write the form of productions in GNF

10 Differentiate between CNF and GNF

11 Explain the procedure to convert the given Grammar into CNF

12 Explain the procedure to convert the given Grammar into GNF

13

14

15

16

17

18

19

20

Convert the following into NFA

Represent all five tuples for NFA and DFA. Explain with suitable example.

Briefly discuss about finite automata’s with suitable examples.

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

b Convert the following NFA to its equivalent DFA

7
With the help of example explain the regular grammar

8
Differentiate between the left linear and right linear grammar and explain the equivalence.

Find minimum state finite automata equivalent to the transition diagram.

(OR)

Construct Finite Automata for the Regular Expression 10+(0+11)0*1

a Construct regular Expression for the given DFA


b State and Prove pumping lemma for regular sets and prove that the language
L = {0n1n / n>=1} is not a regular.
(Or)

a Construct Finite Automata for the Regular Expression (0+1)*(00+11)(0+1)*

b State and Prove closure properties of regular sets

Differentiate between NFA and DFA. Explain with suitable example.

Analytically define the NFA and DFA. Explain with suitable example.

Construct DFA for the language

L ={ W/W is a binary number divisible by 5} and find the acceptance of strings.

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.

prove that the language L = {ap / p is prime} is not a regular.


(OR)

Construct NFA for the following language


r=01*+1

Minimize the following finite Automata

(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.

b Write an algorithm for marking pairs of in-equivalent states.

Illustrate the types of formal languages


Construct DFA for the language

L ={ W/W is a binary number divisible by 4}

Convert the following NFA to its equivalent DFA where ({p,q,r,s},{0,1},,p,{q,s}} where
 is given by

4.

State and prove equivalence of DFA and NFA

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)

a Prove that, L={a^n b^n c^n for n>=1}is regular or not.


b Minimize the following DFA

Find whether the Grammar is Ambiguous or not for the string id+id*id+id*id, and the
productions are EE+E / E*E / id
8
Show a derivation tree for the string aabbbb with the grammar

SAB, A→aB, B→Sb

Give a verbal description of the language generated by this grammar

Let G be the grammar P:{SaB/bA, Aa/aS/bAA, Bb/bS/aBB} For the string


aaabbabbba find (a)leftmost derivation (b) rightmost derivation (c)parse tree.
(OR)

Find CFG with no useless symbols equivalent to


S  AB | CA
B  BC | AB
Aa
C  aB | b

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

a Convert the following grammar into GNF.


SAA | 0
ASS | 1

b Transform the grammar SaSaA/A, AabA/b into Chomsky normal form

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}

Derive r.e for the below finite Automaton


4.

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.
SABAC, AaA/ε, BbB/ε, Cc

8
Convert the following grammar to equivalent grammar to CNF SbA/aB, AbAA/ aS/a
BaBB/bS/b

Find CFG with no useless symbols equivalent to : S→AB / CA , B→BC / AB, A→a ,
C→aB/ b.

And write an algorithm.


10
Convert the following grammar to GNF SaS/AB, AЄ, BЄ, D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(SaAS/a, ASbA/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.

Construct DFA for the language

L ={ W/W is a binary number divisible by 4}

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

Prove that the language L = {0n1n / n>=1} is not a regular.


(OR)

Differentiate between regular grammars, right linear and left linear grammars

Construct regular Expression for the given DFA

10
State and Prove closure properties of regular sets

a Describe the applications of pumping lemma.


b Construct Finite Automata for the Regular Expression 10+(0+11)0*1

(Or)

a Construct Finite Automata for the Regular Expression (1+01+0010*(€+0+00)


b State and prove equivalence of regular expressions and NFA with epsilon transitions.

Differentiate between NFA and DFA with suitable example.

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.

Derive a Finite Automata for the following regular expression


(ab+a)*(aa+b)
(OR)

Show that L={0i1j / gcd(I,j)=1} is not regular

Derive r.e for the below finite Automaton


10
Construct an ε-NFA from the following regular expression (0*1*)*

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

Construct an NFA which accepts a language aa or bb over the alphabet {a,b}

Construct Finite Automata for the Regular Expression 10+(0+11)0*1

Prove that the following language is not regular


L = {0n12n | n>=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

Give context-free grammar to recognize any palindrome

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aB/bA, A→a/aS/bAA, B→b/bS/aBB

Convert the following grammar into CNF.

S ~S | [S‫כ‬S] | p | q

11.
a Briefly discuss the procedures for reduced grammar
b Convert the following grammar into GNF

SABb/a, AaaA/B, BbAb


(Or)
12. Q.
a Transform the grammar SaSaA/A, AabA/b into Chomsky normal form
b

Design an automata to accepts the language given by L={ab2n /n>=0}

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

a Minimize the following DFA

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

Illustrate the procedures for simplification of CFG

10
Write an algorithm for GNF

11.
a
b Construct DFA equivalent to the grammar
AaB/bA/b
BaC/bB
CaA/bC/a

12.
a Transform the grammar SaSaA/A, AabA/b into Chomsky normal form

b Find left most, right most and derivation tree for the string 00110101 with the grammar

S0B/1A, A→0/0S/1AA, B→1/1S/0BB

You might also like