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

CSE273 02 Mid Spring 2022 PDF

The document provides instructions for a midterm exam on theory of computation. It includes 4 questions, the first asking to define a NFA and convert it to a DFA, the second about regular languages and converting a regular expression to an NFA, the third converting a DFA to a regular expression and proving a string can be generated by a CFG in two ways, and the fourth finding derivations for a string using a CFG and explaining ambiguous grammars with an example.

Uploaded by

ziniaafrin1988
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)
111 views2 pages

CSE273 02 Mid Spring 2022 PDF

The document provides instructions for a midterm exam on theory of computation. It includes 4 questions, the first asking to define a NFA and convert it to a DFA, the second about regular languages and converting a regular expression to an NFA, the third converting a DFA to a regular expression and proving a string can be generated by a CFG in two ways, and the fourth finding derivations for a string using a CFG and explaining ambiguous grammars with an example.

Uploaded by

ziniaafrin1988
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

North South University

CSE 273: Introduction to Theory of Computation


SEC-01 Spring 2022
Mid Term Exam Marks: 30

Please read the instructions before you proceed:


 Submit handwritten answer scripts
 Do not use any unfair means. Any form unfair means examination will be cancelled.
 Plagiarism is strictly prohibited. Don't copy from some others.
 Write your ID in every pages

Submission guidelines:
After you complete the assignment rename it with your ID and Name and
upload ID_Name.pdf on Engrade in the turn-in section.

1. a) Give the formal definition of the following NFA: 5

b) Convert the following NFA into an equivalent DFA: 5

This study source was downloaded by 100000885393720 from CourseHero.com on 05-04-2024 12:29:18 GMT -05:00
1

https://www.coursehero.com/file/141523408/CSE27302MidSpring2022pdf/
2. a) Define regular language. Explain the principle of designing a finite automation that 5
recognizes some given language.
b) Convert the regular expression (a U ab)* baa (a U b)* to an equivalent NFA. 5

3. a) Convert the following DFA to a regular expression: 5

b) From the following CFG 5


EE+E|E*E|(E)|id

Prove that id+id*id can be generated by two distinct leftmost derivation.

4. a) For the following context free grammar (CFG): 6


S →aAS|a

A→SbA|SS|ba

For the string “aabbaa” Find the

i. Leftmost derivation;
ii. Rightmost derivation; and
iii. Parse tree.
b) What do you understand by ambiguous grammar? Explain it using a suitable example. 4

This study source was downloaded by 100000885393720 from CourseHero.com on 05-04-2024 12:29:18 GMT -05:00
2

https://www.coursehero.com/file/141523408/CSE27302MidSpring2022pdf/
Powered by TCPDF (www.tcpdf.org)

You might also like