0 Up votes0 Down votes

3 views3 pagesA short description on DFAs, Moore/Mealy Machines and Myhill-Nerode theorem.

Sep 04, 2018

© © All Rights Reserved

PDF, TXT or read online from Scribd

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

© All Rights Reserved

3 views

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

© All Rights Reserved

- Neuromancer
- The E-Myth Revisited: Why Most Small Businesses Don't Work and
- How Not to Be Wrong: The Power of Mathematical Thinking
- Drive: The Surprising Truth About What Motivates Us
- Chaos: Making a New Science
- The Joy of x: A Guided Tour of Math, from One to Infinity
- How to Read a Person Like a Book
- Moonwalking with Einstein: The Art and Science of Remembering Everything
- The Wright Brothers
- The Other Einstein: A Novel
- The 6th Extinction
- The Housekeeper and the Professor: A Novel
- The Power of Discipline: 7 Ways it Can Change Your Life
- The 10X Rule: The Only Difference Between Success and Failure
- A Short History of Nearly Everything
- The Kiss Quotient: A Novel
- The End of Average: How We Succeed in a World That Values Sameness
- Made to Stick: Why Some Ideas Survive and Others Die
- Algorithms to Live By: The Computer Science of Human Decisions
- The Universe in a Nutshell

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

- Mimi DfaUploaded byRicha Panjiyara
- UNIT-V Realization of State MachinesUploaded byNarasimha Murthy Yayavaram
- MC0082Uploaded byPuneet Baluni
- TN10 Moore or Mealy ModelUploaded byjuglers
- ME261_C1Uploaded byFAzle RAbby
- Finite AutomataUploaded bychandu903
- Cs2303 Toc ModelUploaded byrishikarthick
- Ser Ex4 IntroductionUploaded byandreluizpsilveira77
- Task Allocation in a Massively Parallel System Using Finite AutomataUploaded bySumit Sanwal
- handout-04Uploaded byamos4354
- Coordination AssemblyUploaded byEugeny Tikhomirov
- Listas VectorUploaded byAlvaroZola
- Digital System IED 12303Uploaded byaizen14
- jignesh ki biasdasdasd.txtUploaded byasp
- DVA337-HT17-lecture11.pdfUploaded byKamal Walia

- 20563 2 Chapter 12 Algorithmic State MachineUploaded bysamantha223
- FSMDUploaded byjagadeshj
- fsm2Uploaded byCristian Chitiva
- Automata Theory TutorialUploaded byHeena Jain
- Implementation of FSM Based Automatic Dispense Machine with Expiry Date Feature Using VHDLUploaded byIJMER
- TAP-FSMUploaded byMadhukumar Ks
- Stateflow BookUploaded bybookstore090
- lect5-fsm.pptUploaded bySangeetha Sangu BC
- TCSUploaded bySaqib Kamal
- VHDL slutions to problemsUploaded byInaraj
- 07-FSMUploaded byAnamika Pancholi
- Design and Performance of Automatic Vending Machine using VHDLUploaded byIJCERT PUBLICATIONS
- FPDs and Applications FSM Course PubUploaded byNGOUNE
- Alford C.digital Design VHDL Laboratory Notes.1996Uploaded byIon Caimacan
- Cs402 Collection of Old PapersUploaded bycs619finalproject.com
- ch04Uploaded byMeenakshi Dhasmana
- lec15 ASMUploaded byJatin Gaur
- Fsm DesignUploaded bysuperECE
- 16 LectureUploaded byVaishali Wagh
- Moore and Mealy MachinesUploaded bysgdgp
- lab11 - Sequential System Design using ASM Charts.pdfUploaded bywert1a2
- ROMUploaded byshubham97
- 2cth(2)Uploaded byvirgelb
- L9 - Mealy and Moore MachinesUploaded byWhy Aguilar
- Automaton Model of Protein- Dynamics of Conformational and Functional StatesUploaded byTruck Heart
- solution.pdfUploaded byCedric Sun
- Capstone ResearchProject Moore Mealy MachineUploaded byAnish Chatterjee
- Moore and Mearly MachineUploaded byJibran Elahi
- vending machineUploaded bybookbuy321
- Finite State MachinesUploaded bydeepanilsaxena

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.