0% found this document useful (0 votes)
65 views7 pages

Atc Question Bank

The document contains questions related to theory of computation and automata theory. It includes questions on defining terms related to finite automata, designing DFAs and NFDAs for various languages, converting between DFAs and NFDAs, regular expressions and grammars. There are also questions on pushdown automata and parsing techniques like shift-reduce parsing.

Uploaded by

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

Atc Question Bank

The document contains questions related to theory of computation and automata theory. It includes questions on defining terms related to finite automata, designing DFAs and NFDAs for various languages, converting between DFAs and NFDAs, regular expressions and grammars. There are also questions on pushdown automata and parsing techniques like shift-reduce parsing.

Uploaded by

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

SL.

No Questions Blooms Level


MODULE 1
Define the following terms : L1
1. (i) Alphabets (ii) Strings (iii) Power of an alphabet (iv) Language v) Concatenation
vi) Kleens’s closure vii) є-NFA viii) є-CLOSURE
2. Define DFA. Design a DFA to accept the binary numbers which are divisible by 5. L3
3. Obtain a DFA to accept strings of a’s and b’s starting with the string ab. L1
Give DFA’s accepting the following strings over the alphabet {0,1} L4
4. The set of all strings containing 1101 as a substring.
The set of all strings that begin with 01 and end with 11.
5. Define є-NFA and є-CLOSURE L4
Construct a NFA for the language L3
6. (i) L1={consisting a substring 0101}
(ii) L2={anUbn}
Obtain a DFA to accept strings of a’s and b’s except those containing the Substring L3
7.
aab.
Mention the differences between DFA, NFA and ε-NFA. Give the applications of L3
8
Finite Automata.
Draw a DFA to accept the Language :L=(w:w has odd number of 1’s and followed L3
9
by even Number of 0’s.
Design DFA accepting the following languages over alphabet {a,b} L3
10. (a) L= {w:|w| mod 5 < > 0}
(b) The set of all strings not containing ‘aab’
Convert the following NFA to its equivalent DFA. L3
11.

Convert the following ε-NFA to DFA L4

12.

13. Write DFA to accept strings of 0’s, 1’s & 2’s beginning with a 0 followed by odd L4
number of 1’s and ending with a 2.
Consider the following ε-NFA. Convert the automata length 3 or less accepted by the
automaton.

14. L1

15. Obtain a DFA to accept strings of a’s and b’s having even number of a’s and b’s. L1
16. Obtain a DFA to accept strings of 0’s and 1’s having even number of 0’s and odd no. L3
of 1’s.
17. Design DFA accepting the following languages over alphabet {a,b} (a) L= {w:|w| L1
mod 5 < > 0}
(b) The set of all strings not containing ‘aab’
18. Design DFA accepting the following languages L2
L={awa : w ϵ (a,b)*} verify string aabaa
L{w : where |w| mod 3 = 0} where Σ = {a}
L={w ϵ (a,b)*} every a region in w is of even length
L={w ϵ (a,b)*} w contains no more than one b}
L={awa : w ϵ (a,b)*} w contains even number of a’s and odd number of b’s} verify
string aabaa
L={w ϵ (0,1)*} : w is ending with 01}
L={(a+b)n abb : n>=0}
DFA to accept string’s a’s and b’s ending with ab or ba
L{w : na (w) >= 1 nb (w)=2}
19. Obtain a DFA to accept the language L = |w| mod 3 >= |w| mod 2 L1
20. What are the applications of finite automaton? L2
21. List the disadvantages of DFA. L2
22. Obtain the DFA for the following NFA using subset construction method. L1

23. Prove that the DFA D constructed from NFA N by subset construction method L3
then L(D)=L(N)
24. What is the difference between DFA, NFA and ↋-NFA? L3
25. Convert the following NFA to its equivalent DFA using lazy evaluation method. L3

26. Obtain the equivalent DFA for the ↋-NFA. L2


27. Define distinguishable and indistinguishable states. Minimize the following DFA. L3
ẟ A B
→A B F
B G C
*C A C
D C G
E H F
F C G
G G E
H G C
28. Differentiate between Compiler and Interpreter.
29. Explain language processing system. L2
OR
What are the cousins of the compiler?
30. Explain the block diagram of the compiler. L4
MODULE 2
1. Obtain a regular expression for the language L3
L={a2nb2m | n>=0, m>=0}
L={anbm | n>=1, m>=1,nm>=3}
RE to accept strings of a’s and b’s whose length is either even or multiples of 3 or
both.
RE to accept strings of a’s and b’s such that 3rd symbol from the right is a and 4th
symbol from the right is b.
L={w : string ends with ab or ba where w ϵ {a,b}*}.
2. List the application of Regular Expression. L2
3. Build an R E from the following Finite State Machine L4
1)

2)

3)

4. Construct FSM for the following RE L3


1. (b(a U b)b)*
2. ab(a+b) *
3. (b U ab )*.
5. Apply the concept of pumping lemma for regular language and prove the language is L3
irregular
6. Show that the following language is not regular L2
1)L={WWR| W ∈(0 ,1)* }
2)L={an bn |n>=0}
3)L={aibj|i ≠j}
4)L= {0n|n is prime }
5)L={an bl cn+l |n,l>=0}
7. Construct the language for the following grammar L3
S → aCa
C → aCa|b
S →0A|ε
A→1
8. Obtain the grammar for the following language L3
1)L={an+2bm |n ≥ 0 &m>n}
2)L={0i1j| i ≠j ,i≥ 0 & j≥ 0}
3)L={W|na(w)= nb(w)}
4)Set of all palindromes over Σ=(a,b)
5)L={W| na(w) > nb(w)}
6)L={ anbmck|n+2m=k for n≥0, m≥0}
7)Set of all strings with no more than 3 a’s
8) Set of 0’s and 1’s having substring 000
9)L=(W: |W| mod3 ≠ |W| mod2} on Σ=(a,b)
MODULE 3
1 Define a Parse Tree. Explain the types of parse tree with example L2
2. What is context free grammar? List the 4 tuples of the below grammar L2
A → aA, A → abc.
S → aSa, S → bSb, S → ε
S → 00S | 11F, F → 00F | ε
3. Consider the production X → X+X | X*X |X| over an alphabet {a}.Obtain leftmost L3
derivation and rightmost derivation for the string "a+a*a" and construct the parse
tree for the same
4. Demonstrate kleen’s theorem with an example L2
5. Examine and Eliminate the left recursion for the following L4

1) A → ABd / Aa / a
B → Be / b

2) E → E + E / E x E / a

3)E→E+T|E-T|T
T→T*F|T/F|F
F→id

4)S →Aa|b
A→ Ac| Aad| bd| ε
5) S → (L) / a
L→L,S/S
6. Examine and Eliminate the left factoring in the following L4
1)S→iEtS|iEtSes|a
E→b

2)S→aSSbS|aSaSb|abb|b

3)S→bSSaas|bSSaSb|bSb|a

4)A→Aab|Aa
B→b B|b

7. What is ambiguous grammar? Demonstrate with an example L2


8. List and explain the Role of the Lexical Analyzer and the need for differentiating L2
lexical analysis and parser
9. Define the following with an example L1
1)Lexeme
2)Token
3)Pattern
4)yield of parse tree
10. Explain the concept of input buffering L2
11. Construct a transition diagram for the following L3
1)Relational Operator
2)Unsigned Number
12. Given the grammar L2
1) E-> T + E / T
2) S-> Ab |Ac|Sd|Sc
T ->T * F / F
B->Bbc|f F ->€ / id C->g
Show the output of FIRST and FOLLOW functions for the grammar given.
MODULE 4
1. Define PDA. L1
2. Obtain PDA for the following language. L3
L={anbn |n> =1}
L={wCwR | w ϵ (a+b)*}
L={w | w ϵ (a+b)* and na(w)=nb(w)}
L={w | w ϵ (a+b)* and na(w)<nb(w)}
L={wwR | w ϵ (a+b)*}
L={anb2n |n> =1}
3. Define shift reduce parser? Explain its actions and conflicts by taking example. L2
4. Define bottom up parser. With an example construct bottom up parser. L1
5. Explain Handle pruning. L2
6. Consider the grammar L3
S -> aSa | bSb | ε
Indicate the handle for the following right sentential form abbbba.
7. Consider the grammar L3
S –> S + S
S –> S * S
S –> id
Perform shift reduce parsing for the string id + id * id.
8. Show the action of the shift reduce parser for the following grammar L3
E -> E + E/E * E/( E )/id
The input string are , by using operator precedence parser method.
9. Consider the following grammar L3
E→E*E
E→E+E
E → (E)
E → id
Indicate the handle for the following right sentential form id1 + id2 * id3 using LR(1)
/Bottom Up Paring.
10. For the following grammar L3
Find the FIRST AND FOLLOW SET
Construct the predictive parsing table.
Parse the input string
S →aABb
A→c|
B→d|
Parse the input string “ acbd”

E→E+T|T
T→T*F|F
F → (E) | id
Parse the input string “ id + id * id ”

S → a | (L)
L→L,S|S
Parse the input string “ (a,(a,a)) ”

11. Consider the grammar L3


S → TL
T → int | float
L → L, id | id
Parse the string “ int id,id; ” using SHIFT RDUCE PARSER

S → a | (L)
L→L,S|S
Parse the input string “ (a,(a,a)) ” using SHIFT RDUCE PARSER

S →aAcBe
A → Ab | b
B→ d
Parse the input string “ abbcde ” using SHIFT RDUCE PARSER
12. Explain the types of conflicts in Shift Reducing Parsing. L2
13. List and explain different actions of shift reduce parser. L2
14. Explain Top Down and Bottom Up Parsing with an example and construct the L2
derivation tree for the same.
15. Define Handle Pruning with an example. L2
16. Define LR(0) items, and its associated items. L2
17. Consider the following grammar L3
E→E+T|T
T→T*F|F
F → (E) | id

Obtain the SLR parser and parse the input string id * id + id


S → L=R | R
L → * R | id
R→L
Verify the Grammar is SLR (1) or not.
MODULE 5
1. Define Turing Machine and explain the working of Turing Machine. L2
2. Write the SDD for the following grammar: L2
S → En where n represent end of file marker
E→E+T|T
T→T*F|F
F → (E) | digit
3. Obtain SDD and annotated parse tree for the following grammar using topdown L3
approach:
T→T*F|F
F → digit
4. Write the SDD for a simple desk calculator. Write the annotated parse tree for the L2
expression 3*5+4n

You might also like