4RCS04 (1) - Merged
4RCS04 (1) - Merged
Supplementary Semester B.E. Computer Sc. and Engg. Examinations Sept. – Oct. 2023
Theory of Computation
Time: 3 Hours Max. Marks: 100
Note : 1. Revealing of Identity in any form in the answer book will be treated as malpractice.
2. Answer any five questions choosing one full question from each unit.
Unit - I M BL CO PO PSO
10
OR
02 a) Define the following terms giving examples.
i) Alphabet ii) Language iii) Power of an alphabet iv) Empty string. 4
b) Let 𝐷 = (𝑄𝐷 , Σ, 𝛿𝐷 , 𝑞0 , 𝐹𝐷 ) is the DFA constructed from NFA
𝑁 = (𝑄𝑁 , Σ, 𝛿𝑁 , 𝑞0 , 𝐹𝑁 ) by the subset construction, then prove that L(D)=L(N). 10
c) An NFA with 5 states and input alphabet = {a, b} has the following transition
table.
Q 𝛿(𝑞, 𝑎) 𝛿(𝑞, 𝑏)
1 {1, 2} {1}
2 {3} {3}
3 {4} {4}
4 {5} {}
* 5 {} {5}
i) Draw transition diagram. ii) Calculate 𝛿 (1, 𝑎𝑏) iii) Calculate 𝛿 ∗ (1, 𝑎𝑏 𝑎𝑏)
∗
6
Unit - II
03 a) Convert DFA to regular expression
8
b) Prove that every language defined by a regular expression is also defined by a
finite automata. 6
𝑛 𝑛+1
c) Prove that the language {𝑎 , 𝑏 , 𝑛 > 1} is not regular. 6
OR
04 a) Give the recursive definition of Regular expression. Write the regular expression
for the language of all strings of 0’s and 1’s such that the number of 0’s is odd. 6
b) Prove that of L=L(A) for some DFA A, then there is an equivalent regular
expression R such that L=L(R). 6
Supplementary / Grade Improvement Examinations B.E. Computer Sc. & Engg. Oct. 2021
Theory of Computation
Time: 3 Hours Max. Marks: 100
Note : Answer any five full questions from Q. No. 1 to Q. No. 10.
8
BL: 3 CO: 5 PO: 2,3 PSO: 1
8
BL: 3 CO: 2 PO: 2 PSO: 1
b) Design a NFA to accept set of strings of 0’s and 1’s with substring 00 or 11. And convert that
into equivalent DFA using Lazy method. 8
BL: 3 CO: 1 PO: 2,3 PSO: 1
03 a) Obtain the Regular Expression for the following automata using state elimination method.
8
BL: 3 CO: 3 PO: 2 PSO: 1
c) Define Chomsky Norm Form (CNF) and convert the following grammar into CNF.
S aACa
A a|B
BC|c
C cC | 6
BL: 4 CO: 3 PO: 2 PSO: 1
Contd…
-3- 4RCS04
c) Verify that the PDA to accept the language
L(M) = {w | w (a + b)*} and na(w) = nb(w) is deterministic. 4
BL: 3 CO: 5 PO: 2,3 PSO: 1
08 a) Design a Turing machine to accept strings of a’s and b’s ending with ab or ba. 8
BL: 3 CO: 5 PO: 2,3 PSO: 1
b) Design PDA to accept the language and show the graphical representation of the same.
L = {x3 yn zn | z 0} 8
BL: 3 CO: 5 PO: 2,3 PSO: 1
10 a) Discuss halting problem and post correspondence problem with respect to Turing machine. 10
BL: 6 CO: 4 PO: 2 PSO: 1
________
USN 1 S I 4RCS04
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)
Special Supplementary Semester B.E. Computer Sc. and Engg. Examinations Dec. 2023
Theory of Computation
Time: 3 Hours Max. Marks: 100
Note : 1. Revealing of Identity in any form in the answer book/graph sheet will be treated as malpractice.
2. Answer any five questions choosing one full question from each unit.
Unit - I M BL CO PO PSO
Unit - II
03 a) Prove that every language defined by a regular expression is also defined by a
finite automation. 8 3 2
b) Give the recursive definition of regular expression. Obtain regular expressions for
the following languages, where Σ={a,b,c}
i) L = {an bm cp | n ≤ 4, m ≥ 2, p ≤ 2} ii) L = { | || mod 3 = 0} 6 4 3
c)State pumping lemma for regular languages and show that L = { | t (0+1 } R *
is not regular 6 3 4
OR
04 a) With suitable example give the steps to minimize a DFA. 8 2 1
b) Discuss various applications of regular expressions. 6 2 1
c) Show that the following languages are not regular using concept of pumping
lemma.
i) L = {an bn} n>1} ii) Palindromes, where Σ = {a, b} 6 3 4
Unit - III
05 a) Define the following terms:
i) Context free grammar ii) Parse tree
iii) Yield of a parse tree iv) Left most derivation 8 2 1
Unit - IV
07 a) Design a PDA to accept the language L = {a n bm cn | n>1, 1 , m ≥ 1} by final state.
Give the instantaneous description for the string “aabcc”. 10 4 5
b) Design a Turing Machine for the Language L = {an bn | n ≥ 1}. Give the graphic
representation and show the moves made by the Turing machine for the string
“aabb” through instantaneous description. 10 4 5
OR
08 a) Describe the following.
i) The language of a Turing Machine ii) Turing machines and halting problems 8 2 1
b) Prove the if L = N(PN) for some PDA PN = (Q, Σ, Γ, N, qo, Zo) then there is a PDA
PF such that L = L(PF) 6 3 2
c) Define PDA. Define the languages accepted by PDA by final state and by empty
stack. 6 2 1
Unit - V
09 a) With a neat diagram explain the Chomsky hierarchy of languages. 8 2 4
b) Write a note on un-decidable problems for recursively enumerable languages. 6 2 4
c) Explain the post correspondence problem. 6 2 1
OR
10 a) Define :
i) Recursive language ii) Unrestricted grammars
iii) Context sensitive grammars iv) Recursively enumerable language 8 2 4
b) Prove that there exists no algorithm for deciding whether any given context free
grammar is ambiguous. 6 3 4
c) With a suitable example discuss about problems that cannot be solved by Turing
machines. 6 3 4
________
MOBILE PHONE
iSSN 1 SI PIOHBTED S4CCSIO2
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autoomeus Institution affiliated to \/TLRelagavi Appronved hy AlCTE New Delh)
Fig. lb 6 3 1
c) Design DFA to accept the 3
following languages:
i) L= {w|n,(w) = 2, n, (w) >= 3}
ii) L= (w||w|mod 5 0} on )= {a, b, c, d}}
8 3 3
OR
2 a) Convert the following
&-NFA to an equivalent DFA:
E -(Q, 2, 6, q0, F), Q={q0, q1, q2}, E{a, b, c},
q= q0,
S(q0.a) = q0, ô(q0,b) =0, ô(q0,c) = 0, 8(q0,[) = q!, F={q2},
Sql,a) = , ql,b) =ql, ql,c) = , öql,e) = q2,
S(q2,a) = 0, q2,b) =0, g2,c) = q2, ( q2,[) -.
6
b) Convert the following NFA into an 3 1 3
equivalent DFA:
Fig.2b 6 3 1
c) Design a DFAto accept the following languages: 3
Unit - II
*p
6 3 2 3
4 a) OR
Discuss the formal definition of regular expression
and list any two applications of
regular expressions.
b) 6 2 2
Obtain an [-NFA for the following regular 1
c) Define Chomsky normal form and convert the following grammar Chomsky
normal form.
S ’ aAla<B|C, A ’ aBl¬, B’ aA, C ’ cCD, D ’ abd 8 3 3 3
OR
6 a) Differentiate between sentence and sentential form. List the conditions that a tree
must satisfy to call it as aparse tree. 3
Contd.
c) For the
following grammar: -3 S4CCSI02
S ’ ABC\BbB,
A -’ aA|BaClaaa, B ’ bBblalD,
i) Eliminate e-productions C’ CalAC, D-’ *
ii) Eliminate
111) unitproductions
Elininate any useless
symbols in the resulting
7
gramimar. 3 3 3
a) Unit - IV
With an example, discuss
b)
Convert the PDA P={ deterministic and non-deterministic PDA. 4 2 4
graphical representation and sequence of accepted by final state. Also give its
"aaabbcccce". instantaneous description on the string
L= farHm c7+m : m>0, n > 0}
10 4 4 3
Unit - V
9 a) What is a Turing Machine? Discuss the formal
definition of a turing machine. 6 2
Design a Turing machine to accept the following language : 5 1 1
L= {0"1"| n> 1}
Also write its transition table and transition diagram.
10 4
c) Discuss the importance of multitape Turing machines. 3
4 2 1 1
OR
10 a) With a diagram, discuss the turing machine model. 6 2
Even Semester B.E. Information Science and Engg. Examinations July-Aug. 2024
Theory of Computation
Time: 3 Hours Max. Marks: 100
Note : 1. Revealing of Identity in any form in the answer book will be treated as malpractice.
2. Answer any five questions choosing one full question from each unit.
Unit - I M BL CO PO PSO
01 a) Define the terms alphabet, power of an alphabet, Language and empty string. Give
one example for each. 4 2 1 1 1
b) Let 𝐷 = (𝑄𝐷, ∑ , 𝛿𝐷, 𝑞0 , 𝐹𝐷, ) is the DFA constructed from NFA
𝑁 = (𝑄𝑁, ∑ , 𝛿𝑁, 𝑞0 , 𝐹𝑁, ) by the suset construction, then prove that L(D)=L(N). 10 2 2 2 1
c)Design DFA to accept decimal strings divisible by 3. 6 2 2 2 1
OR
02 a) Consider the following -NFA E:
𝐸 = (𝑄, , , 𝑞0 , 𝐹) where Q={p, q, r}, ={a, b, c}, q0= p, F={r}, is as follows:
(p, ) = , (p, a) = p, (p, b) =q, (p, c) = r, (q, )= p, (q, a) = q, (q, b)=r,
(q, c) = , (r, ) = q, (r, a) = r, (r, b) = , (r, c) = p.
i) Give all the strings of length three or less accepted by the automata.
ii) Convert the automata to DFA. 10 3 2 3 1
b) Differentiate the extended transition function of DFA and NFA. 4 2 1 1 1
c) Construct DFA which accepts strings of 0’s and 1’s starting with even number of
1’s followed by 0’s which are multiples of 3. 6 3 2 2 1
Unit - II
03 a) Define regular expression. Write regular language for the following Languages.
i) L={𝑎𝑛 𝑏 𝑚 ∶ (𝑚 + 𝑛) is even }
ii) L={{𝑎𝑛 𝑏 𝑚 ∶ 𝑚 >= 1, 𝑛 > = 2, 𝑛𝑚 >= 3} 7 3 2 2 1
b) State and prove the pumping lemma of a regular language and Prove that the
language L={𝑎𝑛 𝑏 𝑛+1 𝑛 > 1} not regular. 8 2 2 1 1
c) Write regular expression for the following grammar:
𝑆 → 𝐴𝑎𝑏 | 𝐵𝑏𝑎 𝐴 → 𝑎𝐴 | 𝐵𝐴| 𝐵 → 𝑏𝐵 | 𝑎𝐵| 5 3 2 2 1
OR
04 a) Consider the following DFA D:
𝐷 = (𝑄, , , 𝑞0 , 𝐹) where Q={q1, q2, q3}, ={0,1}, q0=q1, F={q3}, is as
follows:
(q1, 0) = q2, (q1, 1) = q1, (q2, 0) = q3, (q2, 1) =q1, (q3, 0) = q3, (q3, 1) = q2.
(3)
Find the regular expression 𝑅13 and minimize the expression as much as possible.
8 3 2 2 1
b) Prove that for every language defined by a regular expression, there exists a Finite
Automata for it. 6 2 2 1 1
c) Prove that if R is a regular expression, then there exists a finite automata
M=(Q, , , 𝑞0 , F) which accepts L(R). 6 2 2 1 1
Unit - IV
07 a) Define a PDA. Design a PDA to accept the following language by final state.
L={w : w {a, b}* and 𝑛𝑎 (𝑤) ≠ 𝑛𝑏 (𝑤)} 10 4 5 3 1
𝑛 𝑚 𝑛
b)Design a PDA to accept the language L={𝑎 𝑐 𝑏 |𝑛 ≥ 1, 𝑚 ≥ 1} by final state.
Also give its graphical representation and instantaneous descriptions for the string
“aacccbb”. 10 4 5 3 1
OR
08 a) Give the formal definition of Pushdown Automata (PDA). Construct a PDA to
accept the language 𝐿 = {𝑎𝑛 𝑏 2𝑛 |𝑛 ≥ 1} 10 3 4 1 1
𝑛 𝑛
b) Design a Turing Machine that accepts the Language L={𝑎 𝑏 |𝑛 ≥ 1, }. Give the
graphical representation for the Turing Machine obtained and also show the moves
made by the Turing machine for the string aabb. 10 4 5 3 1
Unit - V
09 a) Explain Chomsky hierarchy method with your own example. 6 2 4 1 1
b) What is Context –Sensitive Grammars? Explain how context sensitive grammars
are different from CFG. 8 2 4 1 1
c)Explain the difficulties arise when we allowed the empty string as the left side of a
production in an unrestricted grammar. 6 2 1 1 1
OR
10 a) Difference between PDA and TM. 6 2 3 1 1
b) Describe the Context- Sensitive Grammars and unrestricted grammar with an
example. 6 2 3 1 1
𝑛 𝑛 𝑛
c) Design a TM for the Language L={{𝑎 𝑏 𝑐 |𝑛 ≥ 1}. 8 3 5 3 1
_______
USN 1 S I S4CCSI02
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)
Unit - I M BL CO PO PSO
01 a) Design DFA to accept even number of a’s and odd number of b’s. 6 3 1 3
b) Convert the following NFA to DFA.
A=({ p, q, r}, {0, 1}, , p, r) is given as follows:-
(p,0)={p,q} (p,1)={p}
(q,0) = (q,1)={r}
(r,0) = (r,1) = 10 3 1 3
c) Give the formal definition of -NFA. 4 1 1 1
OR
02 a) Design DFA to accept the following languages.
(i) L(M)={w / |w| mod 5 0, ={a}}
(ii) L(M)={w (ab+ba)/w € (a+b)*} 6 3 1 3
b) Write the procedure to convert the -NFA to DFA by subset construction method
and convert the following -NFA to DFA.
10 3 4 3
c) Give the formal definition of DFA. 4 1 1 1
Unit - II
03 a) Prove that there exists a finite automata to accept the language L(R) corresponding
to the regular expression R. 6 4 2 3
b)Define regular expression. Obtain a regular expression for
(i) L={VUV |U, V {a,b}* and |V|=2}
(ii) The set of strings of 0’s and 1’s beginning and ending with the same
symbol.
(iii) The set of strings of a’s and b’s ending with b and has no substring aa.
(iv) The set of strings of 0’s and 1’s having no two consecutive 0’s. 10 3 5 3
c) Write table filling algorithm. 4 2 2 3
OR
04 a) Convert the following DFA to a Regular Expression by State Elimination
Technique.
0 1
*p s p
q p s
r r q
s q r 6 4 2 3
Unit - III
05 a) Give the formal definition of CFG. Obtain a grammar to generate the language.
L = {wcwR / w € (a+b)*} 8 3 3 3
b) What are useful and useless symbols in a CFG? Remove useless symbols from the
following CFG.
SaAa |aB, AaS |bD, BaBa | b, Cabb |DD, DaDa 6 4 3 3
c) Show that the following grammar is ambiguous?
SaB | bA AaS|bAA|a B bS | aBB |b 6 4 3 2
OR
06 a) For the following grammar:
S ABC | BbB, A aA |BaC|aaa, B bBb |a|D, CCA|AC, D .
(i) Eliminate -productions (ii) Eliminate any unit productions in the resulting
grammar. (iii) Eliminate any useless symbols in the resulting grammar.
(iv) Put the resulting grammar in Chomsky Normal Form. 8 4 3 3
b) Consider the following productions of grammar G.
SaB |bA, Aa |aS|bAA Bb | bs | aBB
For the string aaabbabbba
Find (i) Leftmost Derivation (ii) Rightmost Derivation. 6 3 3 3
c) Obtain the grammar to generate:
(i) Strings of a’s and b’s having the substring ab (ii) L={anb2n |n>=0}
(iii) L={0n+1 1n | n>=0} 6 3 3 3
Unit - IV
07 a) Design PDA for the following language accepted by final state.
L={an bn+m cm : n=0, m 1} 8 3 4 3
b) Give the formal definition of PDA and define the following
(i) Instantaneous description of PDA. (ii) Acceptance of a language by PDA. 6 4 4 1
c) Is the PDA corresponding to the language L={a b | n>=1} by a final state is
n n
deterministic? 6 3 4 2
OR
08 a) Design PDA for the following language accepted by final state. Also write its
transition diagram and instantaneous description on the string “aacccbb”.
L ={ an cm bn : m1,n1} 10 3 4 3
Contd….
-3- S4CCSI02
b) Give the formal definition of DPDA. Is the PDA corresponding to the language
L={w |w €(a+b)* and na (w) =nb(w)} is deterministic? 10 3 4 2
Unit - V
09 a) Define a Turing Machine. With a neat diagram explain the working of a Turing
Machine. 6 3 5 1
b) Design a Turing Machine that accepts the language L={0 1 | n 1}. Give the
n n
graphical representation for the Turing Machine obtained and also show the moves
made by the Turing machine for the string 000111. 10 3 5 3
c) Write a note on Multitape Turing Machine. 4 4 5 2
OR
10 a) Obtain a Turing Machine to accept the language containing strings of 0’s and 1’s
ending with 011. 6 3 5 3
b) Obtain a Turing machine to accept the language L={w |w is even and {a, b}.
Show the moves made by the Turing machine for the string 0101. 10 4 5 3
c) Define the following :
- ID of a Turing machine
- Language accepted by a TM 4 2 5 2
________
USN 1 S I S4CCSI02
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)
Unit - I M BL CO PO PSO
01 a) Design DFA to accept even number of a’s and odd number of b’s. 6 3 1 3
b) Convert the following NFA to DFA.
A=({ p, q, r}, {0, 1}, , p, r) is given as follows:-
(p,0)={p,q} (p,1)={p}
(q,0) = (q,1)={r}
(r,0) = (r,1) = 10 3 1 3
c) Give the formal definition of -NFA. 4 1 1 1
OR
02 a) Design DFA to accept the following languages.
(i) L(M)={w / |w| mod 5 0, ={a}}
(ii) L(M)={w (ab+ba)/w € (a+b)*} 6 3 1 3
b) Write the procedure to convert the -NFA to DFA by subset construction method
and convert the following -NFA to DFA.
10 3 4 3
c) Give the formal definition of DFA. 4 1 1 1
Unit - II
03 a) Prove that there exists a finite automata to accept the language L(R) corresponding
to the regular expression R. 6 4 2 3
b)Define regular expression. Obtain a regular expression for
(i) L={VUV |U, V {a,b}* and |V|=2}
(ii) The set of strings of 0’s and 1’s beginning and ending with the same
symbol.
(iii) The set of strings of a’s and b’s ending with b and has no substring aa.
(iv) The set of strings of 0’s and 1’s having no two consecutive 0’s. 10 3 5 3
c) Write table filling algorithm. 4 2 2 3
OR
04 a) Convert the following DFA to a Regular Expression by State Elimination
Technique.
0 1
*p s p
q p s
r r q
s q r 6 4 2 3
Unit - III
05 a) Give the formal definition of CFG. Obtain a grammar to generate the language.
L = {wcwR / w € (a+b)*} 8 3 3 3
b) What are useful and useless symbols in a CFG? Remove useless symbols from the
following CFG.
SaAa |aB, AaS |bD, BaBa | b, Cabb |DD, DaDa 6 4 3 3
c) Show that the following grammar is ambiguous?
SaB | bA AaS|bAA|a B bS | aBB |b 6 4 3 2
OR
06 a) For the following grammar:
S ABC | BbB, A aA |BaC|aaa, B bBb |a|D, CCA|AC, D .
(i) Eliminate -productions (ii) Eliminate any unit productions in the resulting
grammar. (iii) Eliminate any useless symbols in the resulting grammar.
(iv) Put the resulting grammar in Chomsky Normal Form. 8 4 3 3
b) Consider the following productions of grammar G.
SaB |bA, Aa |aS|bAA Bb | bs | aBB
For the string aaabbabbba
Find (i) Leftmost Derivation (ii) Rightmost Derivation. 6 3 3 3
c) Obtain the grammar to generate:
(i) Strings of a’s and b’s having the substring ab (ii) L={anb2n |n>=0}
(iii) L={0n+1 1n | n>=0} 6 3 3 3
Unit - IV
07 a) Design PDA for the following language accepted by final state.
L={an bn+m cm : n=0, m 1} 8 3 4 3
b) Give the formal definition of PDA and define the following
(i) Instantaneous description of PDA. (ii) Acceptance of a language by PDA. 6 4 4 1
c) Is the PDA corresponding to the language L={a b | n>=1} by a final state is
n n
deterministic? 6 3 4 2
OR
08 a) Design PDA for the following language accepted by final state. Also write its
transition diagram and instantaneous description on the string “aacccbb”.
L ={ an cm bn : m1,n1} 10 3 4 3
Contd….
-3- S4CCSI02
b) Give the formal definition of DPDA. Is the PDA corresponding to the language
L={w |w €(a+b)* and na (w) =nb(w)} is deterministic? 10 3 4 2
Unit - V
09 a) Define a Turing Machine. With a neat diagram explain the working of a Turing
Machine. 6 3 5 1
b) Design a Turing Machine that accepts the language L={0 1 | n 1}. Give the
n n
graphical representation for the Turing Machine obtained and also show the moves
made by the Turing machine for the string 000111. 10 3 5 3
c) Write a note on Multitape Turing Machine. 4 4 5 2
OR
10 a) Obtain a Turing Machine to accept the language containing strings of 0’s and 1’s
ending with 011. 6 3 5 3
b) Obtain a Turing machine to accept the language L={w |w is even and {a, b}.
Show the moves made by the Turing machine for the string 0101. 10 4 5 3
c) Define the following :
- ID of a Turing machine
- Language accepted by a TM 4 2 5 2
________
USN 1 S I S4CCSI02
Siddaganga Institute of Technology, Tumakuru-572 103
(An Autonomous Institution affiliated to VTU, Belagavi, Approved by AICTE, New Delhi)
Unit - I M BL CO PO PSO
OR
02 a) Mention the differences between DFA, NFA and -NFA. 6 2 1 1 1
b) Obtain a DFA to accept the language � = {�|��(� + �) ; |�| mod 3 = 0 } ∗
6 3 1 3 1
c) Convert the following -NFA to equivalent DFA:
a b c
p {q,r} ∅ {q} {r}
Q ∅ {p} {r} {p,q}
*r ∅ ∅ ∅ ∅ 8 3 1 3 1
Unit - II
03 a) Define regular expression. Write the regular expression for the following
languages:
(i) Strings of a’s and b’s having odd length.
(ii) Strings of a’s and b’s with at most one pair of consecutive a’s
(iii) L={anbm : m 2, n 2}. 8 2 2 3 1
b) Build a regular expression for the shown in Fig.3b, finite automata using state
elimination method:
Fig. 3b 6 3 2 3 1
c) Convert the following Regular expressions to -NFA:
(i) (0+1)* 1(0+1) (ii) 00(0+1)* 6 2 2 3 1
OR
04 a) Minimize the following DFA by identifying distinguishable and Non-
distinguishable states:
0 1
A B F
B G C
*C A C
D C G
E H F
F C G
G G F
H G C 10 3 2 3 1
Unit - III
05 a) Define Context Free Grammar(CFG). Write CFG for the following language:
L={0m 1m 2n : m 1, n 0} 5 2 3 2 1
b) When the language is said to be inherently ambiguous? Show that the following
grammar is ambiguous:
S AB | aaB Aa |Aa B b 7 2 3 2 1
c) Simplify the following grammar:
S AB |AC Aa Ab | BbA c b Ca DAB 8 3 3 3 1
OR
06 a) Design a CFG for the following languages:
(i) L={an bm ck | n+2m =k for m0 and n0}
(ii) L={w wR | w (a,b)* and wR is the reverse of w}
(iii) L={an bn | n m}
(iv) L ={an b2n over = {a,b}, n1} 10 2 3 3 1
b) Define Chomsky Normal Form(CNF). Convert the following CFG into CNF:
S A SB | Aa AS|a BSbS |A|bb 10 3 3 3 1
Unit - IV
07 a) Define Put Down Automata (PDA). Design PDA to accept the language by final
state method: L(m) ={wcwR| w (a,b)* and wR is reverse of w}. Draw generated
transition diagram. 10 3 4 3 1
b) Write the procedure to convert CFG to PDA. Convert the following CFG to PDA:
S aAA Aas |bs|a 10 2 4 1 1
OR
08 a) Design PDA’s to accept each of the following languages:
(i) { 0n |n : n 1} (ii) The set of all strings of 0’s and 1’s with an equal
number of 0’s and 1’s. 10 3 4 3 1
b) Convert the following PDA to CFG:
(q0,a ,Z) = (q0, A,Z), (q0,a ,A) = (q0, A), (q0,b ,A) = (q0,),
(q1, ,Z) = (q2,) 6 3 4 3 1
c) Differentiate between deterministic PDA and non-deterministic PDA. 4 2 4 2 1
Unit - V
09 a) Design a Turing Machine™ to accept strings formed on {0,1} and ending with
000. Write transition diagram on ID for w=101000. 12 3 5 3 1
b) Write a note on restricted Turing machines. 8 1 5 1 1
OR
10 a) Define Turing machine with its tuples. 4 1 5 2 1
b) Write a note on multitape TM. 6 1 5 1 1
c) Construct a TM that accept the language 0 1 , where n>1 and draw transition
n n
________