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

TAFL

Uploaded by

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

TAFL

Uploaded by

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

ABES Engineering College, Ghaziabad

B. Tech Even Semester Important Questions

Session: 2023-24
Semester: IV
Course Code: BCS-402
Course Name: TAFL

Q. No. Question Year Marks COs

UNIT-I
Giv DFA accepting the following language over ∑= {0,1} 2021 CO1
i) Number of 1’s is multiple of 3.
1 ii) Number of 1’s is not multiple of 3. 10
iii) Containing either substring ‘000’ or ‘111’
iv) All the strings that end with 11 and contain 101 as substring.

Design a DFA which accepts the set of strings over alphabet Σ = { 1, 2, 3, 2022 10 CO1
2 4 } such that string when interpreted as decimal numbers, sum of their
digits are divisible by 5.

Determine an NFA accepting all strings over {0,1} which end with 1 but 2021 10 CO1
3 does not contain the substring 00. Also calculate equivalent DFA.
Design the DFA that accepts an even number of a’s and even number 10 CO1
4 of b’s.
Minimize the automata given below 2022 10 CO1

Compute the epsilon- closure for the given NFA. Convert it into DFA 2021 10 CO1

7 Construct a minimum state automation equivalent to the following 10 CO1


transition diagram
10 CO1
i)Design a moore machine to generate 1’s complement of given binary
number
ii)Design a mealy machine to generate 1’s complement of given binary
number.
8 iii)Design a moore and mealy machine for a binary input sequence such
that if it has a substring “101” the machine outputs ‘A’ if input has
substring “110” it outputs ‘B’ otherwise it outputs ‘C’

UNIT-II
Write the regular expression for the following languages: (2010-11) 2021 10 CO2
i) The set of all strings of 0’s and 1’s which ends with 1 and
does not contain substring 00.
ii) The set of all strings of 0’s and 1’s with an equal number
of 0’s and 1’s such that no prefix has two more 0’s than
1’s nor two more 1’s than 0’s.
iii) The set of all strings of 0’s and 1’s in which every 0 is
followed by 11
1 iv) The set of all strings of 0’s and 1’s in which the number
of 0’s is even
v) Set of strings of 0’s and 1’s whose 5’th symbol from the
left end is 1
vi) The set of string {a, b, c} containing at least one a and at
least one b
vii) L = { anbm : n>=4 and m <=3 }
viii) L = { w: |w| mod 3 = 0}, w Є (a,b)*

i) Obtain the NFA without epsilon transition corresponding to the 2021 10 CO2
following regular expression:
2
( 0* + 1*)*11(1*0*)* ,
00( 0* + 1*)*11
ii) Construct Є-NFA for regular expression (a + b)*ab*
Let r1 and r2 be two regular expressions defined as follows: 2021 10 CO2
r1 = (00*1)*1
3 and r2 = 1 + 0(0 + 10)*11
Prove that r1 = r2
Find all the regular expressions Rij(2) for the following DFA 2021 10 CO2
(2012-13)

State/Input a b
(Transition)
4 q0 q1 q0

q1 q1 q2

*q2 q2 q1

5 show that (PQ)*P = P(QP)* 10 CO2


Determine the regular expression accepted by the following FA 10 CO2

i) Using Arden’s theorem


a)

b)

ii) Using Iterative Method

7 i.) Use the pumping lemma to show that following language is 2022 10 CO2
not regular:
L = {ap | p is prime number} is not regular.
ii).Define Pumping Lemma for Regular Languages. Prove that the
language L = {0n 1n | n>=1} is not regular.
Explain closure and decision properties of regular languages with 10 CO2
8 suitable examples.

UNIT-III
Simplify the following grammar by eliminating useless symbols and 2021 10 CO3
useless production:
S  a| aA | B | C |
1 A  aB | Є, B Aa, C cCD, D  dd
Also find the Chomsky Normal form of the simplified
grammar

i)Convert the following grammar into GNF : 2022 10 CO3


S AB
A  BS | b
B  SA | a
2
ii)Convert the following grammar in Greibach normal form :
S  ASB | SS | AB
Al
Bl
i)Show that the CFG with productions 2022 10 CO3
S  a | Sa | bSS | SSb | SbS
is ambiguous.
ii)Show that the given grammar is ambiguous. Also find an equivalent
3 unambiguous grammar.
S  ABA
A aA | Є
B  bB | Є

Construct the following CFG G with start symbol S, which generate the 2022 10 CO3
set of arithmetic expressions:
SS+S|S*S|S^S|a
Given that the precedence of operator in decreasing order is ^,
4 *, +. The operator +, * are left associative while ^ is right
associative:
a)Show that given grammar is ambiguous
b)Write the equivalent unambiguous CFG G’ which generate the same
language.
5 Explain in detail about closure and decision properties of context free 10 CO3
languages
Give the complete hierarchy of grammar with their recognizers as well 2021 10 CO3
6
as the form of production rules( Chomsky Classification).
Write the context free grammar for the language L defined as follows 2021 10 CO3
7
L = { aibjck | i = j or j = k; i, j, k are positive integers }
A context free grammar G is given by the following productions: E→E+E| 2023 10 CO3
E-E|E∗E|E^E|N N→0|1|2|3|4|5|6|7|8|9 Determine whether the
8
grammar G is ambiguous or not.If ambiguous then construct an
unambiguous grammar equivalent to G.

UNIT IV
i) Construct a PDA that accepts the language L over {a, b, c} defined as 10 CO4
follows:
L = { am bn cp | p=m+n; m, n, p >0 }

ii) Construct a PDA for the context free grammar ( {S, A, B}, {a, b}, P, S)
where productions P are as follows:

1 S  aABB| aAA
A  aBB | a
B  bBB | A

iii) Convert the Grammar G : S SAB | SA | SB | C


A  aAa | Bb | a
B  BS | b
to a PDA that accept the language by empty stack.
i)) Define a Push Down Automation (PDA) and also differentiate CO4
between DPDA and NDPDA with suitable example. Convert the
following Grammar G :
S  aABB| aAA
A  aBB | a
2 B  bBB | A 10
to a PDA A that accept the language by empty stack. Test
whether a2ba4ba2 is in N(A).
ii)Convert the following grammar to a PDA that accepts the same
language
S  OSI | A
A  IAO | S | Є
i)Consider the PDA M = ({q0, q1, q2 }, {a, b}, {A, Z0}, δ, q0, Z0, Ф ) 2011 10 CO4
where δ is given as follows:

δ (q0, a, Z0 ) = { (q0, AZ0) }


δ (q0, a, A ) = { (q0, AA) }
δ (q0, b, A ) = { (q1, A) }
δ (q1, a, A ) = { (q1, Є) }
δ (q0, Є, Z0 ) = { (q2, Є) }
ii)Obtain the context free grammar that generates the same language
which is accepted by PDA M.
3 Generate CFG for the given PDA M is defined as 2023
M = ({q0, q1}, {0,1} {x, z0}, δ, q0, z0, q1) where δ is given as
follows: δ (q0,1, z0) =
(q0, xz0)
δ (q0,1, x) = (q0, xx)
δ (q0,0, x) = (q0, x)
δ (q0, ε, x) = (q1, ε)
δ (q1, ε, x) = (q1, ε)
δ (q1,0, x) = (q1, xx)
δ (q1,0, z0) = ( q1, ε)

i) Define a Push Down Automation (PDA). Construct a PDA 2022 10 CO4


accepting the language of palindromes.
4
ii) Design a PDA that accepts the set of all strings over {0, 1}* with
equal number of 0’s and 1’s by empty stack
Construct a PDA by empty stack which accepts the following: 2022 10 CO4
5 L= { am bm cn | m, n >=1 }
Also convert this PDA to equivalent CFG
6 Define two stack PDA and construct a two stack PDA for recognizing 2022 10 CO4
the following : i) L= { an bn cn | n >=1 } & ii)L= { an bn cn dn | n >=1 }
Design a PDA for Palindromes (ODD and EVEN). Also, design PDA for 10 CO4
7
wcwr. Differentiate between NPDA and DPDA
Design a PDA for a)an b2n b) a2n bn c) a2nccc bn 10 CO4
8 m n m n
d)a b such that m>n e)a b such that m<n
Use pumping lemma to prove that the following is not CFL 10 CO4
9
{ an bm an bn+m | m, n >=0 }
10. Discuss about the closure and decision properties of CFL 10 CO4

UNIT-V
i) Draw the model diagram for Turing Machine and Church-Turing 10 CO5
thesis.
ii) Discuss various variations of Turing machine
1) Multi track TM
1 2) Multi tape TM
3) Multi-dimensional TM
4) Non deterministic TM
iii) Write Short notes on Universal Turing Machine
iv) Write short notes on the halting problem of Turing machine
i) Differentiate between recursive language and recursively 2021 10 CO5
enumerable language.
2 ii) What do you mean by unsolvable problem? Explain
iii Prove that if a language L and complement of L both are
recursively enumerable then L is recursive
i) Define Post Correspondence Problem (PCP) and Modified Post 2021 10 CO5
Correspondence Problem (MPCP). Prove that if PCP is
describable then MPCP would be decidable
3
ii) State and prove that Post Correspondence Problem (PCP) is
undecidable
i)Construct a TM that accepts the set of all palindromes over the input 2022 10 CO5
alphabets {a, b}
ii) Design a TM recognizing the following language.
4
L = { am b anbapbam+n+p| m, n,p >= 1 }

iii) Construct a Turing machine for reversing a string


i) Design a TM that recognizes the language L = {anbncn | n>=1 } 2023 10 CO5
ii)Define Turing machine. Design a Turing machine that accepts the
language L over {a, b, c} defined as follows
5 L={wcw | w Є (a + b)* }
iii) Design Turing machine for the language
L = { an +2 bn | n > 0 }

Let T1 and T2 be two Turing Machine; compute the functions f1 and f2 2022 10 CO5
from N to N (where N is a natural number), respectively,
6
construct a Turing machine that computes the function
i) min(f1, f2).
ii) max(f1, f2).
Design a TM that computes the integer function f defined as follows 10 CO5
7 f(n) = 3n where n is integer and n>=0
Design a 2-track TM that takes as input on track-1 an and leaves on track- 10 CO5
8
2 the binary representation on n.
9. Differentiate Post’s Correspondence Problem (PCP) and 2022 CO5
Modified PCP with its applications. Find a PCP solutions of the
lists (if possible):
X=(10,011,101) and Y=(101 ,11, 011).

You might also like