0% found this document useful (0 votes)
24 views6 pages

Flat 1

The document contains 5 questions regarding formal languages and automata theory. The questions cover topics like finite state machines, pushdown automata, Turing machines, regular expressions and domino matching. Students are required to solve problems related to minimizing automata, ambiguity in grammars, empty stack languages of PDA, representation of strings in Turing machines and regular expressions for specific languages.

Uploaded by

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

Flat 1

The document contains 5 questions regarding formal languages and automata theory. The questions cover topics like finite state machines, pushdown automata, Turing machines, regular expressions and domino matching. Students are required to solve problems related to minimizing automata, ambiguity in grammars, empty stack languages of PDA, representation of strings in Turing machines and regular expressions for specific languages.

Uploaded by

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

Roll No…………………..

Dr B R Ambedkar National Institute of Technology, Jalandhar


B Tech (Information Technology)
ITPC–210, Formal Language and Automata Theory
End Semester Examination, May 2021
Duration: 02 Hours Max. Marks: 40 Date: 20 May 2021

Question 1(a) 1(b) 2(a) 2(b) 3(a) 3(b) 4(a) 4(b) 5(a) 5(b)
Number
Marks 4 4 4 4 4 4 4 4 4 4
CO No. 1 3 1 4 4 3 4 4 2 2
Learning L M L M M H H M L L
Level

Note:
1. Attempt all the questions.
2. Write the answers in hard copy (on A4 sheet) using blue/black pen with
your signature on top left and page number on top right corner of each
page of the answer booklet.
3. The time allowed for writing examination is 02 hours. Extra 15 minutes
are allowed for preparing the PDF file of Answer Booklet and submitting
it.
4. Follow the instructions regarding submission of answer booklet as issued
by the examination section.

1. (a) Construct a DFA such that it accepts all the numbers whose binary
representation is divisible by 7. Also, find a DFA equivalent to M= ({q0, q1,
q2}, (a,b), ẟ, q0, {q2}), where ẟ is given by

State a b
→q0 q0, q1 q2
q1 q0 q1
*q2 - q0, q1

2
(b) 𝐿 = {1𝑛 |𝑛 ≥ 0} is regular. Verify and justify your answer. Also, prove
that S -> aSbS | bSaS | ε is ambiguous.

2. (a) What do you mean by useless symbol in a grammar? Show the


elimination of useless symbols with an example.

(b) Convert the grammar {S→AaCb|ABa, A→bAa|a, B→BaB|b, C→c} to


Chomsky normal form.
1
3. (a) Reduce the following DFA

OR
State a b
→q0 q1 q0
q1 q0 q2
q2 q3 q1
*q3 q3 q0
q4 q3 q5
q5 q6 q4
q6 q5 q6
q7 q6 q3

(b) Covert the following CFG to a PDA


A → 0A1
A→B
B→#

4. (a) Write the design strategy for NFA-ε? Also, convert the following NFA-
ε to NFA.

(b) Construct a Moore machine that counts number of a’s divisible by 3


and convert into equivalent Mealy machine over ∑={a,b}.

5. (a) When a recursively enumerable language is said to be recursive? How is


Turing Machine said to function similar to two-stack PDAs? Explain.

(b) Prove that Ak = {ai: the Turing machine Mi does not accept ai} is not
Turing recognizable.
Or
Design a Turing Machine “Parity Counter” that outputs 0 or 1, depending on
whether the number of 1’s in the input sequence is even or odd respectively.
2
Roll No. 212 4o05
Dr BR Ambedkar National Institute of Technology,
T Jalandhar
B Tech (Information Technology)
ITPC-210, Formal Languages & Automata Theory
End Semester Examination, May. 2023
Duration: 03 Hour Max. Marks: 50 Date: 17 May 2023
Marks Distribution & Mapping of Questions with Course Outcomes
(COs)
Question 2(a) 2(b)
Number
Marks 8 8 12 6
CO No
Learning M
Level
Note:
Attempt all the questions
2 Write the ans 3 s g blue black pen onh
3 Be specifie answering

Determine the minimized finite state machine for the given language:
L= (a"b:n > 0) U(ba:n > 1)
Also, prove that the obtained machine is minimized.
2. (a) Using the subset construction, convert the given NFA into an
equivalent DFA.

(b) Show that the following grammar is ambiguous:


S’ if( E) S else S
S’ if( E) S
S’x
E’ true
E ’ fase
3 Apushdown automaton P is specified by P =(q0, ql, (a, b).
(Z, X}, , qin, Z, 0), where S contains the following transitions:
(q0, a, Z) (q0, 2), (q0, a, Z) ’ (q0, XZ_, (q0, a, X) -’ (q0,
XX), (q0, b, X) - (q1, 2). (q1, b, X) -’ (ql, 4), (q1, a, Z) - (q0,
Z)
Determine a (reduced) context-free grammar G for the empty
sack language of P, ie., L(G) = Le(P).
Consider the Turing machine M =(K, , 8, s, {h}, where K= {q0,
ql. h}. (a.t, .},s= q0 andS is given by the following table:
state/symbol representation
go g00
q01

a000
a001
a010
a011
al00

(a) What is the string "M"?


(b) What is the representation of the string aaa?
(c) We are given a problem and find out that it is undecidable.
Could there be an algorithm to solve it in polynomial time?
Answer yes" or "no" and then explain/justify your answer.
5. Writothe regular expressions for the following languages:
The set of all strings starting with 'a' and no consecutive
'b' over the alphabet (a, b}.
The set of all strings with at most one pair of consecutive
"peel' and at most one pair of consecutive 'cover' over the
alphabet {peel, cover}.
The set of all strings with equal number of 'key' and
'lock' such that no prefix has two more key's than lock's
nor two more lock's than key's over the alphabet {lock,
key}.
Determine whether the match exists for the given collection of
dominos:

You might also like