The study of automata has been acquiring increasing importance for engineers in many fields. For some time, the capabilities of these automata have been of the greatest interest to logicians and mathematicians. However, the expanding literature on the use of finite automata as probabilistic models demonstrates the growing interest in the application of these mechanisms to engineering phenomena. We, the authors, became interested in these probabilistic models in an effort to develop a general self-adaptive control scheme based on the prediction of the future of the process to be controlled. Conceivably, an adequate model of a particular process could be generated by simply observing the process parameters. With this goal in mind we began an investigation of several different modeling techniques. The ability to model stochastic data was our primary concern. We feel that the results of several modeling experiments presented here may be of interest to our readers, and we hope to encourage the use of these techniques, especially in control applications. We have seen an example of use of finite automata in describing the operation of a simplified version of vending machine. Many other systems operating in practice can also be modeled by finite automata such as control circuits of computers, computer network communication protocols, lexical analysers for compilers etc. Many of those systems fall into the class of systems called reactive system. In the case of vending machine or communication protocol, on the other hand, a system must respond to each stimulus, even to a fragment of input such as each coin tossed in for a can of soda or every message received.

Applications of Regular Expression
1.Regular expressions in Unix
In the UNIX operating system various commands use an extended...

...C
H
A
P
T
E
R
Finite-State Machines and PushdownAutomata
The ﬁnite-state machine (FSM) and the pushdown automaton (PDA) enjoy a special place in computer science. The FSM has proven to be a very useful model for many practical tasks and deserves to be among the tools of every practicing computer scientist. Many simple tasks, such as interpreting the commands typed into a keyboard or running a calculator, can be modeled by ﬁnite-state machines. The PDA is a model to which one appeals when writing compilers because it captures the essential architectural features needed to parse context-free languages, languages whose structure most closely resembles that of many programming languages. In this chapter we examine the language recognition capability of FSMs and PDAs. We show that FSMs recognize exactly the regular languages, languages deﬁned by regularexpressions and generated by regular grammars. We also provide an algorithm to ﬁnd a FSM that is equivalent to a given FSM but has the fewest states. We examine language recognition by PDAs and show that PDAs recognize exactly the context-free languages, languages whose grammars satisfy less stringent requirements than regular grammars. Both regular and context-free grammar types are special cases of the phrasestructure grammars that are shown in Chapter...

...FINITEAUTOMATA AND REGULAREXPRESSION GENERATOR (FARE) – A PROPOSED COMPUTER-AIDED INSTRUCTION TOOL
LEO C. BERMUDEZ
ASIAN COLLEGE OF TECHNOLOGY
CEBU CITY, PHILIPPINES
MARCH 2006
FINITEAUTOMATA AND REGULAREXPRESSION GENERATOR (FARE) – A PROPOSED COMPUTER-AIDED INSTRUCTION TOOL
A Thesis Presented to the
Faculty and Staff of the Graduate School
Asian College of Technology
Cebu City, Philippines
In Partial fulfillment
Of the Requirement for the degree
MASTER OF SCIENCE IN COMPUTER SCIENCE
by
LEO C. BERMUDEZ
March 2006
… to my family, friends and colleagues
Of Asian College of Technology whom in one way or
another have helped in this success this humble piece of work is dedicated…
ACKNOWLEDGEMENT
A study like this is very hard to accomplish without the help of some individuals who are so selfless in giving their support. With this the proponent is very grateful to the following for their unselfish help to make this study possible:
To Engineer Rodrigo Abellanosa, Asian College of Technology President and his adviser for allowing him to make ACT the focus of his study. He is also very grateful for all the things he learned and all the support he received which inspired him to continue with this study. Without Sir Rod, this thesis would not have been realized.
To Sir Erwin, the Vice President for Academic Affairs, who has...

...1
Equivalence of FiniteAutomata and RegularExpressionsFiniteAutomata Recognize Regular Languages Theorem 1. L is a regular language iﬀ there is a regularexpression R such that L(R) = L iﬀ there is a DFA M such that L(M ) = L iﬀ there is a NFA N such that L(N ) = L. i.e., regularexpressions, DFAs and NFAs have the same computational power. Proof. • Given regularexpression R, will construct NFA N such that L(N ) = L(R)
• Given DFA M , will construct regularexpression R such that L(M ) = L(R)
2
RegularExpressions to NFA
RegularExpressions to FiniteAutomata . . . to Non-determinstic FiniteAutomata Lemma 2. For any regex R, there is an NFA NR s.t. L(NR ) = L(R). Proof Idea We will build the NFA NR for R, inductively, based on the number of operators in R, #(R). • Base Case: #(R) = 0 means that R is ∅, , or a (from some a ∈ Σ). We will build NFAs for these cases. • Induction Hypothesis: Assume that for regularexpressions R, with #(R) < n, there is an NFA NR s.t. L(NR ) = L(R). • Induction Step: Consider R with #(R) = n. Based on the form of R, the NFA NR will be built using the induction...

...(Union n in N and n >0)
=
Example : Let L = { a, ab }. Then we have,
=
= {e} {a, ab} {aa, aab, aba, abab} …
=
= {a, ab} {aa, aab, aba, abab} …
Note : e is in , for every language L, including .
The previously introduced definition of is an instance of Kleene star.
Automata and Grammars
Automata
An automata is an abstract computing device (or machine). There are different varities of such abstract machines (also called models of computation) which can be defined mathematically. Some of them are as powerful in principle as today's real computers, while the simpler ones are less powerful. ( Some models are considered even more powerful than any real computers as they have infinite memory and are not subject to physical constraints on memory unlike in real computers). Studying the simpler machines are still worth as it is easier to introduce some formalisms used in theory.
* Every automaton consists of some essential features as in real computers. It has a mechanism for reading input. The input is assumed to be a sequence of symbols over a given alphabet and is placed on an input tape(or written on an input file). The simpler automata can only read the input one symbol at a time from left to right but not change. Powerful versions can both read (from left to right or right to left) and change the input.
* The automaton can produce output of some form. If the output in...

...Contents
We have seen an example of use of finiteautomata in describing the operation of a simplified version of vending machine. Many other systems operating in practice can also be modeled by finiteautomata such as control circuits of computers, computer network communication protocols, lexical analysers for compilers etc. Many of those systems fall into the class of systems called reactive system. A reactive system is a system that changes its actions, outputs and conditions/status in response to stimuli from within or outside it. It is an event driven or control driven system continuously having to react to external and/or internal stimuli. The inputs for a reactive system are never ready unlike for example when two numbers are added together by an adder (Here we are considering an adder at a higher level of abstraction than physical devices level ignoring for example the transient states of the electronic circuit that realizes an adder). An adder does not respond unless the input i.e. two numbers to be added are ready. A system such as an adder is called a transformational system. In the case of vending machine or communication protocol, on the other hand, a system must respond to each stimulus, even to a fragment of input such as each coin tossed in for a can of soda or every message received.
It is generally agreed that finiteautomata are a natural medium to describe dynamic...

...Lesson 3 FiniteAutomata with Output
Three types of automata are studied in Formal Language Theory. *
Acceptor
The symbols of the sequence
s(1) s(2) … s(i) … s(t)
are presented sequentially to a machine M. M responds with a binary signal to each input. If the string scanned so far is accepted, then the light goes on, else the light is off.
A language acceptor
* Lesson 3 employs the treatment of this subject as found in Machines, Languages, and Computation by Denning, Dennis and Qualitz , Prentice-Hall.
Transducer
Abstract machines that operate as transducers are of interest in connection with the translation of languages. The following transducer produces a sentence
r(1) r(2) … r(n)
in response to the input sentence
s(1) s(2) … s(m)
If this machine is deterministic, then each sentence of an input language is translated into a specific sentence of an output language.
Generator
When M is started from its initial state, it emits a sequence of symbols
r(1) r(2) … r(i) … r(t)
from a set known as its output alphabet.
We will begin our study with the transducer model of abstract machine (or automaton). We often refer to such a device as a Finite State Machine (FSM) or as an automaton with output.
Finite State Machine (FSM)
The FSM model arises...

... Grammars, and Automata Theory
Discrete Mathematics
Linda Chalk
Colorado Technical University
Professor Timothy Manzke
December 17, 2010
Languages, grammars and automata theory are all related to computer applications. Grammar is the rule for language structure regardless of the meaning. For computer programming languages context free grammar (CFG) is commonly used. Formal language as opposed to natural language must be used with computer applications because natural language is too vague for computer applications. Automata is a way to test an expression to determine if it is part of the language (Pfeifer, 2005).
A deterministic finiteautomata (DFA) is a machine that is the most simple to understand which will help with the more complicated machines because many important properties of the DFA are found in the more complicated machines. DFA’s are found in many things like vending machines and elevators. The DFA works starting in a ‘start state’ then by reading a string, then producing an output of true or false according to how the machine is setup. As long as there is data entering the machine the output will change according to what was read in and how the configuration of the machine states what the output reports. A deterministic algorithm will always run the same way each time with the input of identical information (Sedgewick, n.d.). The difference between...

...language and two
that are not (assume Σ = {a, b}): (a) a(ba)∗ b (b) (a + ba + bb)Σ∗
Soln: (a) The strings
and a, for example. (b) The strings
and b, for example.
5. Construct an NFA that accepts the language described by the r.e. (01 + 001 + 010)∗
Son: See Fig. 3
1
0, 1
q0
0, 1
q0
0, 1
q1
0
1
q0
0
q1
q2
1
0
1
q3
0, 1
Figure 2: Figure for Solution of Problem 3 in Practice Sheet 1
0
q2
1
1
0
q0
q1
0
1
0
q3
Figure 3: Figure for Solution of Problem 5 in Practice Sheet 1
6. Let L be the language {w|w contains an equal number of occurrences of the substrings
01 and 10 }. Thus 101 is in L, while 1010 is not. Show that L is regular.
Soln: The language corresponding to the regularexpression 1+ (0+ 1+ )∗ + (0+ 1+ )∗ 0+
describes all such strings. This is obtained by generalizing the structure of the strings
101 and 010 (Note that: a+ = aa∗ ).
2
...