0% found this document useful (0 votes)
238 views

Block-3 MS-031 Unit-2

This document discusses models for executing algorithms, specifically finite automata (FA). It begins by introducing regular expressions and defining concepts like alphabets, strings, languages, and concatenation of strings. It then defines Kleene closure and regular expressions more formally. Kleene closure (Σ*) refers to the set of all possible strings over an alphabet, including the empty string. Regular expressions allow defining languages using operations like concatenation, union, and Kleene closure. The document provides examples of regular expressions and languages over simple alphabets. It introduces finite automata as a model for computation of regular languages.

Uploaded by

Arjun Sharad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
238 views

Block-3 MS-031 Unit-2

This document discusses models for executing algorithms, specifically finite automata (FA). It begins by introducing regular expressions and defining concepts like alphabets, strings, languages, and concatenation of strings. It then defines Kleene closure and regular expressions more formally. Kleene closure (Σ*) refers to the set of all possible strings over an alphabet, including the empty string. Regular expressions allow defining languages using operations like concatenation, union, and Kleene closure. The document provides examples of regular expressions and languages over simple alphabets. It introduces finite automata as a model for computation of regular languages.

Uploaded by

Arjun Sharad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Models for Executing

UNIT 3 MODELS FOR EXECUTING Algorithms-I: FA

ALGORITHMS-I: FA
Structure Page Nos.
3.0 Introduction 47
3.1 Objectives 47
3.2 Regular Expressions 47
3.2.1 Introduction to Defining of Languages
3.2.2 Kleene Closure Definition
3.2.3 Formal Definition of Regular Expressions
3.2.4 Algebra of Regular Expressions
3.3 Regular Languages 53
3.4 Finite Automata 54
3.4.1 Definition
3.4.2 Another Method to Describe FA
3.5 Summary 59
3.6 Solutions/Answers 59
3.7 Further Readings 60

3.0 INTRODUCTION
In the earlier two blocks and unit 1 and unit 2 of this block, we discussed a number of
issues and techniques about designing algorithms. However, there are a number of
problems for each of which, no algorithmic solution exists. Examples of such
problems will be provided in unit 2 of block 4. However, many of these examples are
found from the discipline of the well-known models of computation viz., finite
automata, push-down automata and Tuning machines. In this unit, we discuss the
topic of Finite Automata.

3.1 OBJECTIVES
After studying this unit, you should be able to:

• define a finite automata for computation of a language;


• obtain a finite automata for a known language;
• create a grammar from language and vice versa;
• explain and create context free grammar and language;
• define the pushdown automata;
• apply the pumping lemma for non-context free languages; and
• find the equivalence of context free grammar and Pushdown Automata.

3.2 REGULAR EXPRESSIONS


In this unit, first we shall discuss the definitions of alphabet, string, and language with
some important properties.

3.2.1 Introduction to Defining of Languages


For a language, defining rules can be of two types. The rules can either tell us how to
test a string of alphabet letters that we might be presented with, to see if it is a valid
word, i.e., a word in the language or the rules can tell us how to construct all the
words in the language by some clear procedures.

47
Design Techniques-II Alphabet: A finite set of symbols/characters. We generally denote an alphabet by Σ.
If we start an alphabet having only one letter, say, the letter z, then Σ = {z}.

Letter: Each symbol of an alphabet may also be called a letter of the alphabet or
simply a letter.

Language over an alphabet: A set of words over an alphabet. Languages are


denoted by letter L with or without a subscript.

String/word over an alphabet: Every member of any language is said to be a string


or a world.

Example 1: Let L1 be the language of all possible strings obtained by


L1 = {z, zz, zzz, zzzz . . . . . .}

This can also be written as


L1 = {zn} for n = 1, 2, 3, …..

A string of length zero is said to be null string and is represented by ∧.


Above given language L1 does not include the null string. We could have defined it
so as to include ∧. Thus, L = {zn⏐n=0, 1, 2, 3…} contains the null string.

In this language, as in any other, we can define the operation of concatenation, in


which two strings are written down side by side to form a new longer string. Suppose
u = ab and v = baa, then uv is called concatenation of two strings u and v and is
uv = abbaa and vu = baaab. The words in this language clearly analogous to the
positive integers, and the operation of concatenation are analogous to addition:

zn concatenated with zm is the word zn+m.

Example 2: If the word zzz is called c and the word zz is called d, then the word
formed by concatenating c and d is
cd = zzzzz
When two words in our language L1 are concatenated they produce another word in
the language L1. However, this may not be true in all languages.

Example 3: If the language is L2 = {z, zzz, zzzzz, zzzzzzz…..}


= {zodd}
= {z2n+1 for n = 0, 1, 2, 3….}
then c = zzz and d = zzzzz are both words in L2, but their concatenation cd = zzzzzzzz
is not a word in L2. The reason is simple that member of L2 are of odd length while
after concatenation it is of even length.

Note: The alphabet for L2 is the same as the alphabet for L1.

Example 4: A Language L3 may denote the language having strings of even lengths
include of length 0. In other words, L3 = {∧, zz, zzzz, …..}

Another interesting language over the alphabet Σ = {z} may be

Example 5: L4 = {zp : p is a prime natural number}.


There are infinitely many possible languages even for a single letter alphabet
Σ = {z}.

In the above description of concatenation we find very commonly, that for a single
letter alphabet when we concatenate c with d, we get the same word as when we
concatenate d with c, that is cd = dc But this relationship does not hold for all

48
languages. For example, in the English language when we concatenate “Ram” and Models for Executing
Algorithms-I: FA
“goes” we get “Ram goes”. This is, indeed, a word but distinct from “goes Ram”.

Now, let us define the reverse of a language L. If c is a word in L, then reverse (c) is
the same string of letters spelled backward.
The reverse (L) = {reverse (w), w∈L}

Example 6: Reverse (zzz) = zzz


Reverse (173) = 371

Let us define a new language called PALINDROME over the alphabet Σ = {a,b}.

PALINDROME = {∧, and all strings w such that reverse (w) = w}

= {∧, a, b, aa, bb, aaa, aba, bab, bbb, aaaa, abba, …}

Concatenating two words in PALINDROME may or may not give a word in


palindrome, e.g., if u = abba and v = abbcba, then uv = abbaabbcbba which is not
palindrome.

3.2.2 Kleene Closure Definition


Suppose an alphabet Σ, and define a language in which any string of letters from Σ is a
word, even the null string. We shall call this language the closure of the alphabet.
We denote it by writing * after the name of the alphabet as a superscript, which is
written as Σ*. This notation is sometimes also known as Kleene Star.

For a given alphabet Σ, the language L consists of all possible strings, including the
null string.

For example, If Σ = {z}, then, Σ* = L1 = {∧, z, zz, zzz …..}

Example 7: If Σ = {0, 1}, then, Σ* = {∧, 0, 1, 00, 01, 10, 11, 000, 001 …..}
So, we can say that Kleene Star is an operation that makes an infinite language of
strings of letters out of an alphabet, if the alphabet, Σ ≠ φ. However, by the definition
alphabet Σ may also be φ . In that case, Σ* is finite. By “infinite language, we mean a
language with infinitely many words.

Now, we can generalise the use of the star operator to languages, i.e., to a set of
words, not just sets of alphabet letters.

Definition: If s is a set of words, then by s* we mean the set of all finite strings
formed by concatenating words from s, where any word may be used as often.

Example 8: If s = {cc, d}, then


s* = {∧ or any word composed of factors of cc and d}
= {∧ or all strings of c’s and d’s in which c’s occur in even clumps}.
The string ccdcccd is not in s* since it has a clump of c’s of length 3.
{x : x = ∧ or x = (cc) i1 d j1 (cc) i 2 d j2 ......(cc) i m (d) jm } where i1, j1,….. im, jm ≥ 0 .

Positive Closure: If we want to modify the concept of closure to refer to only the
concatenation leading to non-null strings from a set s, we use the notation + instead of
*. This plus operation is called positive closure.

Theorem 1: For any set s of strings prove that s* = (s*)* = s**

Proof: We know that every word in s** is made up of factors from s*.

49
Design Techniques-II Also, every factor from s* is made up of factors from s.

Therefore, we can say that every word in s** is made up of factors from s.

First, we show s** ⊂s*. (i)


Let x ∈ s …. Then x = x1…..xn for some x1 ∈ s which implies s**⊂s*
** *

Next, we show s* ⊂s**.


s* ⊂s** (ii)

By above inclusions (i) and (ii), we prove that


s* = s**

Now, try some exercises.

Ex.1) If u = ababb and v = baa then find


(i) uv (ii) vu (iii) uv (iv) vu (v) uuv.

Ex.2) Write the Kleene closure of the following:


(i) {aa, b}
(ii) {a, ba}

3.2.3 Formal Definition of Regular Expressions


Certain sets of strings or languages can be represented in algebraic fashion, then these
algebraic expressions of languages are called regular expressions. Regular
expressions are in Bold face. The symbols that appear in regular use of the letters of
the alphabet Σ are the symbol for the null string ∧, parenthesis, the star operator, and
the plus sign.

The set of regular expressions is defined by the following rules:

1. Every letter of Σ can be made into a regular expression ∧ itself is a regular


expression.
2. If l and m are regular expressions, then so are
(i) (l)
(ii) lm
(iii) l+m
(iv) l*
(v) l+ = ll*
3. Nothing else is regular expression.

For example, now we would build expression from the symbols 0,1 using the
operations of union, concatenation, and Kleene closure.
(i) 01 means a zero followed by a one (concatenation)
(ii) 0+1 means either a zero or a one (union)
(iii) 0* means ∧+0+00+000+….. (Kleen closure).

With parentheses, we can build larger expressions. And, we can associate meanings
with our expressions. Here’s how

Expression Set represented


(0+1)* all strings over {0,1}
0*10*10* strings containing exactly two ones
(0+1)*11 strings which end with two ones.

50
The language denoted/represented by the regular expression R is L(R). Models for Executing
Algorithms-I: FA
Example 9: The language L defined by the regular expression ab*a is the set of all
strings of a’s and b’s that begin and end with a’s, and that have nothing but b’s inside.
L = {aa, aba, abba, abbba, abbbba, }
Example 10: The language associated with the regular expression a*b* contains all
the strings of a’s and b’s in which all the a’s (if any) come before all the b’s (if any).

L = {∧, a, b, aa, ab, bb, aaa, aab, abb, bbb, aaa,…)


Note that ba and aba are not in this language. Notice also that there need not be the
same number of a’s and b’s.

Example 11: Let us consider the language L defined by the regular expression
(a+b)* a(a+b)*. The strings of the language L are obtained by concatenating a string
from the language corresponding to (a+b)* followed by a string from the language
associated with (a+b)*. We can also say that the language is a set of all words over the
alphabet Σ = {a,b} that have an a in them somewhere.

To make the association/correspondence/relation between the regular expressions and


their associated languages more explicit, we need to define the operation of
multiplication of set of words.

Definition: If S and T are sets of strings of letters (they may be finite or infinite sets),
we define the product set of strings of letters to be. ST = {all combinations of a string
from S concatenated with a string from T in that order}.

Example 12: If S = {a, aa, aaa}, T = {bb, bbb}


Then, ST = {abb, abbb, aabb, aabbb, aaabb, aaabbb}.

Example 13: If S = {a bb bab}, T = {∧ bbbb}


Then, ST = {a bb bab abbbb bbbbbb babbbbb}

Example 14: If L is any language, Then, L∧ = ∧L = L.

Ex.3) Find a regular expression to describe each of the following languages:


(a) {a,b,c}
(b) {a,b,ab,ba,abb,baa,….}
(c) {∧,a,abb,abbbb,….}

Ex.4) Find a regular expression over the alphabet {0,1,} to describe the set of all
binary numerals without leading zeroes (except 0 itself). So the language is
the set
{0,1,10,11,100,101,110,111,…}.

3.2.4 Algebra of Regular Expressions


There are many general equalities for regular expressions. We will list a few simple
equalities together with some that are not so simple. All the properties can be verified
by using properties of languages and sets. We will assure that R,S and T denote the
arbitrary regular expressions.

Properties of Regular Expressions


1. (R+S)+T = R+(S+T)

51
Design Techniques-II 2. R+R = R
3. R+φ = φ+R = R.
4. R+S = S+R
5. Rφ = φR = φ
6. R∧ = ∧R = R
7. (RS)T = R(ST)
8. R(S+T) = RS+RT
9. (S+T)R = SR+TR
10. φ* = ∧* = ∧
11. R*R* = R* = (R*)*
12. RR* = R*R = R* = ∧+RR*
13. (R+S)* = (R*S*)* = (R*+S*)* = R*S* = (R*S)*R* = R*(SR*)*
14. (RS)* = (R*S*)* = (R*+S*)*

Theorem 2: Prove that R+R = R


Proof : We know the following equalities:
L(R+R) = L(R)UL(R) = L(R)
So R+R = R
Theorem 3: Prove the distributive property
R(S+T) = RS+RT
Proof: The following set of equalities will prove the property:

L(R (S+T)) = L(R)L(S+T)


= L(R)(L(S)UL(T))
= (L(R)L(S))U(L(R)L(T))
= L(RS+RT)
Similarly, by using the equalities we can prove the rest. The proofs of the rest of the
equalities are left as exercises.

Example 15: Show that R+RS*S = a*bS*, where R = b+aa*b and S is any regular
expression.

R+RS*S = R∧+RS*S (property 6)

= R(∧+S*S) (property 8)

= R(∧+SS*) (property 12)

= RS* (property 12)

= (b+aa*b)S* (definition of R)
= (∧+aa*) bS* (properties 6 and 8)

= a*bS*. (Property 12)


Try an exercise now.

Ex.5) Establish the following equality of regular expressions:


b*(abb*+aabb*+aaabb*)* = (b+ab+aab+aaab)*

52
As we already know the concept of language and regular expressions, we have an Models for Executing
Algorithms-I: FA
important type of language derived from the regular expression, called regular
language.

3.3 REGULAR LANGUAGES


Language represented by a regular expression is called a regular language. In other
words, we can say that a regular language is a language that can be represented by a
regular expression.

Definition: For a given alphabet Σ, the following rules define the regular language
associated with a regular expression.

Rule 1: φ,{∧} and {a} are regular languages denoted respectively by regular
expressions φ and ∧.

Rule 2: For each a in Σ, the set {a} is a regular language denoted by the regular
expression a.

Rule 3: If l is a regular expression associated with the language L and m is a regular


expression associated with the language M, then:

(i) The language = {xy : x∈L and y∈M} is a regular expression associated with the
regular expression lm.

(ii) The regular expression l+m is associated with the language formed by the union
of the sets L and M.

language (l+m) = L∪M


(iii) The language associated with the regular expression (l)* is L*, the Kleen Closure
of the set L as a set of words:
language (l*) = L*.
Now, we shall derive an important relation that, all finite languages are regular.

Theorem 4: If L is a finite language, then L can be defined by a regular expression.


In other words, all finite languages are regular.

Proof: A language is finite if it contains only finitely many words.

To make one regular expression that defines the language L, turn all the words in L
into bold face type and insert plus signs between them. For example, the regular
expression that defines the language L = {baa, abbba, bababa} is baa + abbba +
bababa.

Example 16: If L = {aa, ab, ba, bb}, then the corresponding regular expression is
aa + ab +ba + bb.

Another regular expression that defines this language is (a+b) (a+b).

So, a particular regular language can be represented by more than one regular
expressions. Also, by definition, each regular language must have at least one regular
expression corresponding to it.
Try some exercises.

Ex.6) Find a language to describe each of the following regular expressions:


(a) a+b (b) a+b* (c) a*bc*+ac

53
Design Techniques-II Ex.7) Find a regular expression for each of the following languages over the
alphabet {a,b}.
(a) strings with even length.
(b) strings containing the sub string aba.

In our day to day life we oftenly use the word Automatic. Automation is the process
where the output is produced directly from the input without direct involvement of
mankind. The input passes from various states in process for the processing of a
language we use very important finite state machine called finite automata.

3.4 FINITE AUTOMATA


Finite automata are important in science, mathematics, and engineering. Engineers
like them because they are superb models for circuits (and, since the advent of VLSI
systems sometimes finite automata represent circuits.) computer scientists adore them
because they adapt very likely to algorithm design. For example, the lexical analysis
portion of compiling and translation. Mathematicians are introduced by them too due
to the fact that there are several nifty mathematical characterizations of the sets they
accept.

Can a machine recognise a language? The answer is yes for some machine and some
elementary class of machines called finite automata. Regular languages can be
represented by certain kinds of algebraic expressions by Finite automaton and by
certain grammars. For example, suppose we need to compute with numbers that are
represented in scientific notation. Can we write an algorithm to recognise strings of
symbols represented in this way? To do this, we need to discuss some basic
computing machines called finite automaton.

An automata will be a finite automata if it accepts all the words of any regular
language where language means a set of strings. In other words, The class of regular
language is exactly the same as the class of languages accepted by FA’s, a
deterministic finite automata.

3.4.1 Definition
A system where energy and information are transformed and used for performing
some functions without direct involvement of man is called automaton. Examples are
automatic machine tools, automatic photo printing tools, etc.

A finite automata is similar to a finite state machine. A finite automata consists of


five parts:
(1) a finite set of states;
(2) a finite set of alphabets;
(3) an initial state;
(4) a subset of set of states (whose elements are called “yes” state or; accepting
state;) and
(5) a next-state function or a transition state function.

A finite automata over a finite alphabet A can be thought of as a finite directed graph
with the property that each node omits one labelled edge for each distinct element of
A. The nodes are called states. There is one special state called the start (or initial)
state, and there is a possible empty set of states called final states.

For example, the labelled graph in Figure1 given below represents a DFA over the
alphabet A = {a,b} with start state 1 and final state 4.

54
Models for Executing
Algorithms-I: FA

Figure 1: Finite automata

We always indicate the start state by writing the word start with an arrow painting to
it. Final states are indicated by double circle.

The single arrow out of state 4 labelled with a,b is short hand for two arrows from
state 4, going to the same place, one labelled a and one labelled b. It is easy to check
that this digraph represents a DFA over {a,b} because there is a start state, and each
state emits exactly two arrows, one labelled with a and one labelled with b.

So, we can say that a finite automaton is a collection of three tuples:


1. A finite set of states, one of which is designated as the initial state, called the start
state, and some (may be none) of which we designated as final states.

2. An alphabet Σ of possible input letters from which are formed strings that are to
be read one letter at a time.

3. A finite set of transitions that tell for each state and for each letter of the input
alphabet which state to go to next.

For example, the input alphabet has only two letters a and b. Let us also assume that
there are only three states, x, y and z. Let the following be the rules of transition:
1. from state x and input a go to state y;

2. from state x and input b go to state z;

3. from state y and input b go to state x;

4. from state y and input b go to state z; and

5. from state z and any input stay at state z.

Let us also designate state x as the starting state and state z as the only final state.
Let us examine what happens to various input strings when presented to this FA. Let
us start with the string aaa. We begin, as always, in state x. The first letter of the
string is an a, and it tells us to go state y (by rule 1). The next input (instruction) is
also an a, and this tells us (by rule 3) to go back to state x. The third input is another
a, and (by Rule 1) again we go to the state y. There are no more input letters in the

55
Design Techniques-II input string, so our trip has ended. We did not finish in the final state (state z), so we
have an unsuccessful termination of our run.

The string aaa is not in the language of all strings that leave this FA in state z. The set
of all strings that do leave as in a final state is called the language defined by the finite
automaton. The input string aaa is not in the language defined by this FA. We may
say that the string aaa is not accepted by this FA because it does not lead to a final
state. We may also say “aaa is rejected by this FA.” The set of all strings accepted is
the language associated with the FA. So, we say that L is the language accepted by
this FA. FA is also called a language recogniser.

Let us examine a different input string for this same FA. Let the input be abba. As
always, we start in state x. Rule 1 tells us that the first input letter, a, takes us to state
y. Once we are in state y we read the second input letter, which is ab. Rules 4 now
tells us to move to state z. The third input letter is a b, and since we are in state z,
Rule 5 tells us to stay there. The fourth input letter is an a, and again Rule 5 says state
z. Therefore, after we have followed the instruction of each input letter we end up in
state z. State z is designated as a final state. So, the input string abba has taken us
successfully to the final state. The string abba is therefore a word in the language
associated with this FA. The word abba is accepted by this FA.

It is not difficult for us to predict which strings will be accepted by this FA. If an
input string is made up of only the letter a repeated some number of times, then the
action of the FA will be jump back and forth between state x and state y. No such
word can ever be accepted.

To get into state z, it is necessary for the string to have the letter b in it as soon as a b
is encountered in the input string, the FA jumps immediately to state z no matter what
state it was before. Once in state z, it is impossible to leave. When the input strings
run out, the FA will still be in state z, leading to acceptance of the string.

So, the FA above will accept all the strings that have the letter b in them and no other
strings. Therefore, the language associated with this FA is the one defined by the
regular expression (a+b)* b(a+b)*.

The list of transition rules can grow very long. It is much simpler to summarise them
in a table format. Each row of the table is the name of one of the states in FA, and
each column of this table is a letter of the input alphabet. The entries inside the table
are the new states that the FA moves into the transition states. The transition table for
the FA we have described is:

Table 1
Input
State
a b
Start x y z
y x z
Final z z z

The machine we have already defined by the transition list and the transition table can
be depicted by the state graph in Figure 2.

56
Models for Executing
Algorithms-I: FA

Figure 2: State transition graph

Note: A single state can be start as well as final state both. There will be only one
start state and none or more than one final states in Finite Automaton.

3.4.2 Another Method to Describe FA


There is a traditional method to describe finite automata which is extremely intuitive.
It is a picture called a graph. The states of the finite automaton appear as vertices of
the graph while the transitions from state to state under inputs are the graph edges.
The state graph for the same machine also appears in Figure 3 given below.

Figure 3: Finite automata

The finite automata shown in Figure 3 can also be represented in Tabular form as
below:

Table 2
Input
State 0 1 Accept?

Start 1 1 2 No
Final 2 2 3 Yes
3 3 3 No

Before continuing, let’s examine the computation of a finite automaton. Our first
example begins in state one and reads the input symbols in turn changing states as
necessary. Thus, a computation can be characterized by a sequence of states. (Recall
that Turing machine configurations needed the state plus the tape content. Since a
finite automata on never writes, we always know what is on the tape and need only
look at a state as a configuration). Here is the sequence for the input 0001001.

Input Read : 0 0 0 1 0 0 1
States : 1 → 1 → 1 → 1 → 2 → 2 → 2 → 3

Example 17 (An elevator controller): Let’s imagine an elevator that serves two
floors. Inputs are calls to a floor either from inside the elevator or from the floor
itself. This makes three distinct inputs possible, namely:

57
Design Techniques-II 0 - no calls
1 - call to floor one
2 - call to floor two

The elevator itself can be going up, going down, or halted at a floor. If it is on a floor,
it could be waiting for a call or about to go to the other floor. This provides us with
the six states shown in Figure 4 along with the state graph for the elevator controller.

W1 Waiting on first floor


U1 About to go up
UP Going up
DN Going down
W2 Waiting-second floor
D2 About to go down.

Figure 4: Elevator control

A transition state table for the elevator is given in Table 3:

Table 3: Elevator Control

State Input
None call to 1 call to 2
W1 (wait on 1) W1 W1 UP
U1 (start up) UP U1 UP
UP W2 D2 W2
DN W1 W1 U1
W2 (wait on 2) W2 DN W2
D2 (start down) DN DN D2

Accepting and rejecting states are not included in the elevator design because
acceptance is not an issue. If we were to design a more sophisticated elevator, it
might have states that indicated:

Finite automata
a) power faukyrem
b) overloading, or
c) breakdown

In this case, acceptance and rejection might make sense.

58
Let us make a few small notes about the design. If the elevator is about to move ( i.e., Models for Executing
Algorithms-I: FA
in state U1 or D2) and it is called to the floor it is presently on it will stay. (This may
be good Try it next time you are in an elevator.) And, if it is moving (up or down)
and gets called back the other way, it remembers the call by going to the U1 or D2
state upon arrival on the next floor. Of course, the elevator does not do things like
open and close doors (these could be states too) since that would have added
complexity to the design. Speaking of complexity, imagine having 100 floors.
That is our levity for this section. Now that we know what a finite automaton is, we
must (as usual) define it precisely.

Definition : A finite automation M is a quintuple M = (Q,Σ,δ,qO,F) where :

Q is a finite set (of states)


Σ is a finite alphabet (of input symbols)
δ: Q × Σ → Q (next state function)
qO∈Q (the starting state)
F⊆Q (the accepting states)

We also need some additional notation. The next state function is called the transition
function and the accepting states are often called final states. The entire machine is
usually defined by presenting a transition state table or a transition diagram. In this
way, the states, alphabet, transition function, and final states are constructively
defined. The starting state is usually the lowest numbered state. Our first example of
a finite automaton is:

M = ({q1, q2, q3}, {0,1}, δ, q1, {q2}

Where the transition function δ, is defined explicitly by either a state table or a state
graph.

3.5 SUMMARY
In this unit we introduced several formulations for regular languages, regular
expressions are algebraic representations of regular languages. Finite Automata are
machines that recognise regular languages. From regular expressions, we can derive
regular languages. We also made some other observations. Finite automata can be
used as output devices - Mealy and Moore machines.

3.6 SOLUTIONS/ANSWERS
Ex.1)
(i) ababbbaa
(ii) baaababb
(iii) ab abb ab abb
(iv) baa baa
(v) ababbababb baa

Ex.2)
(i) Suppose aa = x
Then { x, b}* = {∧, x, b, xx, bb, xb, bx, xxx, bxx, xbx, xxb, bbx, bxb, xbb,
bbb} substituting x = aa
{aa,b}* = { ∧, aa, b, aaaa, bb, aab, baa, aaaaaa, baaaa, aabaa,

(ii) {a,ba}*= { ∧, a, ba, aa, baba, aba, baa, … }

59
Design Techniques-II Ex.3)
(a) a+b+c
(b) ab*+ba*
(c) ∧+a(bb)*

Ex.4)
0+1(0+1)*

Ex.5)
Starting with the left side and using properties of regular expressions, we get
b*(abb* + aabb*+aaabb*)*
= b*((ab+aab+aaab)b*)* (property 9)
= (b + ab + aab + aaab)* (property 7).

Ex.6)
(a) {a,b}
(b) {a,∧,b,bb,….bn,….}
(c) {a,b,ab,bc,abb,bcc,…abn,bcn,….}

Ex.7)
(a) (aa+ab+ba+bb)*
(b) (a+b)*aba(a+b)*

3.7 FURTHER READINGS


1. Elements of the Theory of Computation, H.R. Lewis & C.H.Papadimitriou, PHI,
(1981).

2. Introduction to Automata Theory, Languages, and Computation (II Ed.), J.E.


Hopcroft, R.Motwani & J.D.Ullman: Pearson Education Asia (2001).

3. Introduction to Automata Theory, Language, and Computation, J.E. Hopcroft


and J.D. Ullman: Narosa Publishing House (1987).

4. Introduction to Languages and Theory of Computation, J.C. Martin,


Tata-Mc Graw-Hill (1997).

5. Computers and Intractability – A Guide to the theory of NP-Completeness,


M.R. Garey & D.S. Johnson: W.H. Freeman and Company (1979).

60

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy