0% found this document useful (0 votes)
22 views4 pages

worksheet1 - DFA

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)
22 views4 pages

worksheet1 - DFA

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/ 4

CS-130 Theory of Computation

Worksheet-1: Deterministic Finite Automata (DFA)


Dr. Mohammed Khader

OBJECTIVES:
 Introduce Deterministic Finite Automata (DFA).
 Understand DFA transition graphs.
 Determine whether or not a string is accepted by a DFA.
 Describe the language accepted by a DFA (verbally or formally).

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

0 1

q0 q1 q2

1 1

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


00

101
0111

1101
100

1100

0001
01001

000011
0000110

Q2. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: w ϵ {a, b}*, w has exactly one a}.
Q3. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: w ϵ {a, b}*, w has at least one a}.

Q4. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: w ϵ {a, b}*, w ends with a}.

Q5. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {an, n ≥ 1}

Q6. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {a2n, n ≥ 0}
Q7. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {anbm, n,m ≥ 0}

Q8. Construct a DFA that accepts the following language on the alphabet Σ = {a, b}.
L = {w: |w| = 2}.

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

a, b

a, b a, b
q0 q1 q2

L={

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

b b

q1 a, b

L={
Q11. Find a DFA for the following languages:
A- L = {w: w ϵ {a, b}*, |w| is even}.
B- L = {w: w ϵ {a, b}*, na(w) is even}.
C- L = {w: w ϵ {a, b}*, na(w) is even and nb(w) is odd }.

You might also like