2360.pdf

8
Code No: R05310501  R05 Set No. 2 III B.Tech I Semester Examinations,MAY 2011 FORMAL LANGUAGES AND AUTOMATA THEORY Computer Science And Engineering Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks 1. (a) Explai n the terms: Cho msk y normal form an d Grei bach Normal for m (b) Con ve rt to Chomsky normal form the follo wing grammar: G = (N, T, P, S) where N = {S, A, B} T = {a, b} P = {S aB S   bA A  aS A b A A A  a B → a B B B → b}  [8+8] 2. (a) Design a DF A for t he languag e L =  {ba n /n ≥  0}. (b) Design DF A over { a,b}  to accept strings which does not contains two consec- utive b’s. [8+8] 3. (a) Descri be Chomsky hierarchy of la ngua ges. (b) Explain post Correspondence Problem. [8+8] 4. (a) Dene a Tu ring ma chine mathematic all y . Dene the term ‘move’ in a TM. (b) Design a TM that rec ogni zes the set {0 2n 1 n |n = 0 }. [16] 5. (a) S → aS |bS| a |b Generate the regular expression for the above CFG Give automata for the above grammar and write what is the language accepted by the above automata? Is both the deriv ed automata and the giv en CFG generates same language. (b) S → aSbS |bSaS| What is the language generated by the abo ve grammar? [2 ×8] 6. Is Arden’s lemma is applicable to an NFA consisting with -moves? If not? Then why? Explain. [16] 7. (a) Design a Moore Machine to determin e the residue mod 4 for e ach binary string treated as integer. 1

Transcript of 2360.pdf

Page 1: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 1/8

Page 2: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 2/8

Code No: R05310501   R05 Set No. 2

(b) Design a Mealy machine that uses its state to remember the last symbol readand emits output   ‘y’  whenever current input matches to previous one, andemits n otherwise. [8+8]

8. Find the PDA that accepts the following languageL = {x ∈ {a, b}∗ : |x|a  = 2|x|b} via empty stack. Also find the PDA via final state.

[16]

2

Page 3: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 3/8

Code No: R05310501   R05 Set No. 4

III B.Tech I Semester Examinations,MAY 2011

FORMAL LANGUAGES AND AUTOMATA THEORY

Computer Science And Engineering

Time: 3 hours Max Marks: 80

Answer any FIVE Questions

All Questions carry equal marks

1. (a) Describe Chomsky hierarchy of languages.

(b) Explain post Correspondence Problem. [8+8]

2. (a) Design a Moore Machine to determine the residue mod 4 for each binary stringtreated as integer.

(b) Design a Mealy machine that uses its state to remember the last symbol readand emits output   ‘y’  whenever current input matches to previous one, andemits n otherwise. [8+8]

3. (a) S →  aS |bS| a |bGenerate the regular expression for the above CFGGive automata for the above grammar and write what is the language acceptedby the above automata? Is both the derived automata and the given CFGgenerates same language.

(b) S →  aSbS |bSaS| ∈What is the language generated by the above grammar? [2×8]

4. (a) Define a Turing machine mathematically. Define the term ‘move’ in a TM.

(b) Design a TM that recognizes the set{02n1n ≥ |n = 0 }. [16]

5. Find the PDA that accepts the following languageL = {x ∈ {a, b}∗ : |x|a  = 2|x|b} via empty stack. Also find the PDA via final state.

[16]

6. (a) Design a DFA for the language L = {ban/n ≥  0}.

(b) Design DFA over {a,b} to accept strings which does not contains two consec-utive b’s. [8+8]

7. Is Arden’s lemma is applicable to an NFA consisting with  ∈-moves? If not? Thenwhy? Explain. [16]

8. (a) Explain the terms: Chomsky normal form and Greibach Normal form

(b) Convert to Chomsky normal form the following grammar: G = (N, T, P, S)

whereN = {S, A, B}T =  {a, b}P = → {S→ aB

3

Page 4: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 4/8

Code No: R05310501   R05 Set No. 4

S →  bAA → aSA →b A AA → aB → a B BB → b}   [8+8]

4

Page 5: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 5/8

Code No: R05310501   R05 Set No. 1

III B.Tech I Semester Examinations,MAY 2011

FORMAL LANGUAGES AND AUTOMATA THEORY

Computer Science And Engineering

Time: 3 hours Max Marks: 80

Answer any FIVE Questions

All Questions carry equal marks

1. (a) S →  aS |bS| a |bGenerate the regular expression for the above CFGGive automata for the above grammar and write what is the language accepted

by the above automata? Is both the derived automata and the given CFGgenerates same language.

(b) S →  aSbS |bSaS| ∈What is the language generated by the above grammar? [2×8]

2. Is Arden’s lemma is applicable to an NFA consisting with  ∈-moves? If not? Thenwhy? Explain. [16]

3. (a) Explain the terms: Chomsky normal form and Greibach Normal form

(b) Convert to Chomsky normal form the following grammar: G = (N, T, P, S)whereN = {S, A, B}T =  {a, b}P = → {S→ aB

S →  bAA → aSA →b A AA → aB → a B BB → b}   [8+8]

4. (a) Design a Moore Machine to determine the residue mod 4 for each binary stringtreated as integer.

(b) Design a Mealy machine that uses its state to remember the last symbol readand emits output   ‘y’  whenever current input matches to previous one, andemits n otherwise. [8+8]

5. (a) Describe Chomsky hierarchy of languages.

(b) Explain post Correspondence Problem. [8+8]

6. Find the PDA that accepts the following language

L = {x ∈ {a, b}∗

: |x|a  = 2|x|b} via empty stack. Also find the PDA via final state.[16]

7. (a) Define a Turing machine mathematically. Define the term ‘move’ in a TM.

5

Page 6: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 6/8

Code No: R05310501   R05 Set No. 1

(b) Design a TM that recognizes the set{02n1n ≥ |n = 0 }. [16]

8. (a) Design a DFA for the language L = {ban/n ≥  0}.

(b) Design DFA over {a,b} to accept strings which does not contains two consec-utive b’s. [8+8]

6

Page 7: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 7/8

Code No: R05310501   R05 Set No. 3

III B.Tech I Semester Examinations,MAY 2011

FORMAL LANGUAGES AND AUTOMATA THEORY

Computer Science And Engineering

Time: 3 hours Max Marks: 80

Answer any FIVE Questions

All Questions carry equal marks

1. (a) Define a Turing machine mathematically. Define the term ‘move’ in a TM.

(b) Design a TM that recognizes the set{02n1n ≥ |n = 0 }. [16]

2. (a) Describe Chomsky hierarchy of languages.

(b) Explain post Correspondence Problem. [8+8]

3. (a) S →  aS |bS| a |bGenerate the regular expression for the above CFGGive automata for the above grammar and write what is the language acceptedby the above automata? Is both the derived automata and the given CFGgenerates same language.

(b) S →  aSbS |bSaS| ∈

What is the language generated by the above grammar? [2×8]

4. (a) Explain the terms: Chomsky normal form and Greibach Normal form

(b) Convert to Chomsky normal form the following grammar: G = (N, T, P, S)whereN = {S, A, B}T =  {a, b}P = → {S→ aB

S →  bAA → aSA →b A AA → aB → a B BB → b}   [8+8]

5. Find the PDA that accepts the following languageL = {x ∈ {a, b}∗ : |x|a  = 2|x|b} via empty stack. Also find the PDA via final state.

[16]

6. (a) Design a DFA for the language L = {ban/n ≥  0}.

(b) Design DFA over {a,b} to accept strings which does not contains two consec-

utive b’s. [8+8]

7. Is Arden’s lemma is applicable to an NFA consisting with  ∈-moves? If not? Thenwhy? Explain. [16]

7

Page 8: 2360.pdf

8/14/2019 2360.pdf

http://slidepdf.com/reader/full/2360pdf 8/8

Code No: R05310501   R05 Set No. 3

8. (a) Design a Moore Machine to determine the residue mod 4 for each binary stringtreated as integer.

(b) Design a Mealy machine that uses its state to remember the last symbol readand emits output   ‘y’  whenever current input matches to previous one, andemits n otherwise. [8+8]

8