Notes Module 1
Notes Module 1
Alphabet
An alphabet is a finite non-empty set of symbols. It is
usually denoted by the Greek capital letter ∑. Typical
examples of alphabets are the binary alphabet {0, 1} and
the set of lower case English letters {a, b, c, ..., z}.
String
A string is a finite sequence of symbols from an alphabet.
It is usually denoted by w. The length of a string w,
denoted |w|, is the number of symbols in the sequence
w. For example |abc| = 3 and |01001| = 5. We also have
the empty string containing no symbol (or 0 symbols),
which is denoted by the Greek letter ͼ (epsilon). |ͼ| = 0.
Power of an Alphabet
If n ≥ 0 is an integer, ∑n represents the set of all strings
using ∑ as the alphabet. Note that ∑0 = {ͼ}. Now, the set
of all strings over ∑, represented as ∑* is defined as ∑0 U
∑1 U ∑2 U ∑3 U ∑4 ... where U represents set union
operator.
Language
A language over an alphabet is a set of strings using that
alphabet. That is, a language L over ∑ is given by L
subset of ∑*. Note that L can be either finite or infinite.
An example of a finite language over {0, 1} is {01, 11,
0011, 000011} and an example of an infinite language
over {0, 1} is L = {w | w has the same number of 0’s as
1’s}
Finite Automata
Finite Automata are associated with regular expressions.
The language accepted by a finite automaton can be
represented as a regular expression. Similarly, a regular
expression that represents a language can be converted
to a finite automaton which accepts that language.
Example of DFA
The following transition diagram represents a DFA which
recognizes all strings which contain 101 as a substring.
Questions:
4. Give DFAs for recognizing the following languages over {0, 1}: (Give
both the transition diagram and the transition table.)
a. The set of all strings with an even number of 0’s.
b. The set of all strings with an even number of 1’s and an odd
number of 0’s.
c. The set of all strings containing 01 as a substring.
d. The set of all strings NOT containing 101 as a substring.
e. The set of all strings which when treated as a binary number is
a value divisible by 3.
f. The set of all strings containing the same number of 0’s as 1’s.
5. Give DFAs for recognizing the following languages over the alphabet of
lower case English letters {a, b, c, ..., z}: (Transition table is not
needed.)
a. The language L = {anil}
b. The language L = {anil, amit, anita, sunil}
c. The set of all strings containing sem as a substring.