Professional Documents
Culture Documents
Course No.: …… CS-536 ……Course Title:… Theory of Automata and Formal Languages……
Total Marks:……….……18………………Date of Exam:…………………30/4/2021……………............................
Degree: ……………BSCS………………….Semester:…………4……………… Section:…………………C…………………
Marks
Q. No. 1 2 3 4 5 6 7 8 9 10 Obtained/
TotalMarks
Marks
Obtaine
d
Total Marks in Words:
Name of the teacher:
Who taught the course: Signature of teacher / Examiner:
To be filled by Student
1)fefBAfbcbcdAcfab
2)BAeffBAAcbcbab
3)bcbefabfABAAceddbcb
Answer:
1:
S= fefBAfbcbcdAcfab
Factoring= (f),(e),(f),(BA),(f),(bcb),(cd),(Ac),(f),(ab)
|S| = 10
10 is valid string
2:
S= BAeffBAAcbcbab
Factoring = (BA),(e),(f),(f),(BA),(Ac),(bcb),(ab)
|S| = 8
8 is Valid string
3:
S= bcbefabfABAAceddbcb
Factoring = (bcb),(e),(f),(ab),(f),(BA),(Ac),(e),(d),(d),(bcb)
|S| =11
11 is valid string
(a)The language { ap bm cp de} of strings defined over Σ={a,b,c}, as m=odd number, p= prime
numbers , e =even (2)
(b) The language L of strings that start with bba and end with abc, defined over Σ={a,b,c}, what will
be the minimum length string. (2+1)
Answer:
L={aabccdd,aaabbbccdd,aaabbbcccdddd,aaabbbcccccdd,aaaaabbbbbcccccdd,aaaaaaabbbbbbbcccccdd
dd………}
Here we have defined language set by given condition where number of a's must be prime , number of
b's must be odd , number of c's must be prime , number of d's must be even in language . As we can
see in above language set first language item is aabccdd where number of a = 2 (prime) , number of b
= 1(odd) , number of c = 2(prime) , number of d = 2(even) .
(b) : The Language L of strings that starts with bba and end with abc defined over { a , b , c } .
Minimum length string will be of 6 and the minimum length string will be bbaabc which starts from
bba and end with abc .
L={bbababc,bbacabc,bbaaabc,bbaaaabc,bbabbabc….}
Q.No.3
(a) Define through recursive definition , The language L of strings that start and end with different
latters and also must contain aa in middle of each string, defined over Σ={a,b,c}. also Write at least 2
Valid and 2 Invalid strings belongs to this language (2+2)
(b) Write the Regular expression for the language which accept no pair of consecutive a’s over Σ
={a,b} (1+1+1)
i.R.E= ______________ (1)
(c) Construct a DFA which accepts all strings over Σ ={a,b} in which second last symbol is a and last
symbol is b. also Write at least 2 Valid and 2 Invalid strings for the designed DFA. (2+1)
Answer:
b)
i. RE: (b + ab)* (a + λ)
c)
2 Valid Strings; aaab, bababaaab