Alphabet An alphabet is a set of letters. e.g., {a, b, c, . . . , z} e.g., {α, β, . . . , ω} e.g., {a, b, c} e.g., {a, b} e.g., {0} (unary alphabet) e.g., {0, 1} (binary alphabet) e.g., {N, S, E, W} (compass alphabet) We use the symbol Σ for alphabet and σ for a letter Σ = {a, b} and σ ∈ Σ, for example, σ = a Word A word is a sequence of letters over some alphabet. A word is also called a string: e.g., aab over the alphabet {a, b} e.g., aabb over the alphabet {a, b} e.g., b over the alphabet {a, b} e.g., aab also a word over {a, b, c}. 0011 is a word over the binary alphabet, we call such words “binary strings”. Length of a word A string has a length which is the number of letters in the word. For example suppose Σ = {a, b, c} and w = abc then |w| = 3 If w = aa then |w| = 2 Suppose we have the binary alphabet {0, 1}. How many words of length 1? 2 (0, 1) How many words of length 2? 4 How many words of length 3? 8 Claim: the number of words is the number of letters in the alphabet raised to the number of letters in the word. That is, there are |Σ|i words of length i
- ver Σ.
Suppose our alphabet is {a, b, c}. Then the words of length 1 are: a, b, c. The words of length 2 are: aa, ab, ac, ba, bb, bc, ca, cb, cc. Empty word How many words of length 0 over the alphabet {a, b}? 20 = 1 How many words of length 0 over the alphabet {a, b, c}? 30 = 1 We use ǫ to represent the empty word. ǫ is a word over every alphabet Thus if we have two words, x, y, and |x| = 0 and |y| = 0 then x = y ǫ is the empty word, it is a word that has no length and therefore consists of no letters. An alphabet is a set of letters, so ǫ is never a letter in an alphabet. That is, words and letters are different types. Another point: the one-letter word “a” is not the same as the letter “a”.