Regular Languages
Regular Languages
Exercises
2. Describe what the Kleene star operation * and the +-operation produce over the
following alphabets:
(a) Σ = {0,1}
L n = L 0 ∪ L 1 ∪ . . . ∪ L n = {ϵ,0,1,00,01,10,11,000,...}
⋃
L* =
n≥0
L+ = L n = L 1 ∪ L 2 ∪ . . . ∪ L n = {0,1,00,01,10,11,000,...}
⋃
n>0
(b) Σ = {a}
L n = L 0 ∪ L 1 ∪ . . . ∪ L n = {ϵ, a, aa, aaa, aaaa, . . . }
⋃
L* =
n≥0
L+ = L n = L 1 ∪ L 2 ∪ . . . ∪ L n = {a, aa, aaa, aaaa, . . . }
⋃
n>0
(c) Σ = ∅
L n = L 0 ∪ L 1 ∪ . . . ∪ L n = {ϵ}
⋃
L* =
n≥0
L+ = L n = L 1 ∪ L 2 ∪ . . . ∪ L n = ∅
⋃
n>0
(a) Σ* = {0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000}
Σ = {0,1}
(a) {010,101,11}
{ω ∈ Σ* | ω ≠ 11,ω ≠ 101,ω ≠ 010}
(b) Σ*\{110}
{ω ∈ Σ* | ω ≠ 110}
(c) Σ+ \{ϵ}
{ω ∈ Σ+}
7. Write down the following words over the alphabet {a, b} : a 5, b 0, a 4b 2, (ab)3.
a 5 = aaaaa
b 0 = ϵ
a 4b 2 = aaaabb
(ab)3 = ababab
8. For each of the following languages give some strings that belong to the language
and some that don’t.
(a) L0 = {0,00,01}
0,00,01 ∈ L0; 10,0110 ∉ L0
(b) L1 = {ϵ,0,00,101}
ϵ, ϵ0ϵ, ϵϵ00 ∈ L1; 1ϵ1,1 ∉ L1
(c) L 2 = {ω ∈ {0,1}* | | ω | ≤ 8}
01,10,00001 ∈ L 2; 0000011111 ∉ L 2
L ⋅ L* = L ⋅ (L 0 ∪ L 1 ∪ . . . ∪ L n) = L ⋅ L 0 ∪ L ⋅ L 1 ∪ . . . ∪ L ⋅ L n = L 1 ∪ L 2 ∪ . . . ∪ L n = L +
(a) Is ϵ in Σ?
No, it isn’t.
(c) Let x and y be two strings over Σ. Is it always true that x ⋅ y = y ⋅ x?
No, it isn’t.
12. Let x be a string and x rev be the same string read backwards. Prove that
(x y)rev = y rev x rev ∀x, y over an alphabet Σ.
x y = σ1σ2 . . . σnω1ω2 . . . ωn
rev
(x y) = ωnωn−1 . . . ω1σnσn−1 . . . σ1 = y rev x rev