0% found this document useful (0 votes)
16 views3 pages

Worksheet2 - NFA - Solutions

Uploaded by

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

Worksheet2 - NFA - Solutions

Uploaded by

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

CS-1301315 Theory of Computation

Worksheet2: Non-deterministic Finite Automata (NFA)


Dr. Mohammed Khader

OBJECTIVES:
 Introduce Non-deterministic Finite Automata (NFA).
 Understand NFA transition graphs.
 Determine whether or not a string is accepted by an NFA.
 Describe the language accepted by an NFA (verbally or formally).

Q1. Indicate whether or not each string is accepted by the given machine M.
1

0 1

q0 q1 q2

0, 1 0, λ

string accepted or not (place a 1 for yes and 0 for no)


00 0

000 1
0000 0

101 1
0100 1

01001 1

10010 0

Q2. Construct an NFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: w ϵ {a, b}*, |w| = 2}.

a, b a, b
q0 q1 q2
Q3. Construct an NFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: w ϵ {a, b}*, |w| ≥ 2}.

a, b
a, b a, b
q0 q1 q2

Q4. Construct an NFA that accepts the following language on the alphabet Σ = {a, b}.
L = {aw: w ϵ {a, b}*}, i.e., strings which start with a.

a, b
a
q0 q1

Q5. Construct an NFA that accepts the following language on the alphabet Σ = {a, b}.
L = {wa: w ϵ {a, b}*}, i.e., strings which end with a.

a, b
a
q0 q1

Q6. Construct an NFA that accepts the following language on the alphabet Σ = {a, b}.
L = {wav: w, v ϵ {a, b}*}, i.e. strings which contain at least one 'a'.

a, b a, b
a
q0 q1
Q7. Write down the formal language that the following NFA accepts, where Σ = {a, b}.

a, b a, b
q0 q1 q2

L = { w: w ϵ {a, b}*, |w| ≤ 2}.

Q8. Write down the formal language that the following NFA accepts, where Σ = {a, b}.
a, b
a b
q0 q1 q2

L = { abw: w ϵ {a, b}*}, i.e., strings which start with ab.

Q9. Write down the formal language that the following NFA accepts, where Σ = {a, b}.
a, b a, b
a b
q0 q1 q2

L = { wabv: w, v ϵ {a, b}*}, i.e. strings which contain 'ab'.

Q10. Write down the formal language that the following NFA accepts, where Σ = {a, b}.
a, b
a b
q0 q1 q2

L = { wab: w ϵ {a, b}*}, i.e., strings which end with ab.

Q11. Write down the formal language that the following NFA accepts, where Σ = {a, b}.

a a
q1 q2 q3
a

q0
a
a
q4 q5

L = { a3 } U { a2n : n ≥ 1 }

You might also like