0% found this document useful (0 votes)
46 views1 page

MCS 3 12june2017

The document is an exam paper for the subject "Theory of Automata and Formal Languages". It contains 4 questions assessing various topics: 1) Distinguishing between regular and context-free languages, defining pushdown automata, and constructing a context-free grammar. 2) Formally describing a context-free grammar and constructing parse trees. 3) Describing languages denoted by regular expressions and constructing finite automata. 4) Constructing a pushdown automata that recognizes the language {bnan | n ≥ 0} and formally describing it.

Uploaded by

Saqib Hayat
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)
46 views1 page

MCS 3 12june2017

The document is an exam paper for the subject "Theory of Automata and Formal Languages". It contains 4 questions assessing various topics: 1) Distinguishing between regular and context-free languages, defining pushdown automata, and constructing a context-free grammar. 2) Formally describing a context-free grammar and constructing parse trees. 3) Describing languages denoted by regular expressions and constructing finite automata. 4) Constructing a pushdown automata that recognizes the language {bnan | n ≥ 0} and formally describing it.

Uploaded by

Saqib Hayat
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/ 1

Department of Computer Science & IT

The Islamia University of Bahawalpur

MCS – 3rd - Final Term Subject: Theory of Automata and Formal Languages (CSIT-21304)
Final term – 12 June 2017 Time: 90 min.
Teacher: Dr. Nadeem Akhtar (Marks: 50)

Q1. Short questions


a) Differentiate between Regular Language and Context-Free Language. Give examples.
b) Define Push-Down Automata (PDA).
c) Construct CFG for the language: {0n@1n | n ≥ 0} U {1n@0n | n ≥ 0}. Derive the string
1111@0000 from the constructed CFG.
d) Construct Context Free Grammar representing the following regular expressions: ab*a
( 5 + 5 + 5 + 5 = 20 )

Q2. Consider the following Context-Free Grammar


<EXPR) → <EXPR> + <TERM> | <TERM>
<TERM> → <TERM> x <FACTOR> | <TERM> / <FACTOR> | <FACTOR>
<FACTOR> → (<EXPR>) | a | b
Formally describe the above grammar.
Using the above grammar construct parse trees of the following expressions:
(1) a / (a + b)
(2) (b + a) + (b / a x a)
( 5 + 5 = 10 )

Q3. Describe the languages denoted by the following Regular expressions. Construct Finite
Automata for the following language
(Note: The alphabet ∑ = {0, 1} )

a) (0 U 10 U 11) ∑*

b) 1*(01+ U 11)*

c) 0∑*0 U 1∑*1 U 0 U 1
( 3 + 3.5 + 3.5 = 10 )

Q4. Consider the language:

{bnan | n ≥ 0}

a) Construct a Push-Down Automata that recognizes the above language.


b) Formally describe the constructed Push-Down Automata.
( 5 + 5 = 10 )

You might also like