Unit 3.-Finite Automatic: 3.1 Concepts: Definition and Classification of Finite Automata (AF) - Definition 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Translated from Spanish to English - www.onlinedoctranslator.

com

UNIT 3.-FINITE AUTOMATIC

3.1 Concepts: Definition and Classification of Finite Automata (AF).

Definition 1

The Finite Automaton is the most restrictive machine of all and of course it can be
defined as a particular case of a TM. We can also see it as an AP without a battery.
Obviously, when removing the battery, the only thing left is the finite input tape.
This abstract mathematical model represents the solution of the type 3 or LR
language acceptance problem. 3.1a

Definition 2

They are formal machines used to recognize regular languages. Simpler


languages, the languages that are generated by regular grammars. With this it
follows that a finite automaton is; a machine with a finite number of states that
reads symbols from an infinite input tape. The behavior of the machine is
determined solely by the state it is in and the symbol on the input tape. Reading a
symbol from the input tape changes state and advances on the input tape. When
there are no more symbols to read, it stops.
Even though the tape is infinite, the chain that guides the behavior of the automaton
is not. This string can be as long as you want, but it is always finite. 3.1b

Definition 3

A finite automaton has a set of states and its "control" passes from one state to
another in response to external "inputs". One of the fundamental differences
between the classes of finite automata is whether said control is "deterministic",
which means that the automaton cannot be in more than one state at the same time,
or "non-deterministic", which means that yes it can be in several states at the same
time.

An automaton is a graphical representation that shows the process of recognizing


an input string. The symbols used are simple:

A finite automaton (FA) or finite state machine is a computational model that


automatically performs computations on an input to produce an output. This
model is made up of an alphabet, a set of states, and a set of transitions between
those states. Its operation is based on a function of
transition, which receives from an initial state a string of characters belonging to
the alphabet (the input), and which reads said string as the automaton moves
from one state to another, to finally stop in a final state or acceptance, which
represents output. The purpose of finite automata is to recognize regular
languages, which correspond to the simplest formal languages according to the
Chomsky Hierarchy.

A finite automaton is a 5-tuple (Q, Σ, q0, δ, F) where:

Q: is a finite set of states; Σ: is a


finite alphabet; q0: is the initial
state;
δ: is a transition function;
F: is a set of final or acceptance states.

At the beginning of the recognition process of an input string, the finite


automaton is in the initial state and as it processes each symbol of the string, it
changes state according to what is determined by the transition function. When
the last of the symbols in the input string has been processed, the automaton
stops at the final state of the process. If the final state in which it stopped is an
accepting state, then the string belongs to the language recognized by the
automaton; otherwise, the string does not belong to that language.
Note that the initial stateq0of a finite automaton is always unique, while the final
states can be more than one, that is, the set can contain more than one element.
It may also be the case that a final state corresponds to the same initial state.

AF Classification

Automata can be classified into:

- Deterministic: Each combination (state, input symbol) produces a single


state.
- Non-Deterministic: Each combination (state, input symbol) produces
several states and transitions with λ are also possible.

Automata can be represented by transition tables or transition diagrams.

Transition tables:
• Rows headed by states( Q )
• Columns headed by input symbols ( E-)

to b
TABLE

->p what

*q q3 r

q3 r

r q3
Transition diagrams:
• Nodes labeled by states(Q)
• Arcs between nodes labeled with ( E-)
• Q0 is marked with ->
• The final state is marked with * or with a double circle

Example: Let AFD1 = ({a,b}, {p,q,r}, f, p, {q}) where f is defined by:

f(p,a) = qf(p,b) = r

f(q,a) = qf(q,b) = r

f(r,a) = rf(r,b) = r

write your transition table and draw your transition diagram.

states (Q): p, q, r

initial state :p

end state: q

symbols: a,b
AFD

AFND

3.2 Conversion of a Non-Deterministic Finite Automaton (AFND) to a Deterministic

Finite Automaton (AFD).

To convert an AFD into an AFN that recognizes the same language. This algorithm,
often called subset construction, is useful for simulating an NFA by means of a
computer program. In the transition table of an AFN, each entry is a set of states;
in the transition table of an AFD, each entry is just a state. The general idea behind
the AFN to AFD construction is that each state of the AFD corresponds to a set of
states of the AFN. The AFD uses a state to locate all possible states the AFN can be
in after reading each symbol from the input. That is, after reading it will enter a1,
a2,. ..an, the AFD is in a state that represents the subset T of AFN states reachable
from the AFN start state along some path labeled a1, a2,. ..an.
of AFD can be exponentially in the number of states of the AFN but in practice this
worst case rarely occurs. Algorithm (Construction of subsets) Construction of an
AFD from an AFN. Entry. A NFA N Exit. An AFD D that accepts the same Method
language. The algorithm builds a table of transitions tranD for D. Each state of the
DFA is a set of states of the AFN, and tranD is constructed so that D will simulate
"in parallel" all possible moves that N can perform with a given input string. The
operations in the following table are used to locate the sets of AFN states (s
represents an AFN state, and T a set of AFN states).

It is observed that the AFN of Figure 1 has two transitions from state "0" with
input "a"; that is, it can go to state "0" or to 1.

Now an algorithm is introduced to build from an AFND an AFD that recognizes


the same language. This algorithm is known as subset construction, it is useful
to simulate an AFND by means of a computer program.

Construction of subsets. Construction of an AFD from an AFN.


Entry. A NFA N.

Departure. An AFD D that accepts the same language.

3.3 Representation of ER using AFND

ERs, AFDs, and AFNDs are equivalent mechanisms for denoting regular
languages. In these three sections we will demonstrate this by converting ER
→ AFND → AFD → ER. The first two conversions are very relevant in practice, as
they allow efficient verifiers or search engines to be built from ERs.

There are algorithms that relate the specification of tokens -regular expressions-,
with their recognition -finite automata-. It is possible given a regular expression to
obtain the DFA that recognizes the strings of the language denoted by the regular
expression. It is also possible to obtain the AFND that recognizes the language
represented by said regular expression.

The algorithm that allows to build the deterministic finite automaton is beyond
the scope of these notes (the student does not have the prerequisites for its study
in this course). However, the algorithm used for the construction of the non-
deterministic finite automaton AFND is relatively simple to apply, since it is based
on simple rules. There are many variants of this algorithm called "Thompson's
Algorithm".
This algorithm is syntax-driven, that is, it uses the syntactic structure of the
regular expression to guide the process of building the AFND automaton.

Suppose that N(s) and N(t) are AFND's for the regular expressions s and t,
respectively.

a) For the regular expression s | t(alternating), construct the following AFND, N(s|t) :

b)For the regular expression st(concatenation), construct the AFND, N(st) :

c) c) For the regular expression s*, construct the AFND, N(s*)


3.4 State minimization in an AF

Minimization of an AFD

Two states of a deterministic finite automaton are equivalent states if, when
joined into a single state, they can recognize the same regular language as if they
were separate. This union of states involves the union of both its input and output
transitions. If two states are not equivalent, they are said to be distinguishable
states. A final state with a non-final state will never be equivalent.

A DFA is minimized if all its states are distinguishable and reachable. An AFD
minimization algorithm is as follows:

1.Eliminate the inaccessible states of the automaton.


two.Construct a table with all pairs (p, q) of remaining states.
3.Mark in the table those entries where one state is final and the other is
nonfinal, that is, those pairs of states that are clearly distinguishable.

For each pair (p, q) and each symbol a of the alphabet, such that r = δ(p,a) and s = δ(q,a): If
(r, s) has already been marked, then p and q are also distinguishable , therefore mark the
entry (p, q).

Otherwise, place (p, q) in a list associated with the input (r, s). Group the pairs of
unmarked states.
After the third step, if the created table is completely marked, then the initial AFD
was already minimal.

The computational complexity of the problem of minimizing a DFA is polynomial. In


fact, there are algorithms even more efficient than the one shown in this article
(although less intuitive).11 However, the problem of minimizing a non-deterministic
finite automata is NP-complete and PSPACE-complete.

Example
In the first example figure, an automaton is shown with the inaccessible state d,
which can be removed immediately. Then the table of pairs of states is built, and
then, according to the third line of the algorithm, the rows and columns
corresponding to the final states c and g are marked, except for the cell that
represents the pair (c,g), since being both final states, they can be equivalent
states. Subsequently, the remaining cells are marked according to the fourth line
of the algorithm, noting that the pair (b, f) is associated with the pair (c, g), and
thus finally the final automaton is obtained, grouping the states b and f, as well as
c and g, as shown in the second figure of the example.

Two states of a deterministic finite automaton are equivalent states if, when joined
into a single state, they can recognize the same regular language as if they were
separated. This union of states involves the union of both its input and output
transitions. If two states are not equivalent, they are said to be distinguishable
states. A final state with a non-final state will never be equivalent. 3.5 A DFA is
minimized if all its states are distinguishable and attainable. An AFD minimization
algorithm is as follows:

1. Eliminate the inaccessible states of the automaton.


2. Construct a table with all pairs (p, q) of remaining states.
3. Mark in the table those entries where one state is final and the other is
nonfinal, that is, those pairs of states that are clearly distinguishable.
4. For each pair (p, q) and each symbol a of the alphabet, such that r = δ(p,a) and s = δ(q,a):

1. If (r, s) has already been marked, then p and q are also distinguishable, so mark
the entry (p, q). 2. Otherwise, place (p, q) in a list associated with the input (r, s).

5. Group the pairs of unmarked states.

After the third step, if the created table is completely marked, then the initial AFD
was already minimal. The computational complexity of the problem of minimizing
a DFA is polynomial. In fact, there are algorithms even more efficient than the one
shown in this article (although less intuitive). However, the problem of minimizing
a nondeterministic finite automaton is NP-complete and PSPACE-complete.

If we want to calculate the minimum equivalent automaton of a certain automaton, we


have to obtain the quotient set Q/E.

For this, we assign classes to the different states, being for the first iteration,
C1( class 1 ) for the final states and C2( class 2 ) for the rest of the states.

Q/E0={ C1(p, q, r) , C2(s, t, u, v)}


Later, analyzing the new transition table, we check if any new class has been
created, which we will call C3. In this case, the state “s” is different from the rest of
the states of class 2, therefore C3 will be assigned to said state, becoming Q/E1 =
{C1(p, q, r), C2( s ), C3(t, u, v)}

Q/E1 to b to b

*p p what
C1 C1

*q r p C1 C1

*r r r C1 C1

-> s youp C2 C1

you youor C2 C2

or youv C2 C2

v v or C2 C2

Next, we have verified that no extra class has been created, therefore, the Q/E2
will be the minimum equivalent. To represent such an automaton, we will
consider the classes as the states and we will represent their corresponding
transitions.
Q/E2 to b

*p C1 C1

*q C1 C1

*r C1 C1

-> s C3 C1

you C3 C3

or C3 C3

v C3 C3

3.5 Applications (definition of a case study).

APPLICATION OF AUTOMATA IN REAL LIFE

A PLC is an electronic device, based on a microprocessor or microcontroller, which


generally has a modular configuration, can be programmed in non-computer
language and is designed to control processes in real time and in an aggressive
environment (industrial environment). (Prezi, nd)
It is made up of four functional units:
- Ticket Unit
- Output unit
- Logical drive
- memory unit
His current duties are
- In elevator control
- In the automotive industry
- They can also perform arithmetic operations
- Control of traffic lights operations.
- Liquid level control of a tank.
- Control of packaging systems.
- Control of a drilling machine.
Among the advantages that these teams have are:
- The variety of existing models
- Saving time in project development
- The low cost, both as implementation, as in the modification of actions

- Economic maintenance due to downtime is reduced.


APPLICATIONS OF DETERMINISTIC FINITE AUTOMATA
INTERRUPTION CIRCUITS
They are a set of signals received by a computer processor, which is composed of
a finite number of gates (states), which can use two possible conditions, usually
denoted by 0 and 1 (transitions).
RECOVER OF INFORMATION
The unification of terms is a computational procedure through which the variants
of the same term, which are semantically equivalent, are grouped into a unified
form. Based on this procedure, there is a series of Unification algorithms
(conflationalgorithms) used for information recovery to avoid the loss of relevant
documents. (Mtz, nd)

APPLICATION OF THE AUTOMATES FOR THE DEVELOPMENT OF A


ARTIFICIAL NEURAL NETWORK

Artificial Neuron Networks (commonly referred to as ANNs1) are a learning and


machine processing paradigm inspired by the way the nervous system of animals
works. It is a system of interconnection of neurons in a network that collaborates
to produce an output stimulus. In artificial intelligence it is common to refer to
them as networks of neurons or neural networks.
The minimum component of a neural network is a neuron or processing element.
It is a device that transforms (in the soma, or cell body) several input signals
(through the dendrites) into a single output (through the axon). The inputs can
come from other neurons, or from the outside. The output can also be transferred
to other neurons or function as an output signal to the network, in which case the
behavior is slightly different in terms of the functions that are applied to it or the
final use that is made of it. (Ortiz)

APPLICATION OF FINITE AUTOMATA IN INDUSTRY


A equipment electronic, based on a microprocessor or
microcontroller, have usually a modular Configuration,
can be programmed in non-computer language and is designed to control
processes in real time and in an aggressive environment (industrial environment)

1. AUTOMOBILEAssembly lines, welding, paint booths, transmissions. Machine


tools: Lathes, milling machines, drilling machines, etc.
2. CHEMICAL AND PETROCHEMICAL PLANTSProcess control (dosing, mixing,
weighing, etc). Electrolytic baths, oil pipelines, refining, wastewater treatment, etc.

3. METALLURGYControl of furnaces, rolling, casting, welding, forging, cranes, among


others.

4. FOODPacking, packaging, bottling, storage, bottle filling, etc.

5. BINS AND LOGSProcess control, sawing machines, conglomerate and laminate


production, etc.
6. ENERGY PRODUCTIONPower plants, turbines, fuel transportation, solar
energy, etc.
7. TRAFFIC
• Regulation and control of traffic, railways, metro lines, etc.
• Semaphore: State machines allow us to identify the different states of a system,
as well as the processes or transitions that occur so that the system changes from
one state to another like a semaphore:
• Train control: A very simple mechanism that can be modeled by a state machine
is a turnstile, which is used to control access to subway trains and an amusement
park.
It is made up of four functional units:
- input unit
- output unit
- Logical Unit
- memory unit
Automaton representing reality
description of reality
- We will represent two traffic lights.
- The sequence of traffic lights will be: green, yellow and red. Each one with a
different time in most cases. The sequence repeats indefinitely.

- The green light will turn on for 10 seconds. Similarly is the situation of the
color red.
- For the yellow light it will be 4 seconds
Defining System States and State Transition Triggers
The state can be described as a pattern of six bits where each position represents
one light from each traffic light. Therefore, the value of a position will be activated
if the traffic light is on.
The transitions are a pair of actions that activate or deactivate the lights at the two traffic
lights. (Mtz, nd)

APPLICATION OF FINITE AUTOMATA IN ELECTRONICS

Finite state machines are important in the application in electronics, they are
symbol acceptors, the most important applications that we have in electronics is
in the creation of circuits, since it has to recognize that a chain of symbols is
identical to another and so let the data pass. (Mtz, nd)

APPLICATION OF FINITE AUTOMATA IN COMMUNICATIONS

1. COMMUNICATIONS PROTOCOL
A communications protocol is the set of standardized rules for representation,
signaling, authentication, and error detection required to send information over a
communication channel. An example of a simple communications protocol
adapted to voice communication is the case of a radio announcer speaking to his
listeners. Communication protocols for digital communication over computer
networks have features designed to ensure reliable data exchange over a
communication channel.
imperfect communication. Communication protocols follow certain rules for the
system to function properly. (Mtz, nd)
2. TELEPHONY

Automated modeling of calls on hold is done through the concept of an operation


associated with a state, that is, an operation executed continuously in the state,
thus the Busy Tone state continuously produces the busy tone, so it is added to
the state prompt: Make Busy Tone.

APPLICATION OF FINITE AUTOMATES IN INTELLIGENCE


ARTIFICIAL
Finite state machines have a great future application in artificial intelligence. In
artificial intelligence, its main objective is the creation of an intelligent agent that
is capable of acting and reasoning like a human. For the creation of this agent it is
necessary to have a total knowledge of the grammar and the formal languages
that the agent is required to use, for this it must have a machine that is capable of
accepting the symbols and recognizing the strings that are being used. . (Mtz, nd)

APPLICATION OF FINITE AUTOMATES IN ROUTING


• FSMs are used to describe how a device, computer program, or routing
algorithm will react to a set of input events.

• The DUAL Finite State Machine performs the entire decision process for all
route calculations.
• FSM DUAL (Broadcast Update Algorithm) tracks all routes, uses their metrics
to select efficient and loop-free routes, and selects routes with the least cost
path to insert into a routing table. (Mtz, nd)

APPLICATION OF FINITE AUTOMATES IN EMBEDDED SYSTEMS


FOR CONTROL APPLICATIONS (TRANSDUCTION)

MICROWAVE OVEN:The microwave oven has one door. If the door is closed, then
it may or may not be in operation (depending on whether it is turned on or off).
When it is on, it is not possible to open the oven door without first turning it off.
Let's also assume the following: at any time it is possible to set the cooking mode.

THERMOSTAT: A thermostat is the component of a simple control system that opens


or closes an electrical circuit depending on the temperature, regulates the
heating power (output) depending on the room temperature (input data), passing
from one thermal state to another. (Mtz, nd)

APPLICATION OF AUTOMATES TO COMPUTATIONAL LINGUISTICS


COMPILER
A compiler is a computer program that translates a program written in one
programming language into another programming language, generating an
equivalent program that the machine will be able to interpret. The second
language is usually machine code, but it can also be just plain text. This
translation process is known as compilation. (Mtz, nd)

CELLULAR AUTOMATES AND ARTIFICIAL INTELLIGENCE


In Artificial Intelligence (AI) we can observe two different approaches, depending on the
objective pursued:

• The attempt to develop a technology capable of creating machines with


reasoning abilities similar, or apparently similar, to human intelligence.

• Research on intelligence mechanisms, which uses the computer as a


simulation tool for validating theories.
Within Artificial Life, Cellular Automata are the clearest example of this detour in
the search for intelligence. It's quite strange to say that Cellular Automata are
intelligent, they don't seem so at all. Instead, they possess many of the
fundamental aspects of life in terms of processes. In addition, this is attempted to
be achieved as simply as possible, so they could be the foundation, at least
theoretically, of life, and by extension, of intelligence.

Cellular automata are networks of simple locally connected automata. Each


simple automaton produces an output from various inputs, changing its state in
the process according to a transition function. In general, in a cellular automaton,
the state of a cell in a given generation depends only and exclusively on the states
of neighboring cells and on its own state in the previous generation.

Cellular automata are useful tools for modeling any system in the universe. They
can be considered as a good alternative to differential equations and have been
used to model physical systems, such as interactions between particles, galaxy
formation, kinetics of molecular systems and crystal growth, as well as various
biological systems at the cellular, multicellular and population levels.

For all this, its application is very varied, such as Simulation of evacuation of ships
and movie theaters, market research and advertising effects, entertainment, art,
research, simulation of physical, chemical and biological processes,
growth and spread of cancer cells, epidemiology, finance and economics, crystal
growth, pigmentation patterns in snails, developmental biology, dispersal of trees
within an ecosystem, theory of relativity, chemical reactions, population dynamics,
co-evolution, geology , quantum dots, vehicular traffic, neural networks and
artificial intelligence, cryptography, thermodynamics and hydrodynamics. Etc.
(Universidad Mayor de San Andres)

Example

ANTS AND PLANTS AS AN AUTOMATION


In the "Ants and Plants" program, each of the cells of the 2-dimensional grid is a
simple automaton with the following possible states:
- Empty
- Occupied by an ant
- Occupied by a plant
- Occupied by an obstacle

Each cell changes state based on the state of neighboring cells. For example, a cell
in "plant" state changes to "empty" state if there is an ant near the plant: the ant
eats the plant. Other state changes are also subject to the result of a uniform
pseudo-random function, and occur, if the other conditions are met, according to
a certain probability. For example, a cell in the "empty" state changes to the "ant"
state only if there is an ant close to the plant and also with a certain probability
(only if the ant "decides" to take that direction).

The state of each cell can be defined by different variables: ants, like plants, have
a certain amount of energy. But, in addition, ants have an inertia regarding the
direction of movement, which causes a tendency to move in the same direction,
and a "type", since there are "red", "pink", "orange" ants, "yellow" and "green"
that correspond to different probabilities of moving, watering, fighting or
reproducing.
In this automaton, the changes of state are directed only by the "ants", so that the
"execution" of an ant causes a change of state in itself and in other possible cells
of the "plant" type. This last point leads to the possibility of looking at the
program from another point of view: as a set of simple mobile automata whose
state is defined, among others, by their position on the X and Y axes. That is,
instead of seeing a grid whose cells change state, we see a set of ants that move
along some Cartesian axes. Indeed, the automaton has not been programmed as
a set of cells with different properties, but rather as several sets (or several
automata
superimposed): a set of ants, another of plants and another of obstacles, checking
that any of them does not exist in the same position as another. (REDcientifica,
undated)

CONCLUSIONS

The application of automatons to real life today is a large-scale technological


advance, since they facilitate physical work as in industries, implementing
automatons for packaging, process control, etc.
The branch of application of automata is very extensive since they are very
moldable according to what is needed, their main advantages are that they have a
great variety of models, they save time in the elaboration of projects, their cost is
low when implementing it and maintenance is economical and reduced time.
Automatons are currently used in the automotive industry in the area of
assembly of parts, in the control of elevators, in traffic control through operations
with traffic lights, mainly in telecommunications and routing.

Automata are used as analogies by physicists due to their assertiveness and


accuracy of reality, they help to understand algorithms when talking about
artificial neural networks or cellular automata, the latter try to represent analogs
of artificial worlds with respect to our real world.
EXAMPLE OF AN AUTOMATION DEVELOPED IN THE
REAL LIFE
WASHING MACHINE:

A washing machine is available, which externally has three buttons:

- Turn on
- Stop
- To wash; a light indicator L, and a switch located on the door.
Events (inputs) are the activation of the console buttons and the door switch.
The indicator light is an action (output) that must be executed.

Three states associated with the washing machine are displayed:

- off
- on
- Washing up

0 1

TO L off

AND TO L Washing up

L L Washing up

You might also like