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

Regular Languages

The document defines regular languages and provides examples of operations on languages like Kleene star and concatenation. It also gives exercises to test understanding of languages, including describing languages generated from alphabets, taking complements of languages, and proving properties of language operations.

Uploaded by

EverGarcía
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)
21 views4 pages

Regular Languages

The document defines regular languages and provides examples of operations on languages like Kleene star and concatenation. It also gives exercises to test understanding of languages, including describing languages generated from alphabets, taking complements of languages, and proving properties of language operations.

Uploaded by

EverGarcía
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

Regular languages

Exercises

1. Are Σ* and ∅ languages?




Yes. Indeed, Σ* is the set of all possible strings over all possible languages and ∅ is
the empty language, i.e., the language that contains no strings.


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

3. State the alphabet Σ for the following languages:

(a) Σ* = {0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000}


Σ = {0,1}


(b) Σ* = {a, aa, aaa, aaaa}




Σ = {a}

(c) Σ* = {ϵ}


Σ = {ϵ}

4. Given Σ = {0,1} construct the following complement languages:

(a) {010,101,11}


{ω ∈ Σ* | ω ≠ 11,ω ≠ 101,ω ≠ 010}


(b) Σ*\{110}


{ω ∈ Σ* | ω ≠ 110}


(c) Σ+ \{ϵ}


{ω ∈ Σ+}


5. Write down the 5 shortest strings of {0,1}*.




ϵ,0,1,00,01


6. Let x and y be strings over an alphabet Σ of length n = | x | and n = | y | . What is


the length of | x ⋅ y | ?


| x ⋅ y | = n + m


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


(d) L 3 = {ω ∈ {0,1}* | | ω | is odd}




0,111,01010 ∈ L 3; 11,0000 ∉ L 3


(e) L4 = {ω ∈ {0,1}* | ω starts with 001}




001,00110,00111 ∈ L4; ϵ01,0001 ∉ L4


(f) L5 = {ω ∈ {0,1}* | ω = 0 n, where n ∈ ℕ}




0,00,000 ∈ L5; 10,010000 ∉ L5


(g) L6 = {0 n1n | n ∈ ℕ}




0011,0000011111 ∈ L6; 0101,10 ∉ L6


9. Given a language N = {01,1,100}.

(a) Write down N 2 and N 3.




N 2 = N ⋅ N = {x y | x ∈ N, y ∈ N}

= {0101,011,01100,101,11,1100,10001,1001,100100}


N 3 = N 2 ⋅ N

= {010101,01011,0101100,01101,0111,011100,0110001,011001,

01100100,11001,1101,110100,1101,111,11100,110001,11001,

1100100,1000101,100011,10001100,100101,10011,1001100,

10010001,1001001,100100100}


(b) What is the lowest k such that 110001110011 ∈ N k?




The language is {01,1,100}.


By taking a closer look at the substrings of the given string, it can be seen that it’s
composed of the following pieces shown in color:


110001110011


7 substrings can be found. Hence, k = 7.

(c) Does it hold that 110001110011 ∈ N*?


N n = N 0 ∪ N 1 ∪ . . . ∪ L 7 ∪ . . . ∪ L n ⊇ 110001110011.


N* =
n≥0

(d) and that 1100011100110 ∈ N*?




1100011100110 ∉ N*


10. Let L be a language.

(a) In which conditions does it hold that ϵ ∈ L +?




When ϵ ∈ L.


(b) and L + = L*?




Same conditions as in (a).


(c) Prove that L + = L ⋅ L*.




Let L be a language where the Kleene Star operation can be applied. Then,


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 +

11. Let Σ be an alphabet, and let ϵ be the empty string over Σ.

(a) Is ϵ in Σ?


No, it isn’t.


(b) Does it hold that ϵ i = ϵ ∀i?




Yes, it does.


(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 Σ.

Let x = σ1σ2 . . . σn and y = ω1ω2 . . . ωn be strings over some alphabet Σ. Then,

x y = σ1σ2 . . . σnω1ω2 . . . ωn

rev
(x y) = ωnωn−1 . . . ω1σnσn−1 . . . σ1 = y rev x rev

You might also like