Docsity

Automata Question bank, Exams of Theory of Automata

Toggle sidebar
bg1
Automata Theory and Computation Techniques
Faculty: POOJA AGARWAL No. Of Hours: 52 Sessions
QUESTION BANK
INTRODUCTION TO THEORY OF COMPUTATION AND FINITE AUTOMATA
OBJECTIVE: This chapter introduces automata theory, finite automata, and the class of languages known
as regular languages. These languages are the ones that can be described by finite automata.
1. Define equivalency of grammars. 5*
2. Define a) Language (L) b) Sentence c) Complement (L’) d) LR e) L1.L2 f) Ln g) L* h) L 10
3. Prove by induction |uv| = |u| + |v| 5*
4. Use induction on the size of S to show that if S is a finite set |2s| = 2|s|
Give the grammar that generates the language 4
5. L = {an bn+1 : n ≥ 0} Derive the string aaabbbb from the grammar 5
6. Given the following grammars and corresponding languages, show that the language is
indeed generated by the grammar.
G = ({s}, {a,b}, S, {s -> aSb, S -> λ})
L(G) = {anbn : n ≥ 0}
G = ({s}, {a,b}, S, {S -> SS, S -> λ, S -> aSb, S -> bSa})
L(G) = {w : na (w) = nb(w) } 5*
7. Define equivalency of grammars. 5*
8. Explain different units of automata. Explain the terms 1) Configuration 2) Move
3) Transition functions 6
9. Define acceptors & Transducers. 6
10. Write a note on applications of formal languages and automata. 6
11. Explain the operation of a Deterministic Finite Acceptor (DFA) with a diagram. 5*
12. Give the formal definition of DFA? Explain transition graph? Give an example. 5*
13. Define extended transition function ()? Define transition table. 5
14. Define language accepted by DFA? 5*
15. Derive the DFA that accepts the language L = {anb : n >=0} 6
16. Find the DFA that recognizes the set of all string on Σ = {a,b} starting with the
prefix ab 5*
17. Find the DFA that accepts all strings on alphabet {0,1} except those containing
Substring 001 5
18. Define a regular language. 4
19. Show that the language L = {awa : w{a,b}*} is regular ? Also show that L2 is regular? 6
20. Define the transition table, transition diagram, transition function DFA.
Which accepts strings which have odd number of a’s and b’s over the alphabet {a,b}
Which accepts strings which have even number of a’s and b’s over the alphabet {a,b}
Which accepts all strings ending in 00 over {0,1}
Which accepts all strings having 3 consecutive zeros
Which accepts all strings having 5 consecutive zeros
Which accepts all strings having even number of symbols 12
21. What language does grammar with these productions generate? S-> Aa,
A-> B, B-> Aa 5
22. Prove that (L1L2)R = L2RL 5
23. Give the formal definition of NFA. 5
24. Distinguish between NFA & DFA. 5
25. Define extended transition function for NFA. 5
26. Define language accepted by a NFA. 5
27. Define dead configuration in case of NFA. 5
28. What are the advantages of non-determinism? 5
pf3
pf4
pf5

Partial preview of the text

Download Automata Question bank and more Exams Theory of Automata in PDF only on Docsity!

Automata Theory and Computation Techniques

Faculty: POOJA AGARWAL No. Of Hours: 52 Sessions

QUESTION BANK

INTRODUCTION TO THEORY OF COMPUTATION AND FINITE AUTOMATA

OBJECTIVE: This chapter introduces automata theory, finite automata, and the class of languages known as ߧregular languages.ߨ These languages are the ones that can be described by finite automata.

  1. Define equivalency of grammars. 5*
  2. Define a) Language (L) b) Sentence c) Complement (L’) d) LR e) L1.L2 f) Ln g) L* h) L 10
  3. Prove by induction |uv| = |u| + |v| 5*
  4. Use induction on the size of S to show that if S is a finite set |2s| = 2|s| Give the grammar that generates the language 4
  5. L = {an bn+1 : n ≥ 0} Derive the string ߧaaabbbbߨ from the grammar 5
  6. Given the following grammars and corresponding languages, show that the language is indeed generated by the grammar. G = ({s}, {a,b}, S, {s -> aSb, S -> λ}) L(G) = {anbn : n ≥ 0} G = ({s}, {a,b}, S, {S -> SS, S -> λ, S -> aSb, S -> bSa}) L(G) = {w : na (w) = nb(w) } 5*
  7. Define equivalency of grammars. 5*
  8. Explain different units of automata. Explain the terms 1) Configuration 2) Move
    1. Transition functions 6
  9. Define acceptors & Transducers. 6
  10. Write a note on applications of formal languages and automata. 6
  11. Explain the operation of a Deterministic Finite Acceptor (DFA) with a diagram. 5*
  12. Give the formal definition of DFA? Explain transition graph? Give an example. 5*
  13. Define extended transition function (ͦ)? Define transition table. 5
  14. Define language accepted by DFA? 5*
  15. Derive the DFA that accepts the language L = {anb : n >=0} 6
  16. Find the DFA that recognizes the set of all string on Σ = {a,b} starting with the prefix ߧabߨ 5*
  17. Find the DFA that accepts all strings on alphabet {0,1} except those containing Substring 001 5
  18. Define a regular language. 4
  19. Show that the language L = {awa : wͧ{a,b}*} is regular? Also show that L2 is regular? 6
  20. Define the transition table, transition diagram, transition function DFA. Which accepts strings which have odd number of a’s and b’s over the alphabet {a,b} Which accepts strings which have even number of a’s and b’s over the alphabet {a,b} Which accepts all strings ending in 00 over {0,1} Which accepts all strings having 3 consecutive zeros Which accepts all strings having 5 consecutive zeros Which accepts all strings having even number of symbols 12
  21. What language does grammar with these productions generate? S-> Aa, A-> B, B-> Aa 5
  22. Prove that (L1L2)R = L2RL 5
  23. Give the formal definition of NFA. 5
  24. Distinguish between NFA & DFA. 5
  25. Define extended transition function for NFA. 5
  26. Define language accepted by a NFA. 5
  27. Define dead configuration in case of NFA. 5
  28. What are the advantages of non-determinism? 5
  1. Are the two grammars with respective productions S-> aSb|ab|λ, and S-> aAb|ab, A->aAb|λ, equivalent? Assume that S is a start symbol in both cases. 8
  2. If L is accepted by a DFA prove there is regular expression R for the language L such that L = L(R). 10
  3. Define the equivalence between two finite acceptors? 5
  4. Give DFA & NFA which accepts the language {(10)n : n ≥ 0} 5
  5. Prove the equivalence between DFA & NFA OR Let L be the language accepted by NFA MN = (QN, Σ,ͦN, QN, FN). Then prove that there exists a deterministic finite acceptor MD = (QD,ΣD,ͦD,QD,FD) such that L = L(Md). 10
  6. Convert the following NFA to DFA 10*
  7. Draw NFA for transition table given below : Input States a b q0 {q0,q1) {q2} q1 {q0} {q1} q2 -- {q0,q1} 10*
  8. Define distinguishable and indistinguishable states. 5
  9. Give the procedure to reduce number of states in DFA. 5
  10. Reduce the number of states in DFA. 10
  11. Construct a DFA and NFA to accept all string in {a,b} such that every ߧaߨ has one ߧbߨ Technology – Education for the Real World – Course Information – B.E. 4th Semester CS immediately to its right?

REGULAR LANGUAGES, REGULAR GRAMMARS, PROPERTIES OF REGULAR LANGUAGES OBJECTIVE: This chapter introduces the notation called ߧregular expressionsߨ and how they are capable of defining regular languages.

  1. Give the formal definition of a regular expression with example. 6*
  2. How is language L® denoted by regular expression ߧRߨ defined? Give examples. 6*
  3. Give the set of notation of language L® denoted by regular expressions given below a) a. (a+b) b) (a+b) * (a+bb) c) (aa) (bb)* b 8
  4. For Σ = {0,1}, give a regular expression ߧ ߨ such that L(r) = { wͧ Σ* : w has at least one pair of consecutive zeros} 6*
  5. Find all strings in L ((a+b)b(a+ab)) of length less that four. 4
  6. Show that r = (1+01)(0+1) denotes that language L = (w {0, 1): w has no pair of consecutive zeros). Find the other two expressions. 6
  7. Give the set and explain in English the sets denoted by following regular expressions a) (11+0)(00+1) b) (1+01+001)(0+00) c) (0+1)00(0+1) d) 00 11 22 10
  8. Show that the automation generated by procedure reduces is deterministic. 5
  9. Prove the following : If the states qa and qb are indistinguishable, and if qc and qa are distinguishable, then qb,qc must be indistinguishable. 6*
  10. Let r be a regular expression. Then prove that there is some NFA that accepts L(r) & hence L(r) is a regular language. 8
  11. Write the NFA which accepts L(r) where r = (a+bb)(ba + λ)
  12. Let L be a regular language i.e., there is a NFA that accepts L. Then prove that there exists a regular expression ߧrߨ such that L = L(R) 5
  13. Explain generalized transition graphs & how they are used for writing regular expression denoting same language as given NFA. 6
  14. Given the below NFA, write the corresponding regular expression using generalized transition graphs 6

a) L(G) = {wwr : w ͧ Σ* } Σ = {a,b} b) L(G) = { ab (bbaa)n bba (ba)n : n ≥ o} c) L = {anbm : n ≠ m} d) L = {w ͧ {a,b}* : na(w) = nb(b) and na(v) ≥ nb(v) where v is any prefix of w} e) L = { a2nbm : n ≥ 0 ≥ 0} 10*

  1. Define leftmost and rightmost derivation with example 4*
  2. Define derivation tree, partial derivation tree, and yield. 4*
  3. Let G = (V, T, S, P) be a CFG. Then prove that for every w ͧ l(G), there exists a derivation tree of G whose yield is w. 6*
  4. Prove that yield of any derivation tree is in L (G), where G is a CFG. 6*
  5. Prove that is TG is any partial derivation tree for G whose root is labeled S, then the yield of TG is sentential form of G. 6
  6. Define parsing 4
  7. Explain exhaustive search parsing? What is the serious flaw in using exhaustive Search parsing? 6
  8. Given a CFG & a string w, prove that exhaustive search parsing method either produces a parse of w or tells us that no parsing is possible, if P has no rules of form A -> λ or A -> B? 6
  9. Define simple grammar or s-grammar? What are its applications? 4
  10. Define a ambiguous CFG 4
  11. Show that the following grammars are ambiguous a) ({S}, {a,b}, S, {S->aSb|SS|λ}) b) ({E,I}, {a b c +()}, E, {E -> I E -> E + E, E -> E * E, E -> (E), I -> a|b|c}) Write equivalent unambiguous grammar. 6
  12. Define inherently ambiguous language and give an example. 4
  13. Explain the use of CFG in definition of PL. 4
  14. What is a normal form & why is it required? 4
  15. Prove the substitution rule of context free grammar. 4
  16. Define a useful / useless variable. Define a useless production. Explain two cases when a variable become useless. 10*
  17. Eliminate useless symbols and productions from the following grammar a) G = (V,T,P,S) = ({S,A}, {a,b}, {S-> aSb|λ|A, A->aA}, S) b) G = (V,T,P,S) = ({S,A,B}, {a,b}, {S->A, A-> aA|λ b->bA}, S) 6
  18. Explain dependency graph & its applications in CFG. 5
  19. Let G = (V,T,P,S) be a CFG. Then prove that there exists an equivalent grammar G1 = (V1,T1, S, P1) that does not contain any useless variables or productions. 5
  20. Define λ-productions and nullable variable. When can be a λ-production removed from the grammar? 6*
  21. Eliminate λ-production from the following grammar : G = (V,T,,P,S) = ({S,S1}, {a,b}, {S->As1b, S1-> aS1b|λ},S) 10
  22. Let G be any context free grammar with λ not in L(G). Then prove that there exists an equivalent grammar G1 having no λ-productions? 10
  23. Find the CFG without λ-production equivalent to grammar defined by the following productions S-> AbaC, A -> BC, B -> b|λ, C - > D|λ, D->d 10
  24. Define unit production. 4
  25. Let G = (V, T, S, P) be any CFG without λ productions. Then prove that there exists a CFG G1 = (V1, T1, S, P1) that does not have any unit productions and that is equivalent to G 6
  26. Remove all unit productions from S->Aa|B, B->A|bb, A-> a|bc|B 8
  27. Define CNF of a CFG 6
  28. Let G = (V, T, S, P) be a CFG with λ L(G). Then prove that there exists a equivalent

grammar G1 = (V1, T1, s, p1) in CNF. 8

  1. Convert the grammar with productions S-> Aba, A-> aab B->Ac to CNF 8
  2. Define GNF of a CFG 6
  3. Convert the grammar with productions below into GNF a) S->AB, A->aA|bB|b, b->b b) S->abSb|aa 6
  4. Write the regular expression for all Pascal real numbers 4
  5. Find the regular expression for Pascal sets whose elements are integer numbers 4
  6. Let L1 = L(abaa) and L2 = L(aba*) find L1/L2 5
  7. If L is a regular language, prove that the language {uv : UcL, VcLR Is also regular 6
  8. Find DFA’s that accepts the following languages a) L(aa* + abab) b) L(ab(a+ab)*(a+aa))
  9. L((abab)+(aaa+b)*) 8
  10. Design a CFG which consistes of all the strings having at least one occurences of 000. 10
  11. Construct the CFG for the language having any number of a's over the set of E= {a} 8
  12. for the grammar S-> A1B, A-> 0A|e, B-> 0B|1B\e give left most and right most derivation of the following string 00101. 10 PUSHDOWN AUTOMATA OBJECTIVE: This chapter defines two different versions of the pushdown automaton: one that accepts by entering an accepting state, like finite automata do, and another version that accepts by emptying its stack, regardless of the state it is in.
  • Pushdown automata: The pushdown automaton is in essence a nondeterministic finite automaton with Є-transitions permitted and one additional capability: a stack on which it can store a string of ߧstack symbols.ߨ
  1. Give two reasons why finite automata cannot be used to recognize all CFL and why PDA is required for that purpose. 5
  2. Explain the operations of a NPDA with diagram. 6
  3. Give the formal definition of NPDA. Explain clearly the transition function? 6
  4. Write a NPDA that accepts the language L = {anbn : n ≥ 0 }U {a} 6*
  5. Define the instantaneous description of a NPDA 4
  6. When do we say a CFL is accepted by NPDA? Define a) acceptance by final state b) acceptance by empty stack 6
  7. Construct a NPDA for the following languages a) L = {w ͧ {a,b}* : na(w) = nb(w)} b) L = {wwr : w ͧ {a,b}+} 10
  8. Prove that for any CFL L(specified as CFG without λ productions), there exists a NPDA M such that L = L(M) 6
  9. Construct a NPDA that accepts that language generated by grammar with productions a) S -> aA b) S -> Aabc|bB|a c) B -> b d) C -> c 8
  10. Write the CFG for language accepted by NPDA whose transitions are given below: ͦ(q0,a,z) = {(Q0,Az)} ͦ(q0,a,A) = {(q0,A)} ͦ(q0,b,A) = { {q1,λ)} ͦ(q1,λ,z) = {q2,λ)} 8*
  11. If L = L(M) for some NPDA M, then prove that L is CFL. 5
  12. Give the formal definition of DPDA and deterministic CFL. 6 125.Construct the PDA that accepts the language accepted by the grammar S-> 0S1 | e A-> aAS | a B-> SbS | A | bb 126.If L = N(P) for some DPDA, then L has an unambiguous context free grammar.
  1. Design a TM that copies strings of 1’s 5
  2. Design a Turing machine that halts at a final state if x≥y and at a nonfinal state x<y 6
  3. Design a TM that computes the function x+y if x≥ y F(x,y) 0 if x<y 10
  4. Design a TM to implement the macroinstruction If a Then qj Else qk 8
  5. Design a TM that multiplies two +VE integers in unary notation. 6
  6. Write a note on Turing Thesis. Define algorithm in terms of TM. 6
  7. Define equivalence of automata? Demonstrate the equivalence of TM using simulation. 6
  8. Define TM with stay on option. Prove that they are equivalent to class os standard TM? 6
  9. Define TM with semi-infinite tape & prove that they are equivalent to class of standard Turing machine. 6
  10. Define offline TM & prove that they are equivalent to class of standard TM. 5
  11. Write a note on multitape TM. 5
  12. Write a note on multidimensional TM. 5
  13. Define formally non-deterministic TM. 5
  14. Prove that class of deterministic TM & class of non-deterministic TM are equivalent 6*
  15. Write a note on universal TM. 6
  16. Explain what you mean by countable, uncountable sets and enumeration procedure.6*
  17. Prove that set of all TM, although infinite is countable. 8

UNDECIDABILITY OBJECTIVE: This chapter begins by repeating, in the context of Turing machines, a plausibility argument for the existence of problems that could not be solved by computer. The chapter gives a formal proof of the existence of the problem about Turing machines that no Turing machine can solve.We then divide problems that can be solved by a Turing machine into two classes: those that have an algorithm, and those that are only solved by Turing machines that may run forever on inputs they do not accept.

  1. Show that the halting problem, the set of (M, w) pairs such that M halts (with or with out accepting) when given input is RE but not recursive. 6
  2. Let L1, L2, …, Lk be a collection of languages over alphabet Σ such that:
  3. For all i ≠ j, Li ∩ Lj = Ø; i.e., no string is in two of the languages.
  4. L1 υ L2 υ …. υ L k = Σ*; i.e., every string is in one of the languages.
  5. Each of the languages Li, for I = 1,2,…, k is recursively enumerable. Prove that each of the languages is therefore recursive. 10
  6. What strings are: a) w37? b) W100? 6 Technology – Education for the Real World – Course Information – B.E. 4th Semester CS 36
  7. Prove ߧif L is a recursive language, so is L¯ߨ. 5
  8. Informally describe multi tape Turing machines that enumerate the following sets of integers, in the sense that started with blank tapes, it prints one of its tapes 10i210i21... to represent the set { i1, i2,..}. a) The set of all perfect squares {1, 4, 9…}. b) The set of all primes {2, 3, 5, 7, 11…..}. 8
  9. What are Recursive languages? What is the relationship between the recursive, RE, and non RE languages?