Exercises
2.1
Question
Let the alphabet , and let the language L = {w | w ∈ Σ∗, 1 ≤ |w| ≤ 2}. (If w is a word, |w| denotes the length of that word. If X is a finite set, like an alphabet or finite language, |X| denotes the number of elements in that set, its cardinality.) Answer the following questions:
- Describe L in plain English.
- Enumerate all the words in L.
- In general, for an arbitrary alphabet Σ1 and 0 ≤ m ≤ n, how many words are there in the language L1 = {w | w ∈ Σ∗ 1, m ≤ |w| ≤ n}? That is, write down an expression for |L1|.
- How many words would there be in L1 if Σ1 = Σ, m = 3, and n = 7?
Answer
- For all words in which the length of the word is greater or equal to 1, and less than or equal to 2.
- empty
- <- Size of the given alphabet.
2.2
Question
Let the alphabet Σ = {a, b, c} and let L1 = {ε, b, ac} and L2 = {a, b, ca} be
two languages over Σ. Enumerate the words in the following languages, showing
your calculations in some detail:
- L3 = L1 ∪ L2
- L4 = L1{ε}(L2 ∩ L1)
- L5 = L3∅L4
Answer
- -- Any language concatenated with the empty language will become the empty language
2.3
Question
Let the alphabet Σ = {a, b, c} and let L1 = {ε, b, bb} and L2 = {a, ab, abc} be two languages over Σ. Enumerate the words in the following languages, showing your calculations in some detail:
- L3 = L1 ∩ L2
- L4 = (L2{ε}L1) ∩ Σ∗
- L5 = L3∅ ∩ L4
Answer
- -- Empty set as nothing is shared
- Empty set
2.4
Quesiton
Let the alphabet Σ = {a, b, c}. Enumerate the words in
L = {w | w ∈ {ε, a, b, bc}∗, |w| ≤ 3}
Answer
Find all combinations up to the length 3