You are on page 1of 4

1

LAHORE GARRISON UNIVERSITY


Main Campus, Sector – C Phase- VI, DHA Lahore
Ph: 042-37181821-22 Email: info@lgu.edu.pk

Assignment
# 2

Assignment
Title Regular Expression , Finite Automata

Name
Awaiz asif

Roll # Sp-2022/BSCS/117

Semester
4

Section
C

Instructor
Name Hassan Raza

Total Marks
50

Due Date Monday, 20-11-2023


2

Name:Awaiz asif Roll #:Sp-2022/BSCS/117

Question#01: Construct Finite Automata’s for the following informal languages

I. All the string starting with b. ∑ = {a,b,c}

II. All the string starting and ending with different letters. ∑ = {p,q,r}

III. All the strings having ODD ‘f’. ∑ = {f,g}


3

Name:Awaiz asif Roll #:Sp-2022/BSCS/117

IV. All the strings having even c’s. ∑ = {a,b,c}

V. All the strings starting and ending with same letters. ∑ = {a,b,c}
4

Name:Awaiz asif Roll #:Sp-2022/BSCS/117

Question#02: Write Down Regular Expressions for the following Languages

Informal Languages Regular Expressions


1: All the string not starting and ending
with different letters. ∑={a,b,c,d,e}

2: All the strings having Odd numbers of


‘f’. ∑={g,f}

3: All the strings starting and ending with


different letters having odd no of b’s
∑={a,b}

4: All the strings that ends in 3


consecutive b’s. ∑={a,b,c}

5: All the strings that contains exactly 4


g’s and these g’s must be together.
∑={e,f,g}

You might also like