Lahore Leads University
Final Term Assignment Summer 2020
Roll No: _______________
Program: BSCS/BSIT/BSSE
Subject: Theory of Automata
Marks: 40
Name: ________________
Due Date: 10-08-2020
• Attempt all Questions, there is no choice in Assignment.
• Paper #:name
Write your Name, Roll number, Section and instructor _______
on front
page of your assignment.
• Only handwritten assignment is acceptable.
• There is no mistake/issue in the assignment so don’t raise irrelevant
questions
• Take snapshot of your handwritten assignment and add all pictures to
1 pdf file in an arranged form.
• Email pdf file to address:
[email protected] • Your email subject line must be in the given below sequence
Name: Degree_Subject_Name_Rollno. For example (BSCS_Theory
of Automata_ALI_4575)
• One student can email only one time. If a student sends more than one
emails, his/her first email will only be considered.
• Follow the deadline (10-08-2020 at 11:59 PM),
• Write down your answers clearly. I reserve the right to take off points
due to poor writing/English structures/Poor Presentation.
Question 1: 4+6=10
a) Consider the grammar
S → AB (1 )
A→C (2)
CB → Cb (3)
C→a (4)
where {a, b} are terminals, and {S, A, B, C} are non-terminals. Derive five
different two possible phrases from this grammar
b) G = (V, Σ, R, S) with set of variables V = {S, X}, where S is the start variable; set
of terminals Σ = {0, 1}; and rules:
S → X1X1X1X
X → 0X | 1X | ε
Prove that above grammar generates language which satisfy this definition
{w ∈ {0, 1} ∗ | w contains at least three 1s}
Question 2: 10
a) Convert the following CFG into an equivalent CFG in Chomsky normal form,
using any suitable procedure.
S → BSB | B | ε
B → 00 | ε
Question 3:
b) Construct a Turing Machine for language L = {0n1n2n | n≥1} 10
Question 4: 5+5=10
a) Using Pumping Lemma prove that language L of all strings ending with aba is
regular if Σ = {a, b}.
b) The following unrestricted grammar generates the language
{ 0n 1n 2n | n ∈ ℕ } :
S → 0SX
X → A2
2A → A2
SA → 1
1A → 11
Show that “000111222” can be derived using above rules is shown here: