3 views

Uploaded by Subhadeep Dash

A short description on DFAs, Moore/Mealy Machines and Myhill-Nerode theorem.

- Evolutionary Programming
- Ct213 Fsm Design
- Finite State Machines 4
- Mimi Dfa
- unit36
- 02
- Theory Of Automata
- questions
- 07-FSM
- Formal Languages and Chomsky Hierarchy[1]
- Chapter 01 - Introduction
- HIM@NSHU
- Linking Interaction Nets and Post Canonical Systems
- New Microsoft Office Word Document
- Lecture 2
- Fsamp Problems
- Fpga Hardware Design
- S1 Number Systems and Codes
- Sapiens: A Brief History of Humankind
- The Unwinding: An Inner History of the New America

You are on page 1of 3

Subhadeep Dash,

Computer Science and Engineering - S20160010021,

Indian Institute of Information Technology Sri City,

IIITS,

Sri City, India

Email id:subhadeep.d16@iiits.in

machines like constructing a DFA. It also includes output 1

based machines like Moore and Mealy machines. It has a brief 1

description on Myhill-Nerode theorem and it’s applications along r0 r1 0 r2 r3

start

with an example. 1 0

Index Terms—Moore and Mealy Machines, DFA, finite ma-

chines, Myhill-Nerode Theorem

0

Fig. 2: DFA for binary strings divisible by 4

I. B UILDING DFA FOR DIVISIBILITY BY 3 AND NOT 4 C. Building DFA for binary strings not divisible by 4

1

1

States 0 1 start r0 r1 0 r2 r3

1 0

q0 q0 q1

q1 q2 q0 0

q2 q1 q2 Fig. 3: DFA for binary strings not divisible by 4

0 1

1 0

0

q0 q1 q2 0

start

q0 r0 q0 r1 0 q0 r2 0 q0 r3

1 0 start

1 1 1

1 1

0 0 0

0 0

States 0 1 0 0 0

r0 r0 r1 q2 r0 q2 r1 q2 r2 q2 r3

r1 r2 r3 1 1

r2 r0 r1 1

r3 r2 r3 1

Fig. 4: DFA for binary strings divisible by 3 and not divisible

TABLE II: State Transition Table by 4

2

II. M OORE AND M EALY M ACHINES C. Equivalence of Moore and Mealy Machines

Finite State Machines are basically mathematical models As far as equivalence of both the machines is concerned, a

of computation. Many finite state machines do exist which Moore machine can never be correctly equivalent to a Mealy

produce output apart from just accept and reject states. Moore Machine since the length of the output string varies from

and Mealy Machines are examples of such machines. The Moore Machine to Mealy Machine. Nevertheless we can say

machines are discussed in much more detail below. that a Moore Machine M and a Mealy Machine M 0 can be

considered equivalent if for all inputs w if

A. Moore Machines

bTM 0 (w) = TM (w)

Moore Machines are finite state machines whose output where b = output of initial state of Moore machine M for its

depends only on the current state. Unlike regular DFA and initial state

NFA, it is defined by a six-tuple (Q, Σ, O, δ, λ, q0 ). T(w) = output of the machine taking word w as input

where Q = finite set of states. We can observe here that the Moore Machine and Mealy

Σ = input alphabet. Machine mentioned earlier are infact equivalent. It can be

O = output alphabet. verified by the output of the input string we had taken

q0 = initial state. earlier ”baab”. Moore Machine gives ”00110” where as Mealy

δ is the input transition function where δ:Q × Σ → Q Machine gives ”0110”. So when we concatenate the initial

λ is the output transition function where λ:Q → O output of Moore’s Machine i.e. ”0”, we find that the output

strings are infact equivalent. Similarly we can test for any

string which belongs to the input language defined to hold

b a a, b

equal result for these two machines, provided the initial state

of Moore’s Machine is appended to Mealy’s Machine output

a b at the beginning. The idea is clearly presented in the following

start q0 |0 q1 |1 q2 |0 figure.

Consider the example of a Moore Machine mentioned here. |0 a|1 b|0

If we consider the string ”baab” as input, we get ”00110” as start q q0 q1 q2

output. The first ”0” from the starting state q0 and then ”b”

giving ”0” in q1 , followed by ”a”, ”a” and ”b” giving ”1”, ”1”, Fig. 7: An example of Mealy Machine adjusted to make it a

”0” from the states q1 , q1 and q2 respectively. The length of a Moore Machine

output string in a Moore Machine is always greater than the

length of the input string by 1. III. M YHILL -N ERODE T HEOREM

A. Definition

B. Mealy Machines Myhill-Nerode theorem states that a language L over alpha-

Mealy Machines are finite state machines whose output bet Σ is regular if and only if the set of equivalence classes

depends not only on the current state but on the current input of relation RL is finite.

as well. Similar to Moore Machines, it is also described by a This is because the number of states in the smallest DFA

six-tuple (Q, Σ, O, δ, λ, q0 ). possible is equal to the number of equivalence classes since

according to the formal definition of RL , xRL y if and only

if x and y are indistinguishable with respect to L. It can be

b|0 a|1 a|0, b|0 more formally defined as follows:

If RL is a relation on Σ∗ , then for strings x and y of Σ∗ ,

xRL y if and only if {z|xz ∈ L} = {z|yz ∈ L} i.e. both x

a|1 b|0

start q0 q1 q2 and y are indistinguishable with respect to L.

This theorem can be used to identify if a given language is

Considering the same example of input string ”baab” for regular or not. If the number of equivalence classes obtained

the Mealy Machine mentioned here, we get the output ”0110” is not finite, then the number of states needed to be built

as it traverses through b outgoing edge of q0 first followed by for building the respective machine is infinite and hence the

a edge of q0 , a edge of q1 and b edge of q1 . We observe here language can’t be treated as a regular one.

that the length of the output string is equal to the length of Another use of this theorem is to minimize a given DFA

the input string unlike in the case of Moore Machine. using table filling algorithm.

3

C. Table Filling Algorithm taken as [a, b] due to pruning of the upper triangle to avoid

1) Draw a table for all pairs of states[q, r]. duplicate values) and with s = 1, they give [c, d] which is

2) After drawing the table, prune the part above the diago- also unmarked. Considering [c, d] with s = 0, 1 gives the same

nal since it’s no longer needed as all pair combinations [c, d] which is still unmarked. Therefor we have completed this

are present below the diagonal itself. step too and head towards the final step i.e. combining states.

3) Mark all cells as marked where q ∈ F and r ∈ / F. Therefore, the final unmarked states are [a, b] and [c, d]. The

4) For every unmarked cell [q, r], if [δ(q, s), δ(r, s)] where final minimized DFA can be shown as follows.

a is an input symbol is marked, then mark [q, r] as

marked. 0 0, 1

Repeat this until maximum number of cells are marked.

5) Combine the unmarked pairs to make them a single state

in minimized DFA. 1

start (a, b) (c, d)

t]

D. Example

Fig. 9: Minimized DFA

0, 1

We observe that the final minimized DFA consists of only 2

states unlike the original one which has 4 states. We observe

1 that this finite machine works the same as the previous one

start a c

with minimized states.

Hence, in this way Myhill-Nerode theorem can be used to

0 0 minimize the DFA and also check if a language is regular or

not based on the number of equivalence classes.

b d REFERENCES

1

1) https://www.geeksforgeeks.org/mealy-and-moore-

0, 1 machines/

2) https://www.slideshare.net/lavishka anuj/moore-and-

Fig. 8: An example of non-minimised DFA mealy-machines-12176634

3) https://www.cs.odu.edu/ toida/nerzic/390teched/regular/reg-

lang/Myhill-Nerode/index.html

States a b c d 4) https://www.tutorialspoint.com/automata theory/dfa minimization.ht

a − − − −

b − − −

c − −

d −

States a b c d

a − − − −

b √ −

√ − −

c √ √ − −

d −

to minimize it using this technique. The first table is the table

we have constructed keeping the number of states in mind. We

have pruned off the upper part as per our procedure and then

we start marking the cells which have only one final state

in them. So we have successfully completed our third step

too. Now we proceed to the fourth step where we check for

transitivity. So only 2 cells are left out viz. [a, b] and [c, d].

The transition function with s = 0 gives [b, a] state (can be

- Evolutionary ProgrammingUploaded byjaved765
- Ct213 Fsm DesignUploaded byAviral Agarwal
- Finite State Machines 4Uploaded byWilliam Douglas
- Mimi DfaUploaded byRicha Panjiyara
- unit36Uploaded bySubathra Devi Mourougane
- 02Uploaded byAnuj
- Theory Of AutomataUploaded bybilo044
- questionsUploaded bymutharasu.k5132
- 07-FSMUploaded bySP Spurtinath
- Formal Languages and Chomsky Hierarchy[1]Uploaded bySaurabh Singh
- Chapter 01 - IntroductionUploaded byprinceji
- HIM@NSHUUploaded byHimanshu Sharma
- Linking Interaction Nets and Post Canonical SystemsUploaded bynenekotan
- New Microsoft Office Word DocumentUploaded bySeema Pote
- Lecture 2Uploaded byFreedom Storm
- Fsamp ProblemsUploaded bycudis1
- Fpga Hardware DesignUploaded byyogeee2
- S1 Number Systems and CodesUploaded byBarış İleriye

- CBSE Class 12 Maths Online Classes- MatrixUploaded byTakshila learning
- dec pg prospectus 2011=berhampurUploaded bymy.dear.sir
- Study of a Para Glider Landing System for the Apollo Command ModuleUploaded byBob Andrepont
- Tableau of ResultsuuUploaded byKarimPrinceAddo
- Solution Manual for Advanced Fluid Mechanics GÇô William GraebelUploaded byMasoomeh Akbarzadeh
- alpolic_windloadUploaded byvranceanu
- kryptoUploaded byapi-260128284
- Permanent Magnet Synchronous Motor Control Based on Bacterial Foraging Improved Particle Swarm OptimizationUploaded byIJEC_Editor
- Physics and Fractal StructuresUploaded byraymon6666
- Bloch Sphere RotationsUploaded bylufer0528
- Mechanical Engineering Reference Manual - HVAC sectionUploaded byMax Phillips
- Tutorial 3Uploaded byloveloveng
- Load Flow Gauss SeidalUploaded byTalluriSatyam
- Profile Calculation[1]Uploaded byAtsis Papadopoulos
- QUANTITATIVE TECHNIQUESIN MANAGEMENT - 7.11.2006Uploaded byNitin Krishna
- Lumber FormWork Design_ Lateral Pressures for Formwork Design_ACI_347Uploaded bylazem.360
- 065Uploaded byCésar Eduardo Asqui Córdova
- CIT 351Uploaded bymus1974
- 5100.7-2004(+A1)Uploaded byTian Ng
- LQ Unit 10 Geometry II – Circles.pdfUploaded bySamson Yau
- Bottom Up Beta AnalysisUploaded bySreejith AS
- Stress Analysis of Drive ShaftUploaded bynachigans
- PSE4_TestBank_Ch04_Win.pdfUploaded bynour
- SyllabusUploaded byKaushiikBaskaran
- Student TabelaUploaded byDiego Azevedo Souza
- Eec 125 QuestionUploaded by27051977
- STRATEGIES FOR SOLAR SAIL MISSION DESIGN IN THE CIRCULAR RESTRICTED THREE-BODY PROBLEMUploaded bySean
- Grade 7 Accelerated AA Pre Algebra SyllabusUploaded byPatricia Maia
- PIDUploaded byHani Hasan
- BP & Chevron - Cement ManualUploaded byellswors