Chapter 2:  Languages

The elements

Kleene closure of an alphabet (Clean-y) Kleene closure of a language

If L is a language, all the words (including l ) that can be formed from L (same process as for forming Kleene closure from a vocabulary) is called the Kleene closure of L, and is denoted by L*.  Similarly for L+.  If L contains l , then L+ contains l , otherwise not.

Palindromes

If w is a word, then reverse(w) is w with the letters reversed. Any word w such that w = reverse(w) is a palindrome. E. g. "able was I ere I saw elba" (this is a word that includes space as a character).

Factoring (or parsing)

L = { aba, aa, ba }.  Question: is w = abaabaaaba in L* ?
w can be factored as follows: (aba)(aba)(aa)(ba).  Notice that each "factor" is a word in L.  (This factorization proves that w is in L*)


Combinations (review of Discrete Math)

Example: you have seven people from which to select a committee of three. How many different committees?
Ans: the combinations of 7 things chosen 3 at a time. Mathematically:
"7 choose 3"  =  7C3  =   =  35

Christmas tree lights problem:
7 red lights, 3 green lights, 4 blue lights. How many different distinguishable strings of 14 lights are there?

Solution:
place the red lights - 14 places for them so we have 14C7 ways to place them
place the greens - 7 places left, so we have 7C3 ways to place them
place the blues - only one way to place the 4 blues in the 4 places left

Ans: 14C7 x 7C3 = 3432x35 = 120,120 different strings of lights!

Hosted by www.Geocities.ws

1