0% found this document useful (0 votes)
73 views2 pages

CS 402 Assignment 1 Solution

The document is an assignment for the Theory of Automata course (CS402) with a total of 20 marks, due on December 14, 2021. It includes questions on determining valid and invalid alphabets, tokenizing strings, finding string lengths, and creating regular expressions and finite automata. Specific examples and answers are provided for each question, illustrating the concepts discussed.

Uploaded by

helicopterrs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views2 pages

CS 402 Assignment 1 Solution

The document is an assignment for the Theory of Automata course (CS402) with a total of 20 marks, due on December 14, 2021. It includes questions on determining valid and invalid alphabets, tokenizing strings, finding string lengths, and creating regular expressions and finite automata. Specific examples and answers are provided for each question, illustrating the concepts discussed.

Uploaded by

helicopterrs
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Made by Vu Experts group

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

a) Determine which of the following sets have valid / invalid alphabets:

Σ1={ a, ab, b, d, ae}


Σ2={a, ba, c, d}

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

Tokenized = (ab) (baa) (ab) (db) (baa)

Length = 5

Rev (s) = (baa) (db) (ab) (baa) (ab)

Made by Vu Experts group


Made by Vu Experts group
https://chat.whatsapp.com/
G54TCJtRjs7GdEBdWRdGAK

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) *

d) What will be the Finite Automata for above language?

Answer:

Made by Vu Experts group

You might also like