You are on page 1of 9

Assignment #03

Theory of Automata

5-C

BY: Syed Mohammad Ali – 70066816.


To: Sir Naveed Ahmed Khan
Due date: 26 December, Saturday.
Question 1: Give NFAs recognizing each of the following
languages. In all cases, the alphabet is Ʃ = {0, 1}. Specified
number of states have been mentioned for your convenience.
(a) The language { w Є Ʃ* | w ends with 00 } with three states.

(b) The language { w ∈ Ʃ* | w contains the substring 0101, i.e., w = x0101y for
some x, y ∈ Ʃ* } with five states.
(c) The language { w ∈ Ʃ* | w contains at least two 0’s, or exactly two 1’s} with
six states.

(d) The language {ʎ} with one state.


(e) The language 0*1*0*0 with three states.
Question 2: Convert the following NFA into an equivalent
DFA. Show all proper steps of conversion.
To construct a DFA M = (Q′ , Σ, δ′ , q′ 0 , F′) that is equivalent to NFA N, first we
compute the ε-closure of every subset of Q = {1, 2, 3}.

States ε-closure

1 1, 2

2 2

3 3

Conversion of ε-NFA to NFA.

States a b

±1 1, 2, 3 -

-2 1, 2 -

3 2 2, 3
Conversion of NFA to DFA.

States a b

±1, 2 1, 2, 3 -

-1, 2, 3 1, 2, 3 2, 3

-2, 3 1, 2 2, 3

You might also like