Professional Documents
Culture Documents
Student Declaration: Theory of Automata and Formal Languages
Student Declaration: Theory of Automata and Formal Languages
Student Declaration: Theory of Automata and Formal Languages
paper for the course _ Theory of Automata and Formal Languages ___, I will not be involved in
Term Examination Spring 2021. I take full responsibility of my conduct. If I found involved
in any kind of such activity of cheating/copying/plagiarizing, then Institute reserves the right
Student Signature
Mid Exam / Spring 2021 (Paper Duration 12 hours)
(Online Assignment Based Question Paper)
Course No.: ………CS-729…………Course Title:…Theory of Automata and Formal Languages….
Total Marks:………18…………………Date of Exam:……….…………………………….................
Degree: ………MCS….... Semester:……3rd……....Section:……A…………….
Marks
Q.No. 1 2 3 4 5 6 7 8 9 10 Obtained/
Total Marks
Marks
Obtaine
d
Total Marks in Words:
Name of the teacher:Rana M. Amir Latif
Who taught the course: Signature of Teacher / Examiner:
To be filled by Student
(THEORETICAL EXAMINATION)
To be filled by Student
(THEORETICAL EXAMINATION)
Question 1: (4Marks)
What is the difference between formal Languages and informal languages? Give Examples:
Answer:
---------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
Question 2: (4 Marks)
Write down the regular expression of the word ending in b
All words ending with b
(a+b)*b
a*(a+b)
Given the regular expression (a+b)*, write down few strings generated from the given RE
Answer Given a Language L defined over ∑ (a,b) , starting and Ending with different letters with
different letters.
Answer:
={ ^,ab,aa,ab,ba,bb,aaa,aba ,baa,abb,bab,,bba,bbb}
Question 3:
Given a Language L defined over ∑ (a,b) , starting and Ending with different letters with different
letters.
Write RE of the above Language
Answer:
RE = a(a+b) *b+b (a+b)*a
(4Marks)
Draw FA the above Language
Answer;
a,b
2 4+
b
a
1-
a, b
b 5+
3
a
:--------------------------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------------
Question 4: (4Marks)
Consider a language L1 {containing aba) and Language L2 = {accepting only a}
Write and draw down RE and FA of the given languages L1 and L2
Answer:
RE of L2:
L2 = {accepting only a}
Regular Expression={ ^,a,aa,aaa,aaaa,aaaaa,………}
= a*
FA of L2:
Finit automata FA =
q0
RE of L1:
Language L1={containing aba)
Language L1= { aaba, baba, aaaba, babaa}
(a+b) aba (a+b)*
FA of L1:
b b
Q0 A Q1 b Q2 a Q3
b
a ,b
A Q1 b Q3 a
Q0
Question 5: (2Marks)
Explain the concept of the Palindromes with examples?
Answer:---------
PALINDROME :
The language consisting of ˄ and the strings s defined over ∑ such that Rev(s)= s
---------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
Note:
Understanding the question paper is part of examination.
Hand written paper will not be acceptable?
Pledger should be less than 10%