0% found this document useful (0 votes)
9 views8 pages

Es Merged

The document contains exam papers for CSE 2221 and CSE 2254 courses at Manipal Academy of Higher Education, focusing on Formal Languages and Automata Theory. Each exam includes various questions on topics such as grammars, automata, Turing machines, and language properties, with a total of 50 marks and a duration of 180 minutes. The exams are scheduled for June 2024 and include questions requiring the design of automata, grammar transformations, and proofs regarding language properties.

Uploaded by

boranana777
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)
9 views8 pages

Es Merged

The document contains exam papers for CSE 2221 and CSE 2254 courses at Manipal Academy of Higher Education, focusing on Formal Languages and Automata Theory. Each exam includes various questions on topics such as grammars, automata, Turing machines, and language properties, with a total of 50 marks and a duration of 180 minutes. The exams are scheduled for June 2024 and include questions requiring the design of automata, grammar transformations, and proofs regarding language properties.

Uploaded by

boranana777
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/ 8

CSE 2221 about:srcdoc

Exam Date & Time: 26-Jun-2024 (02:30 PM - 05:30 PM)

MANIPAL ACADEMY OF HIGHER EDUCATION


FOURTH SEMESTER B.TECH. DEGREE EXAMINATIONS - JUNE 2024
SUBJECT: CSE 2221/CSE_2221 - FORMAL LANGUAGES AND AUTOMATA THEORY
(COMPUTER SCIENCE AND ENGINEERING - ARTIFICIAL INTELLIGENCE AND MACHINE
LEARNING / COMPUTER SCIENCE / COMPUTER SCIENCE AND ENGINEERING - CYBER
SECURITY)
FORMAL LANGUAGES AND AUTOMATA THEORY [CSE 2221]
Marks: 50 Duration: 180 mins.
A
Answer all the questions.
1A) Transform the given Languages into equivalent Grammars
i) L = { an bn+2 | n ≥ 0} with only one variable and ∑ ={a, b}
ii) L = { a3n bn | n ≥ 1} with exactly 1 variable and ∑ ={a, b} (3)
iii)L ={ am bn | m ≥ n, n ≥ 0} with exactly 2 variables ∑= { a, b}

1B) i) Construct a DFA with exactly 3 states, which accepts set of all strings with over ∑
={a, b} such that second symbol from RHS is 'a'.
ii) Construct a DFA which accepts set of all strings with (3)
L ={ an | n ≥ 1, n ≠ 3} with ∑ ={a}

1C) Construct a NPDA for accepting the language L = {an bm cn | m,n>=1}


Explain the logic used in constructing the NPDA. Give the instantaneous representation (4)
of the NPDA

2A) Describe the seven-tuple definition of a Turing Machine. What is a Non-deterministic


Turing Machine? (2)

2B) i) Discuss the RE for the languages over Σ ={a,b}


{ w ∈ Σ* | w contains exactly one double letter } (4)
ii) Draw a NFA for the RE (a+ba*)a*

2C) i) Formally define a regular grammar that generates the language on Σ = {x, y}
consisting of all strings with no more than three y's.
ii) Construct a NFA N from the grammar G= ({S, T, U}, {a, b}, S, P ), where P is: S → a (4)
| b | aT | aU | bT | bU , T → a , U → b

3A) i) Convert the given CFG to Greibach Normal Form. (4)


S → aA | aBB
A → aAA | λ
B → bB | bbC
C→B
ii) Let G be S → aS | Sa | a . Show that L is ambiguous. Can there be an unambiguous

1 of 2 25-06-2024, 10:50
CSE 2221 about:srcdoc

grammar for G?

3B) Remove useless productions from the grammar.


S→ aaA| Bb| C
A→ bB| AB| aA| λ (3)
B→ bb| A| λ
C→ b| Bb

3C) Find S grammar for the regular expression (aaa*b+b)


(3)

4A) Prove that the language L = {an: n is a prime number} is not context-free using Pumping
Lemma. (3)

4B) Let a CFG with the following production rules.

S → aA
A → aABC |bB| a
B→b (3)
C→c

Using CFG to PDA conversion procedure, obtain the corresponding PDA with a
transition diagram for the above CFG. Test whether "aaabc" is acceptable by this PDA.

4C) Design a Turing Machine with a transition diagram to accept a string w of 0's and 1's
such that the number of 0's in w is equal to number of 1's in w. Show that the Turing (4)
machine accepts some valid input.

5A) Let two positive integers A and B represented in unary. With a transition diagram design
a Turing Machine which will replace the separator "0" with a "1" and the other current
tape contents with "Blank" symbols, if A > B. Write instantaneous description (ID) for (4)
the string "1111011".

5B) Explain the defining properties of context-sensitive grammars and discuss their role in
the Chomsky hierarchy of formal languages. (3)

5C) Discuss the significance of the Post Correspondence Problem (PCP) in the context of
algorithmic computation. With an example show that the Post correspondence problem (3)
is undecidable.

-----End-----

2 of 2 25-06-2024, 10:50
Question Paper
Exam Date & Time: 04-Jul-2023 (02:30 PM - 05:30 PM)

MANIPAL ACADEMY OF HIGHER EDUCATION


FOURTH SEMESTER B.TECH. DEGREE EXAMINATIONS - JUNE/JULY 2023
SUBJECT: CSE 2254/CSE-2254 - FORMAL LANGUAGES AND AUTOMATA THEORY
(COMPUTER SCIENCE AND ENGINEERING - ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING / COMPUTER
SCIENCE / COMPUTER SCIENCE AND ENGINEERING - CYBER SECURITY)
(MAKEUP)

FORMAL LANGUAGES & AUTOMATA THEORY [CSE 2254]


Marks: 50 Duration: 180 mins.

A
Answer all the questions.

1A) Design a deterministic and non-deterministic finite automaton (dfa and nfa) which accept a string (4)
containing "ion" at the end of a string in a string of {a-z}, e.g., "imagination" but not "image". Mention
the quintuple representation of both dfa and nfa you designed.
1B) Consider the language L={(10)n : n≥0}. Prove that Deterministic Finite Automata (DFA) is equivalent (4)
to non-Deterministic Finite Automata (NFA) on the language L.
1C) The language, L={an b n cn : n≥1} is a context sensitive language. Design context sensitive grammar (2)
for the language.
2A) The Grammar G, with productions. (2)
S → S1 B,
S1 → aS1 b,
bB → bbbB,
aS 1 b → aa,
B →λ
Identify whether this is unrestricted grammar or not. Supplement your answer with proper technical
justifications.
2B) Generate the regular expressions for the sets given below. (3)
i) {a n : n is divisible by 2 or 3 or n=5}
ii) {a2 . a5 , a8 , . . .}
iii) The set of all strings on {a,b} terminated by either 'a' or 'abb'
2C) Identify the languages given below is regular or not and support your answer with proper (5)
justifications.
i) L= {a n b mck : n, m, k≥0}
ii) L={aib 2j: i, j ≥0}
iii) L= {an : n is prime}
iv) L= {wwwR: w∈{a,b}* }
v) L= {an : n≥100}

3A) Check whether the grammar S→aSbS | bSaS | λ is ambiguous or not for the sentence "abab" , by (3)
deriving two distinct parse trees.
3B) Simplify the Grammar given below and convert to Chomsky Normal Form (3)
S→aBBa |aB| aD|CC
B→aBD|D|λ

Page 1 of 2
C→aCC|bCC
D→ab |cd |B.
3C) Show that language L={a n b n cn | n>=1} is not CFG using pumping lemma. (4)

4A) Construct a PDA for the CFG G= ({S, A, B}, {0,1}, S, {S→0A, A→0AB |1, B→1}) and show the (3)
sequence of moves for the string "000111".
4B) Construct NPDA for the language L={wЄ {a,b}* :na (w) =n b (w)}. (3)
4C) Construct DPDA for the language L= {an b 2n cn d 2n | n>=1}. (4)

5A) Design a Turing Machine using the state transition diagram to reverse a given sring w {0,1}+ such (4)
that the input tape will contains final state followed by reversed string.
5B) Design a Transducer using state transition diagram to compute the sum or differenc of two positive (4)
integers, X and Y. The integers are represented in the Turing machine with equal number of 1's
separated by 0.
5C) Construct a Grammar to generate a language L= {an b n cm|n,m≥1}. (2)

-----End-----

Page 2 of 2
Question Paper
Exam Date & Time: 22-May-2023 (02:30 PM - 05:30 PM)

MANIPAL ACADEMY OF HIGHER EDUCATION


FOURTH SEMESTER B.TECH. EXAMINATIONS - MAY/JUNE 2023
SUBJECT: CSE 2254/CSE-2254 - FORMAL LANGUAGES AND AUTOMATA THEORY
(SPL: COMPUTER SCIENCE AND ENGINEERING - ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING / COMPUTER
SCIENCE / COMPUTER SCIENCE AND ENGINEERING - CYBER SECURITY)
Formal Languages and Automata Theory [CSE-2254]
Marks: 50 Duration: 180 mins.

A
Answer all the questions.

1A) Design DFAs to accept following languages (4)

1B) (4)

1C) Illustrate the relationship between regular, linear, deterministic context free & nondeterministic (2)
context free languages in the form of a diagram.
2A) Identify the type of the bellow given grammar G={S, A, B},{a,b,c} S, P)and find he language (2)
generated by it.
P: S→abc|aAbc
Ab→bA
Ac→Bbcc
bB→Bb
aB→aa|aaA
2B) Given L1 = L(bba*baa*) & L2 = L(ab*), find Right Quotient L1 /L2 using DFA method. (3)
Draw the final DFA for L1 /L2 .
2C) Explain the terms Right linear grammar and Left linear grammar. Construct Left linear grammar and (5)
right linear grammar for the language L((aab*ab) *) with exactly 3 variables.
3A) Construct CFG that generate a language consisting of equal number of a's and b's and leftmost (3)
derivation for the string "aabbab".
3B) Illustrate inherently ambiguous grammar. Justify the language L={a2nb 2nc2m} U{a2mb 2nc2n} is (3)
inherently ambiguous with n and m being non-negative number.
3C) Convert the following CFG to Chomsky Normal Form. (4)

Page 1 of 2
4A) Some properties of the context free languages are listed below. (3)
i) Union
ii) Concatenation
iii) Star closure
Verify the properties on context free languages with suitable examples.
4B) Define instantaneous descriptions of pushdown automata. Provide the instantaneous description in (3)
processing the string 'baababba' by the pushdown automaton for the language given below.

4C) Design non-deterministic pushdown automata that recognize the following language, L. Draw the (4)
transition diagram for the push down automata. Mention the septuple specification for it.

5A) Design a Turing Machine (TM) that act as a copier on strings of 1's. Demonstrate the working of the (4)
designed TM on the string '111' with the help of instantaneous descriptions.
5B) Check whether the languages given below can be accepted by Linear Bounded Automata (LBA) or (4)
not and justify your answer with suitable examples.

5C) Define grammar with a suitable example. (2)

-----End-----

Page 2 of 2
Question Paper
Exam Date & Time: 09-May-2024 (02:30 PM - 05:30 PM)

MANIPAL ACADEMY OF HIGHER EDUCATION


FOURTH SEMESTER B.TECH. DEGREE EXAMINATIONS - APRIL / MAY 2024
SUBJECT: CSE 2221/CSE_2221 - FORMAL LANGUAGES AND AUTOMATA THEORY
(COMPUTER SCIENCE AND ENGINEERING - ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING / COMPUTER
SCIENCE / COMPUTER SCIENCE AND ENGINEERING - CYBER SECURITY)
FORMAL LANGUAGES AND AUTOMATA THEORY [CSE 2221]
Marks: 50 Duration: 180 mins.

A
Answer all the questions.

1A) Design a DFA with a transition diagram to accept the following language, (3)

1B) Construct the equivalent DFA for the following NFA (3)

1C) Design a PDA with a transition diagram to accept the following language, (4)

Show whether the obtained PDA is deterministic or non-deterministic.


2A) Describe with a diagram the Standard Turing Machine. Then show the situations of the tape before (2)
and after the move

2B) i) Describe the RE for the languages over Σ ={a,b} (4)


a. { w ∈ Σ* | w has exactly one pair of consecutive a}
b. { w ∈ Σ* | w does not end with a pair of consecutive letter}

ii) Draw a NFA for the RE ((aa)*+bb*)*


2C) i) Construct an automaton that accepts the language generated by the grammar. (4)
S → abA
A → baB
B → aA | bb

ii) Check whether the given grammar is ambiguous or not by using parse trees for the generation of
the string aabbccdd
Page 1 of 2
S → AB / C
A → aAb / ab
B → cBd / cd
C → aCd / aDd
D → bDc / bc
3A) Consider the grammar G whose productions are: (3)
S->aAS | A
A->SbA | SS | ba
Show that S=>*aabbaa and construct a derivation tree whose yield is aabbaa.
3B) Find a grammar in CNF that is equivalent to the following grammar (The only variable here is S): (3)

3C) Design a PDA for accepting a language with a transition diagram. Specify the (4)
corresponding 7 tuple specification.
4A) Find the S grammar to generate the language (3)

4B) Show that the language is not context free using pumping lemma. (3)

4C) Design a Turing Machine using transition function to accept a language (4)

where the tape will have a, and b as the only input symbols.
5A) Design a transducer with 5 states using transition diagram to generate ww R from w, where (4)
. Show the computation of the string ab in the transducer, which after processing will

contain abba.
5B) Discuss the automata, grammar, and the associated languages with appropriate examples at each (3)
level of the Chomsky Hierarchy.
5C) Elaborate on the Enumeration procedure with reference to universal Turing Machine. Discuss the (3)
relationship between enumeration procedures and Turing machines with respect to countability

-----End-----

Page 2 of 2

You might also like