You are on page 1of 3

Course Code : CSEC-326

Course Title : Compiler Construction


Department : CSE

Student Name : Zuwel Mia


Student ID : 2183091024

Task 01 : Design an NFA that will be accepting the following


languages over the alphabet {0,1} & give a brief description.
 The set of all strings ends with 01

1
Solutions: For each part we have a transition diagram which is a solution to
the problem. Following each diagram is a discussion of the meaning of the
states of the machine.

In here, In the above NFA, states ‘q0’, ‘q1’, and ‘q2’, it accepts, The set of all strings
ends with 01.

1. δ(q0, 0) = q0 or q1 

2.  δ(q0, 1) =  q0
3. Then, δ(q1, 0) = Null Set  
4. Then, δ(q1, 1) = q2 which is final state. 

 Two accepted strings using This NFA is:


 L = {01, 11110001}

 Task 02 : Design an NFA that will be accepting the following languages


 over the alphabet {a,b}
 The set of strings with “aab” as a substring.
 Show at least two accepted strings using your NFA.

2
 The set of strings with “aab” as a substring.

Solutions: For each part we have a transition diagram which is a solution to


the problem. Following each diagram is a discussion of the meaning of the
states of the machine.

b a,b
a

b
a a Q2 Q3
Q0 Q1

 Two accepted strings using My NFA is:


L ={ aab, aaab}

You might also like