CS 402 Assignment 1 Solution
CS 402 Assignment 1 Solution
https://chat.whatsapp.com/
G54TCJtRjs7GdEBdWRdGAK
Total marks = 20
Theory of Automata (CS402)
Assignment # 01 Deadline: 14th Dec,
2021
Fall 2021
Question No 1:
Marks:4+6=10
s=abbaaabdbbaa
way Σ1={ a, ab, b, d, ae} Σ2={a, ba, c, d}
s
1 a b b a a a b d b b a b b a a a b d b b a
a a a
2 ab b a a a b d b b a a b ba a a b d b b a
a a
Valid Alphabets invalid Alphabets
We have tried two different ways to This is because we can not tokenized
tokenize the string and it was letters according to Σ2. The character
successfully tokenized with Σ1 (b) does not belong from Σ2
characters characters
b) Consider Σ={ab, baa, c, db} to find the length of the string s=abbaaabdbbaa by
tokenizing. Give its reverse Rev (s).
s=abbaaabdbbaa
Length = 5
Question No 2:
Marks:5+5=10
c) Give the regular expression RE over Σ={a,b} for the language of all words having b
as a second letter.
Answer:
( a + b) b + ( a + b) *
Answer: