This preview shows pages 1–3. Sign up to view the full content.
Strings and Languages
A string is simply the concatenation of several letters in an
alphabet. Typically, we will define an alphabet as a set
Σ
. So,
for example, we could have
Σ
= {a,b}.
Then, a string over this alphabet
Σ
, would be any “word”
formed with only the letters or characters a and b. There is no
limit on the length of a string. It must simply be a non negative
integer.
This means there is a string of length of length 0. This is known
as the empty string. The empty string is typically denoted by
λ
.
In particular, if you concatenate the empty string with any
other string, you get back that string. It seems silly to have an
empty string, but it will help out in certain situations. Make
sure you do not confuse the empty string with the empty set.
Also, recognize that
λ
can never be a letter of an alphabet.
In the book, they define nonempty strings in the following
manner :
Σ
n
is a string of length n over the alphabet
Σ
, and is defined as
below:
1)
Σ
1
=
Σ
.
2)
Σ
n+1
= {xy  x
∈Σ
, y
∈Σ
n
}
And any string is simply a subset of
Σ
n
, where n is a positive
integer.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentUsing the book’s definition, we can define the following two
sets:
Σ
+
=
∪
n=1 to
∝
Σ
n
, or in English,
Σ
+
is the set of all strings of
positive length over an alphabet
Σ
.
Σ
*
=
∪
n=0 to
∝
Σ
n
, or in English,
Σ
*
is the set of all strings of over
an alphabet
Σ
.
Now, that we have these definitions, we can define a language.
A language L over an alphabet
Σ
is any subset of
Σ
*
. If a string
w
∈
L, then we say that the string w belongs in the language L.
Otherwise we say w does not belong in L. (For example, horse
∈
English, but gjtysihg
∉
English, to the best of my knowledge.)
In this class, we will focus on a specific type of language:
regular languages.
In particular, a language is a regular one if and only if it can be
expressed as a regular expression. You can think of a regular
expression as a mold. For example, when you are trying to find
a file on your computer, but don’t know the EXACT name of
the file, you may enter
Eric*.doc
because you know that you
are searching for a file whose name starts with Eric and is a
Word document.
In this situation, the string with a star in it is a mold applying
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '09

Click to edit the document details