worksheet1 - DFA
worksheet1 - DFA
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
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 }.