Uploaded by trungho820

HW4 (1)

advertisement
1.
2.
3.
4.
(4pts) Find an NFA that accepts the language 𝐿 = (𝑎𝑎∗ (𝑎 + 𝑏)).
(5pts) Find a regular expression for the set {𝑎𝑛 𝑏 𝑚 : (𝑛 + 𝑚) 𝑖𝑠 𝑜𝑑𝑑}.
(5pts) Find a regular expression for 𝐿 = {𝑎𝑏 𝑛 𝑤: 𝑛 ≥ 4, 𝑤 ∈ {𝑎, 𝑏}+ }.
(6pts) Use the construction in Theorem 3.1 to find an NFA that accepts the language 𝐿 =
(𝑎𝑎∗ 𝑎𝑎 + 𝑏𝑏𝑎∗ 𝑎𝑏)
1.
L(aa*) L(a+b)
(L(aa))* (L(a) ∪ L(b))
{λ,a,aa,aaa,…}{a,b}
{a,aa,aaa,…,b,ab,aab,…}.
a
q1
a
q2
a,b
q3
2.
Either the number of a a’s is odd and the number of bb’s is even or vise versa. A
regular expression is (aa)∗ (a+ b) (bb)∗(aa) ∗ (a + b) (bb)∗.
Download