0% found this document useful (0 votes)
78 views2 pages

CS2004

This document contains a series of questions related to formal languages and automata theory for an exam. It asks students to: 1. Design a Turing machine and DFA for specific languages. 2. Find CFGs for languages and design a PDA for another language. 3. Design a Turing machine and discuss the pumping lemma and a specific language. 4. Draw state diagrams for DFAs/PDAs and discuss left/right recursive grammars. 5. Explain context-free grammars and eliminate grammar elements and construct a CFG and PDA. The document tests a range of skills around automata theory and formal language concepts.

Uploaded by

Satya Das
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)
78 views2 pages

CS2004

This document contains a series of questions related to formal languages and automata theory for an exam. It asks students to: 1. Design a Turing machine and DFA for specific languages. 2. Find CFGs for languages and design a PDA for another language. 3. Design a Turing machine and discuss the pumping lemma and a specific language. 4. Draw state diagrams for DFAs/PDAs and discuss left/right recursive grammars. 5. Explain context-free grammars and eliminate grammar elements and construct a CFG and PDA. The document tests a range of skills around automata theory and formal language concepts.

Uploaded by

Satya Das
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/ 2

National Institute of Technology Rourkela

Department of Computer Science and Engineering


B.Tech/Dual Degree 5th Semester
End Semester Examination (Spring) 2019
Subject: Formal Languages and Automata Theory Subject Code: CS 2004
Full Marks: 50 Duration: 3 Hours
Answer ALL questions.
Figures at the right margin indicate marks.
All parts of a question must be answered at one place.
1. (a) Draw the staten transition diagram for a Turing machine which recognises the lan-
guage L= {02 } for all n ≥ 0. [5]
(b) Design a DFA (deterministic finite automaton) to accept the language [5]

L1 = {α ∈ {a, b, c} |α starts and ends with the same symbol }. Only draw the
transition diagram, and clearly indicate the start state and the final state(s).
2. (a) Find the CFG for the following languages: [5]
i. L1 = {an bm |n 6= 2m}
ii. L2 = {an bm ck |n = m or m ≤ k}
(b) Design a PDA for the language L={w ∈ {a, b, c}∗ |na (w) + nb (w) = nc (w)}. [5]
3. (a) Design a Turing Machine over the alphabet {a, b, c} to accept all palindromes. [4]
(b) Define Pumping Lemma for context-free languages.Let Σ = {0, 1, #} and define
a language C over Σ as follows: [4]

C ={r#s | r, s ∈ {0, 1} , r is a substring of s}.
The language C is not context-free.
(c) What language does the PDA in Figure 1 depict? [2]

Figure 1:

NITR/CSE/RKM/TKM/CS2004/END/2019
4. (a) Draw the state transition diagram of the language accepted by a DFA whose
equivalent PDA P = ({p, q}, {a, b}, {R, Z0 }, δ, q, Z0 ) if δ is given by: [4]
δ(q0 , b, Z0 ) = {(p, RZ0 )}
δ(p, a, R) = {(q0 , )}
δ(q0 , , Z0 ) = {(p, )}
(b) What is left recursive and right recursive grammars? With an example explain how
to convert a given left recursive grammar to its equivalent grammar without left
recursive productions. [4]
(c) Consider the grammar [2]
S → xSyS | SS | λ
What language does it generate?
5. (a) What do you mean by a context-free grammar? Explain with suitable examples,
how to eliminate -production, unit production and useless symbols from a
grammar. [4]
(b) Find a context free grammar with minimum number of production rules possible
for the language given below and also, construct the PDA. [4]
q m+n n p p+q q
{1 1 1 0 0 0 | m, n, p, q ≥ 0}
(c) Construct a deterministic finite automaton equivalent to the grammar [2]
S → aS|bS|aA
A → bB
B → aC
C →∈
———— END ————

NITR/CSE/RKM/TKM/CS2004/END/2019

You might also like