formal languages and automata theory part a unit-1

18
Formal Languages and Automata Theory Question Bank Dept. of CSE, DSATM 2013-2014 Page 55 FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1 INTRODUCTION TO FINITE AUTOMATA 1. a.Define the following terms: i) Alphabet ii) power of an alphabet iii) Strings Iv) Language (4Marks-Dec 10, 06Marks- Dec. 09/ Jan. 10, 04Marks- June/ July 11, 08 Marks May/June10, Marks June 12) b.Write the DFA’s for the following languages over ∑ = {a,b}: i) The set of all strings ending with abb ii) The set of all strings not containing the substring aad iii) L ={a w a! w €(a +b)*} iv) L ={w!IwI mod 3=0} (8Marks-Dec10) c.Convert the following NFA to its equivalent DFA (8Marks-Dec10) 2. a.Define finite automata. What are the applications of finite automation? (6Marks-Dec11) b. What are the difference between DFA and NFA ? (4Marks-Dec11) c. Design and DFA which accept strings of 0’s and 1’s which when interpreted as a binary integer is multiple of 5. Also give the sequence of states that DFA is in while processing the input string: 1001011. (10Marks-Dec 11) 3. a. What is Automata? Discuss why study automata. (06Marks- Dec. 08/ Jan09, 06Marks-Dec 12) b. Define DFA and design the DFA for the flowing languages on ∑= {a,b}, i) The set of all strings that either begings or ends or both with substring ‘ab’ ii) the set of all strings that ends with substring ‘abb’ iii L= {w: |W| mod 5 < >0} (08Marks-Dec 08/Jan09) c.Define -NFA and design the E – NFA or NFA for the following languages.

Upload: others

Post on 11-Jan-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 55

FORMAL LANGUAGES AND AUTOMATA THEORY

PART A

UNIT-1

INTRODUCTION TO FINITE AUTOMATA

1. a.Define the following terms:i) Alphabet ii) power of an alphabet iii) Strings Iv) Language

(4Marks-Dec 10, 06Marks- Dec. 09/ Jan. 10, 04Marks- June/ July 11, 08 Marks May/June10, Marks June 12)

b.Write the DFA’s for the following languages over ∑ = {a,b}:i) The set of all strings ending with abbii) The set of all strings not containing the substring aadiii) L ={a w a! w €(a +b)*}iv) L ={w!IwI mod 3=0} (8Marks-Dec10)

c.Convert the following NFA to its equivalent DFA

(8Marks-Dec10)

2. a.Define finite automata. What are the applications of finite automation? (6Marks-Dec11)

b. What are the difference between DFA and NFA ? (4Marks-Dec11)

c. Design and DFA which accept strings of 0’s and 1’s which when interpreted as a binary integer is multiple of 5. Also give the sequence of states that DFA is in while processing the input string: 1001011.

(10Marks-Dec 11)

3. a. What is Automata? Discuss why study automata. (06Marks- Dec. 08/ Jan09, 06Marks-Dec 12)

b. Define DFA and design the DFA for the flowing languages on ∑= {a,b}, i) The set of all strings that either begings or ends or both with substring ‘ab’ ii) the set of all strings that ends with substring ‘abb’iii L= {w: |W| mod 5 < >0} (08Marks-Dec 08/Jan09)

c.Define -NFA and design the E – NFA or NFA for the following languages.

Page 2: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 56

i) abc, abd, and aacd { Assume ∑= a,b,c,d} ii) {ab,abc}* { Assume ∑+ {a,b,c}. (06Marks- Dec 08/Jan09 )

4. b. Define DFA. Design a DFA to accept the binary numbers which are divisible by 5 (06Marks Dec. 09/ Jan. 10)

c. Convert the following NFA to its equivalent DFA using subset construction:

(08Marks- Dec. 09/ Jan. 10)5. b. Write the DFA’s for the following languages over ∑= {a,b} i) {set of all string having two consecutive a’s} ii) L= {w: |w| mod 3=0} iii ) L= {awa: w (a+b)*}. (08Marks- Dec 12)

c. Define NFA convert the following NFA to its equivalent DFA. (06Marks- Dec 12)

6. a. Define i) Powers of an alphabet ii)NFA (04Marks- June-July 09)

b. Design a DFA to accept the following language over the alphabet {0,1} i) L= {w |w is a even number } ii) L= { (01)i 12j |i ≥1, j ≥1} iii) The set of strings either start with 01 or end with 01. (10Marks- June-July 09)

c. Consider the following -NFA. (06M- June-July 09)

Compute the -closure of each state ii) convert the automations to a DFA.

7. b. construct a DFA to accept strings over {a,b}, such that every block of length five contains at least two a’s. use extended transition of function to trace a string W=aabba,

(08Marks- June/ July 11 )

c. Prove that if D= (D, ∑, D, {q0}, FD) is the DFA constructed from NFA N= (N,∑, N, {qN}, FN) by subset construction then L(D)= L(N)

(08Marks- June/ July 11)

Page 3: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 57

8. b. Mention the differences between DFA, NFA and -NFA.(04 Marks May/June10 )

c.Convert the following -NFA to DFA. {Refer Fig.Q1(c)}.(08 Marks May/June10)

9.b)Write DFA for the following :

i)Set of all string not containing (110) ii)Set of all strings with exactly three consecutive O’s

(06 Marks June 12)

c)convert the following NFA to DFA:

(08 Marks June 12)

UNIT-2

FINITE AUTOMATA REGULAR EXPRESSION

1. a. Compute -closure of each state from the following - NFA :

(04Marks-Dec10)

b. Define regular expression. Write the regular expression for the following languages:i) L = {an bm| n ≤ 4, m≥2}

ii) Strings of O’s and 1’s having no two consecutive zerosiii) strings of 0’s and 1’s whose lengths are multiples of 3. (06Marks-Dec 10)

a b->p {r} {q} {p,r}q {p} r {p,q} {r} {p}*S {p} {p} {p}

Page 4: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 58

c. Design an -NFA for the regular expression (a+b)*ab. (04Marks-Dec 10)

d. Obtain a regular expression from the following DFA using state elimination method:

(06Marks-Dec10)

2. a.Obtian the regular expression to accept strings of a’s, b’s and c’s such that fourth symbol from the right is: a and ends with : b.

(04Marks-Dec11)

b. Consider the following -NFA:

i) Compute -closure of each state ii) Convert the automaton to a DFA. (10Marks-Dec11)

c. Convent the following automaton to a regular expression using state elimination technique:

(06Marks-Dec11)

3. a.Convert the following I NFA to DFA using “Subset construction Scheme” (08Marks- Dec 08/Jan09)

Page 5: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 59

b. Define Regular expression and write Regular expression for the following languages. i) L= { a2nb2m+1 : m≥0, n≥0}. ii) L= {anbm : (m+n)is even}.

iii) L= {anbm: n> = 4, m <=3}. (06Marks- Dec 08/Jan09)

c. Prove that every language defined by a Regular expression is also defined by Finite automata (06Marks- Dec 08/Jan09)

4. a. Design an NFA that Accepts that Language L(aa*(a+b)} (04MarksDec. 09/ Jan. 10)

b. Consider the following -NFA:

a B C

{p} {q} {r}

q {p} {q} {r} *r {q} {r} {p}

i)Compute the -closure of each state/ii)Give all the strings of length 3 or less accepted by the automation iii)Convert the automation to a DFA. (10Marks- Dec. 09/ Jan. 10)

c. Write the regular expressions for the following languages: i) The set of all strings over ∑: { a,b,c} containing atleast one a and atleast one b. ii) L= {w: |w| mod3=0} Assume ∑: {a,b} iii)The set of strings of 0’s and 1’s whose 10th symbol from the right end is 1.

(6Marks- Dec. 09/ Jan. 10)

5.a.write regular expression for the following languages: (06Marks- Dec12)i) {strings of a’s and b’s having two consecutive a’s}ii) {strings of a’s and b’s whose 3rd symbol from right end is a}iii) L= {w : |w| mod 3+0}.

b. Obtain a regular expression for the DFA shown below using Kleen’s theorem (10Marks- Dec12)

c. Obtain an -NFA for the regular expression a* + b* +C* (04Marks- Dec12)

6. a. Define Regular Expression. Write the regular expression for the following language: i) Language of all strings w such that w contains exactly one 1 an even number of 0’s ii) Set of strings over { 0, 1,2} containing atleast one 0 and atleast one 1

(10Marks- June-July 09)

Page 6: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 60

b. Convert the following DFA to a regular expression using the state elimination technique

(06M- June-July 09)

c. Prove that if R be a regular expression then there exist some -NFA that accepts L(R) (04M- June-July 09)

7. a. Define - NFA What are the steps involved in converting -NFA to DFA. Convert following - NFA to DFA. (08Marks- June/ July 11)

b. Write regular expression for i) L= { anbm | n≥ and m≤3} ii) L= { a2nb2m | n≥0, m≥0}. (06Marks- June/ July 11)

c. Convert the following DFA to regular expression using Kleene’s theorem. (6Marks- June/ July 11)

8. Define a regular expression. Find regular expression for the following languages on{a,b}:

a. L } b. L={.w:|w| mod 3=0 }, w (08 Marks May/June 10)

b. Prove that if L and M are regular languages, then so is L (06 Marks May/June 10)

c. Convert the regular expression (01 +1)* to an (06 Marks May/June 10)

9. a. For a given E-NFA, compute the following :a) Compute E-closure of each state.b) Give the set of all strings of length 3 or less accepted by the automation.c) Convert the automation to DFA. (10 Marks June12)

Page 7: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 61

b. Prove that every language defined by RE is also defined by some finite automata. (06 Marks June12)

c. Explain about text search for address pattern. (04 Marks June12)

UNIT-3

REGULAR LANGUAGES, PROPERTIES OF REGULAR LANGUAGES

1. a.Apply pumping lemma for the following languages and prove that they are not regular:i)L= {w wR|w(0+1)*} ii) L= {anbnI n≥0} (10Marks-Dec 10)

b. Prove that the regular languages are closed under complementation. (4Marks-Dec 10)

c. Consider the two DFA’s shown below. Using table filling algorithm, show that the language accepted by both the DFA’s is same.

(6Marks-Dec 10)

2. a. Prove that the language L={ 0m1n | m> n, ∑= {0,1} is not regular (06Marks-Dec 11)

b. Consider the DFA given by the transition diagram:

i) Draw the table of distinguishabilities for this automaton.ii) Construct the minimum state equivalent DFA.

(10Marks-Dec 11)

c. Show that if L is regular language, then complement of L denoted by L is also

Page 8: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 62

regular (04Marks-Dec 11)

3. a.If L1and L2 are regular languages then prove that family of regular language are closed Under L1 – L2. (06Marks- Dec 08/Jan09)

b. State and prove pumping lemma for regular languages. Apply pumping lemma for following languages and prove that it is not Regular L= {an ; n is prime}

(08Marks- Dec 08/Jan09)c. Consider the DFA

i) Draw the table of distinguishable and indistinguishable states for the automata.ii) Construct minimum state equivalent of automata.

(06Marks- Dec 08/Jan09)

4. a. Convert the regular expression (0+1)*1(0+1) to an -NFA (04Marks- Dec. 09/ Jan. 10)

b. State and prove the pumping lemma for regular languages (06M- Dec. 09/ Jan. 10, 08Marks- Dec12, 04Marks-June-July 09)

c. Consider the transition table Q3(c). Of DFA given below:

i) Draw the table of distinguishabilities of this automatonii) Construct the minimum state equivalent DFA using table filling algorithm

(10M- Dec. 09/ Jan. 10)

5. b. Show that the language L = {w|na(w) = nb (w)} is not regular (04MarksM- Dec 12)

c. Minimize the following DFA using table filling method. (08Marks- Dec 12)

Page 9: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 63

6. a. ii) Prove that the following language is not regular : L= {0n 1n+1 | n>0}

iii)Prove that if L is a regular language over alphabet ∑- then L is also a regular language.

(12Marks- June-July 09)

b. Minimize the following DFA using Table filling algorithm.

(8Marks- June-July 09)

7. a. Construct NFA for the regular expression (a*+b*+c*). (04Marks- June/ July 11)

b. State prove pumping lemma for regular languages. Show the L={on | n is prime} is not regular. (10Marks- June/ July 11)

c. Minimize the following DFA using table filling algorithm. (06M- June/ July 11)

8. a.State pumping lemma for regular languages. Prove that the language {1 Non-regular. (10 Marks May/June 10)

Page 10: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 64

b. Define distinguishable and indistinguishable states. Minimize the following DFA using table filling algorithm.

(10 Marks May/June 10)

9. a. If L and M are regular languages prove that L M is also regular. (03 Marks June 12)

b. Consider the homomorphism from the alphabet {0,1,2} to {a,b} defined by h(0) = ab, h (1)=b h(2) = aa

i)What is h (2201)?ii)If L is language 1*02* what is h(L)?

iii)If L is the language (ab+baa)* bab what is (L). (09 Marks June 12)

c. Construct the product of DFA.

(08 Marks June 12)

UNIT-4

CONTEXT FREE GRAMMARS AND LANGUAGES

1. a.Define context free grammar. Write the grammar for the following languages:i)L= { 0n+2 1n | n≥1} ii) L={ an bm|m>n and n≥0} (07Marks- Dec 10)

b. Consider the grammar G, with productions: S Ab B A aA | B aB |bB | Give leftmost derivation, right most derivation and parse tree for the string aaabab.

(08Marks-Dec10)

c. What is ambiguous grammar? Show that the following grammar is ambiguous. S AB|aa B A a | Aa B b

(05Marks-Dec10)

Page 11: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 65

2. a.Define context-free grammar. Obtain the CFG for the following languages:i)L= { w| w {0,1}* with at least one occurrence of ‘101’}ii)L= {aibjck | i=j+k, ∑= {a,b,c} (08Marks-Dec 11)

b. Explain the following with suitable examples: (08Marks-Dec 11)

i) Left most derivation ii) Right most derivation iii) Parse tree (06Marks-Dec 11)

c. What is an ambiguous grammar? Show that grammar shown below is ambiguous. S AB | aaB A Aa |a B b

3. a.Define context free grammar and write context free grammar for the following languages.

i)L={aibjck: i+j= k,i>=0,j.>=0} ii)L= {anbmck : n+2m=k} (07Marks- Dec 08/Jan09)

b. Consider the grammer. E +EE|*EE|-EE|x|y Find leftmost and rightmost derivation for the string +*-xyxy and write parse Tree (08Marks- Dec 08/Jan09)

c. what is ambiguous grammer? Prove that the following grammer is ambiguous on the string “aab” S as|asbs| (05Marks- Dec 08/Jan09)

4. a. Define CFG. Write CFG for the language L={0n1n |n≥1}, i.e. the set of all strings of one or more 0’s Followed by an equal number of 1’s (08Marks- Dec. 09/ Jan. 10)

b. Consider the grammar S aS |aSbS | Is the above grammar ambiguous? Show in particular that the strings aab has two:

i) Parse treesii)Leftmost derivationiii)Rightmost derviations (12Marks- Dec. 09/ Jan. 10)

5. a. write CFG for the following languages: (06Marks- Dec 12)i)L= {set of all non-palindromes over {a,b}}ii)For the regular expression (011+1)* (01).

b. Consider the following grammar G. (08Marks- Dec 12) S aAS | a A SbA | SS |ba Obtain: i) LMD; ii)RMD iii) Parse tree for LMD ; iv) Parse tree for RMD for the string aabbaa.

c. Show that the following grammar is ambiguous. (06Marks- Dec 12) S iCts |iCtSeS |a

Page 12: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 66

C b.

6. a. Construct the CFG for the following Languages (10Marks- June-July 09)i)L={a2n bm | n≥0, m≥0) ii) L= {0i 1j 2k | i=j or j=k} and Generate left most derivation for the String 0 1 1 2 2 .

b.Define Ambiguous Grammar. Prove that the following grammar is ambiguous. Find An unambiguous grammar. S a S | a S b S | (10Marks- June-July 09)

7. a.Define CFG. Write a CFG fori) L= {Strings ofer a’s and b’s with equal number of a’s and b’s}ii) L= {an bn ci | n ≥0, i ≥1} Ụ { an bn cm dm | n,m≥0}

(06Marks- June/ July 11)

b. Design a grammar for valid expressions over operator and/ the arguments of expression are valid identifier over symbols a, b, 0 and 1. Derive LMD and RMD for sting w=(all-b0)/ (b00-a01). Writer parse tree for LMD

(10Marks- June/ July 11) c. Show that the following grammar is ambiguous S SS|(S) over W= (() () ()) (04Marks- June/ July 11)

8. a.Define CFG. Obtain CFG for the following languages:i)L = {w | ∈ { , }*}, is the reversal of w } ii) L= {w : w has a substring ab} `

(10 Marks May/June 10)b.What is an ambiguous grammar? Show that the following grammar is ambiguous.

E→ + | − | ∗ | / E| (E)| aWhere E is the start symbol. Find the unambiguous grammar. (10 Marks May/June 10)

9. a. Design CFG for the following : Set of all strings of O’s and 1’s, whose number of 0’s equal to number of 1’s

(06 Marks June 12) b. Consider the grammer S→sbs/a. This grammer is ambiguous: show that particular string aba ba ba has two i) Parse trees ii)Left most derivations.

iii)Right most derivation. (10 Marks June 12 ) c.Write any one application of CFG with example. (04 Marks June 12)

Page 13: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 67

PART -B

UNIT-5

PUSHDOWN AUTOMATA

1. a. Define PDA. Descirbe the language accepted by PDA. (04Marks-Dec 10)

b. Construct a PDA that accepts the language L = { an bn | n ≥ 1}. Give the graphical representation for PDA obtained. Show the instantaneous description of the PDA on the input string aaabbb. (10Marks-Dec 10)

c. Obtain a PDA equivalent to the following grammar: (06Marks-Dec 10) S AS | A 0A 1| A1 | 01 2. a.What is an instantaneous description of PDA? Obtain a PDA to accept the following

language by final state: L= {anb2n|n≥1, ∑={a,b}} Draw the transition diagram for PDA. Also, show the moves made by PDA for the String: aabbbb. (12Marks-Dec 11)

b. Design a PDA for the following CFG: (08Marks-Dec 11) S aSb | bSa| SS|

3. a.Define PDA and construct a PDA that accepts the following languages.L = { w: w(a+b)* and na(w)+ nb(w)}. Write the instantaneous description for the string “aababb” (12Marks- Dec 08/Jan09)

b. For the following grammer construct a PDA

(8Marks- Dec 08/Jan09)

4. a. Define a PDA. Discuss about the languages accepted by a PDA. Design a nondeterministic PDA for the Language L= {0n1n| n≥1}

(12Marks- Dec. 09/ Jan. 10) b. Convert the following grammar S 0S1 | A A | A0 | S | To a PDA that accepts the same language by empty stack (8Marks- Dec. 09/ Jan. 10)

5. a.Define PDA. Design PDA for the language L= {wCwR, w (a+b)*}. Show that ID’s for the string abcba and also write the transition diagram (12Marks- Dec 12)

Page 14: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 68

b. Obtain a PDA for the following CFG: (08M- Dec 12)

6. a. Discuss the languages accepted by a PDA. Design a PDA for the language that accepts the strings with na(w) < nb (w) [number of a’s less than number of b’s]. where w (a+b)* and show the Instantaneous descriptions of the PDA on input a b b a b. (14Marks- June-July 09)

b. Convert the following grammar to a PDA that accepts the same language by empty stack S 0 S 1 |A : A 1 A 0 |s| (06Marks- June-July 09)

7. a. Write block diagram, of PDA with its tuples. What are the two ways of accepting languages in PDA? (04Marks- June/ July 11)

b. Design a PDA for L= {ai bj ck | J=i+k, j, k ≥o} write transition diagram and ID for string w=abbbcc. (12Marks- June/ July 11)

c. Convert following CFG to PDA S AS | A OA1 | A1 |01. (04 Marks- June/ July 11)

8. a.Define PDA. Design PDA to accept the following language by final state L={w | w (a, b}* ,

Draw the graphical representation of PDA. Also, show the moves made by the PDA for the string abbaba. (12 Marks May/June 10 )

b. Convert the following CFG TO PDA. S A B C (08 Marks May/June 10)

9. a.Design a PDA P to accept language Lw . Show that how PDA accepts string 1111 with TD. (10 Marks June 12)

b. Prove that for a PDA P there exist CFG such that L(G) = N(P). (10 Marks June 12)

Page 15: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 69

UNIT-6

PROPERTIES OF CONTEXT FREE LANGUAGES

1. a.what are useless symbols? Explain with an example. (04Marks-Dec 10)

b. Obtain the nullable set and hence eliminate all - productions from the following grammar: S aAa | AB A BS |aBa | B aB | (06Marks-Dec 10)

c. Define CNF. Convert the following grammar to CNF: S aSa | ab|Aa A aab (10Marks-Dec 10)

2. a.what is an unit production? Begin with the grammar: S ABC | BaB A aA | BaC |aaa B bBb | a | D C CA | AC D

i) Eliminate -productionsii) Eliminate any unit productions in the resulting grammariii) Eliminate any useless symbols in the resulting grammar. (10Marks-Dec 11)

b. Obtain the following grammar in CNF S 0A |1 B A 0AA | 1S | 1

B 1BB |0S | 0 (10Marks-Dec 11)

3. a.Consider the grammer.

i)Eliminate t-productions. ii)Eliminate Unit productions in the resulting grammar iii)Eliminate Useless production in the resulting grammar (9Marks Dec 08/Jan09)

b. what is Chomsky normal form? Convert the following grammar b Chomsky normal from. S ABa A aab B Ac.

(05Marks Dec 08/Jan09) c.If L1 and L2 are context free languages them prove that family of context free

Page 16: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 70

languages are closed under Union and concatenation operations (06Marks-Dec 08/Jan09)

4. a. State and prove pumping lemma for context free languages.(8Marks- Dec. 09/ Jan.10)

b. What are CNF and GNF of context free grammar? Give examples. (06Marks- Dec. 09/ Jan. 10)

c. Using the CFL pumping lemma, show that the following language is not context free L={aibjck|i<j<K} (06Marks- Dec. 09/ Jan. 10)

5. a. Remove useless symbols from the following grammar: (08Marks- Dec 12)

b. Define CNF. Convert the following CFG to CNF: (08Marks- Dec12)

c. Prove that context tree languages are closed under union operation (04Marks- Dec 12)

6. a.What are useless productions? Remove all useless productions, unit productions and all - productions form the grammar: (10Marks- June-July 09)

b. Define CNF. Convert the following CFG to CNF.

(10MJune-July 09)

7. a.Remove useless symbols from following grammar S aA |B A aB | B B aB | b | bC D Ea E a/aE | bc (06 Marks June/ July 11)

b. Define CNF and GNF. Convert the following grammar to CNF S A S B | B S b S | A | bb A aAs | a. (08 Marks June/ July 11)

c. Prove that if L is CFL and R is a regular language then L R is a CFL. (06 Marks June/ July 11)8. a.What are useless symbols? Eliminate unit and useless productions form the following

grammar: S Aa A | CA | BaB A aaBa | CDA | aa | DC B bB | bAB | bb | aS

Page 17: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 71

C→Ca | bC | D D→bD | ∈ (10 Marks May/June 10)

b. What is CNF and GNF? Obtain the following grammar in CNF: S→aBa | abba A→ab | AA B→aB | a (10 Marks May/June 10)

9. a.Consider the grammer S→ASB/∈ A→aAS/a B→sbs/bb

a) Eliminate useless symbolsb) Eliminate ∈- productionsc) Eliminate unit productionsd) Put the grammar into CNF (10 Marks June 12)

b. If 1 and 2 are CFL, then prove that family of context free languages are closed under union and concombination. (10 Marks June 12)

UNIT-7

INTRODUCTION TO TURING MACHINE

1. a. Define turing machine, Explain with a diagram, general structure of multitape turing machine. (06Marks-Dec 10)

b. Design a turing machine to accept the language L = {0n1n |n ≥ 1}. Write its transition diagram and give instantaneous description for the input 0011. (14M-Dec 10)

2. a.Define Turing machine. Explain how the Turing Machine would be designed to simulate a Computer. (08Marks-Dec 11)

b. Design a Turing machine to accept the set of all palindromes over {0,1}*. Also, indicate the moves made by Turing machine for the string: 1001. (12Marks-Dec 11)

3. a.Explain with neat diagram the working of a turning machine model (06Marks-Dec 08/Jan09)

b. Design a Turing Machine to accept all set of palindromes over {0,1}*. Also write itstransition diagram and instantaneous description on the string “10101”

(14Marks-Dec 08/Jan09)4. a.With a neat diagram, explain the working of a basic turing machine. Design a turing

machine to accept L= {wwR | w (a+b)*} (12Marks- Dec. 09/ Jan. 10)

b. Explain the general structure of multi tape and non deterministic turing machines and show that these are equivalent to basic turing machine. (08Marks- Dec. 09/ Jan. 10)

Page 18: FORMAL LANGUAGES AND AUTOMATA THEORY PART A UNIT-1

Formal Languages and Automata Theory Question Bank

Dept. of CSE, DSATM 2013-2014 Page 72

5. a. Define turing machine and multitape turing machine. Show that the language accepted by these Machines are same. (08Marks Dec 12, 08M- June-July 09, 10 Marks June 12)

b. Design a turing machine to accept the language L={ an bn cn/ n≥1}. Given the graphical representation for the TM obtained (12Marks- Dec 12)

6. b. Design a Turing Machine for the language to accept the set of strings with equal number of 0’s and 1’s and also give the instantaneous description for the input 110100. (12M- June-July 09)

7. a.Define Turing Machine and instantaneous Descriptions (ID) for Turing machine. (04 Makes June/ July 11)

b. Design a Turing machine to add 2 numbers consider input=0m1 0n and out= 0m+n

write transition diagram and ID for string W=00/0000. (12 Marks June/ July 11)

c. Write a note on multitape and non-deterministic Turing machines. (04 Marks June/ July 11)

8. a.Prove that the context free languages are closed under union, concatenation and reversal. (10 Marks May/June 10) b. Design a turning machine that performs the following function: 0 | ∗ ww for any w ∈ {1}* (10 Marks May/June 10)

9. b. Design Turing machine to accept the language consisting of all palindromes or O’s and 1’s. (10 Marks June 12 )

UNIT-8

UNDECIDABILITY

Short Notes on

1. Post’s correspondence problem (05Marks-Dec

10, Dec 08/Jan09, Dec 2012, June-July 2009, May/June 2010, June 2012)

2. Universal machine (05Marks-Dec 10,Dec11,

Dec 08/Jan09)

3. Recursive languages and Halting problem of TM (05Marks-Dec11,Dec.

09/ Jan. 10, June-July 2009, June/ July 2011)

4. Undecidability of ambiguity for CFG’s (04Marks- June/ July 2011)

5. Language that is not recursively enumerable. (05Marks- June 2012)