Discrete Mathematics and its Applications

Slides:



Advertisements
Similar presentations
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
Advertisements

Example: Binary Adder We want to construct a finite state machine that will add two numbers. The input is two binary numbers, (xn…x1x0)2 and (yn…y1y0)2.
Modeling Computation Chapter 13.
Lecture 20 Finite State Machines CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Finite-State Machines with No Output Ying Lu
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
YES-NO machines Finite State Automata as language recognizers.
Summer 2011 Wednesday, 07/13. Formal Systems: The ELI System The ELI-system uses only three letters of the alphabet: E, L, I. It has a single axiom, EI,
§12.2 – Finite State Machines with Output. Giving credit where credit is due: Most slides based on lecture notes created byMost slides based on lecture.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Computability and Complexity 4-1 Existence of Undecidable Problems Computability and Complexity Andrei Bulatov.
Welcome to CSE105 and Happy and fruitful New Year
Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Fall 2008.
Finite State Machines – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Graphs and Finite State Machines Reading: Kolman, Sections.
Rosen 5th ed., ch. 11 Ref: Wikipedia
Finite-State Machines with No Output Longin Jan Latecki Temple University Based on Slides by Elsa L Gunter, NJIT, and by Costas Busch Costas Busch.
Finite-State Machines with Output
CMPS 3223 Theory of Computation
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
1 Unit 1: Automata Theory and Formal Languages Readings 1, 2.2, 2.3.
An ordered n-tuple is a set of n objects with an order associated with them. If n objects are represented by x 1, x 2,..., x n, then we write the ordered.
Computabilty Computability Finite State Machine. Regular Languages. Homework: Finish Craps. Next Week: On your own: videos +
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Copyright © Curt Hill Finite State Machines The Simplest and Least Capable Automaton.
§12.2 – Finite State Machines with Output. Giving credit where credit is due: Most slides based on lecture notes created byMost slides based on lecture.
Lesson 5-2 Domain and Range.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
§12.2 – Finite State Machines with Output
1 Languages: Finite State Machines Chapter 6 problemsstrings (languages) machines answers.
CS 461 – Oct. 28 TM applications –Recognize a language √ –Arithmetic √ –Enumerate a set –Encode a data structure or problem to solve Two kinds of TMs –Decider:
Universal Turing Machine
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
Theory of Computation Automata Theory Dr. Ayman Srour.
Finite-State Machines (FSM) Chuck Cusack Based partly on Chapter 11 of “Discrete Mathematics and its Applications,” 5 th edition, by Kenneth Rosen.
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
Finite Automata.
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
1.3 Finite State Machines.
Finite State Machines Dr K R Bond 2009
CSc 453 Lexical Analysis (Scanning)
Lecture2 Regular Language
Discrete Mathematics and its Applications
Copyright © Cengage Learning. All rights reserved.
Turing Machines Chapter 17.
Finite Automata a b A simplest computational model
G. Pullaiah College of Engineering and Technology
Two issues in lexical analysis
Discrete Mathematics and its Applications
Evaluation in Engineering Design Process Modeling and FSM
Finite State Machines.
Some slides by Elsa L Gunter, NJIT, and by Costas Busch
CSE 311 Foundations of Computing I
Discrete Mathematics and its Applications
§11.2 – Finite State Machines with Output
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Non-Deterministic Finite Automata
Finite Automata.
CSE 311: Foundations of Computing
Copyright © Cengage Learning. All rights reserved.
Discrete Mathematics and its Applications
Recap lecture 19 NFA corresponding to Closure of FA, Examples, Memory required to recognize a language, Example, Distinguishing one string from another,
§11.2 – Finite State Machines with Output
Lecture One: Automata Theory Amjad Ali
Formal Languages and Automata Theory BODDEDA HARITHA LAKSHMI,
Automata theory and formal languages COS 3112 – AUTOMATA THEORY PRELIM PERIOD WEEK 1 AND 2.
Discrete Mathematics and its Applications
Presentation transcript:

Discrete Mathematics and its Applications 1/14/2019 §13.2 – Finite State Machines with Output Instructor: Longin Jan Latecki, Temple University some slides by Dr. Michael P. Frank, Univ. of Florida (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Remember the general picture of a computer as being a transition function T:S×I→S×O? If the state set S is finite (not infinite), we call this system a finite state machine. If the domain S×I is reasonably small, then we can specify T explicitly by writing out its complete graph. However, this is practical only for machines that have a very small information capacity. (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Size of FSMs The information capacity of an FSM is C = log |S|. Thus, if we represent a machine having an information capacity of C bits as an FSM, then its state transition graph will have |S| = 2C nodes. E.g. suppose your desktop computer has a 512MB memory, and 60GB hard drive. Its information capacity, including the hard drive and memory (and ignoring the CPU’s internal state), is then roughly ~512×223 + 60×233 = 519,691,042,816 b. How many states would be needed to write out the machine’s entire transition function graph? 2519,691,042,816 = A number having >1.7 trillion decimal digits! (c)2001-2002, Michael P. Frank

One Problem with FSMs as Models Discrete Mathematics and its Applications 1/14/2019 One Problem with FSMs as Models The FSM diagram of a reasonably-sized computer is more than astronomically huge. Yet, we are able to design and build these computers using only a modest amount of industrial resources. Why is this possible? Answer: A real computer has regularities in its transition function that are not captured if we just write out its FSM transition function explicitly. I.e., a transition function can have a small, simple, regular description, even if its domain is enormous. (c)2001-2002, Michael P. Frank

Other Problems with FSM Model Discrete Mathematics and its Applications 1/14/2019 Other Problems with FSM Model It ignores many important physical realities: How is the transition function’s structure to be encoded in physical hardware? How much hardware complexity is required to do this? How close in physical space is one bit’s worth of the machine’s information capacity to another? How long does it take to communicate information from one part of the machine to another? How much energy gets dissipated to heat when the machine updates its state? How fast can the heat be removed, and how much does this impact the machine’s performance? (c)2001-2002, Michael P. Frank

Vending Machine Example Discrete Mathematics and its Applications 1/14/2019 Vending Machine Example Suppose a certain vending machine accepts nickels, dimes, and quarters. If >30¢ is deposited, change is immediately returned. If the “coke” button is pressed, the machine drops a coke. It can then accept a new payment. Ignore any other buttons, bills, out of change, etc. (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Modeling the Machine Input symbol set: I = {nickel, dime, quarter, button} We could add “nothing” or  as an additional input symbol if we want. Representing “no input at a given time.” Output symbol set: O = {, 5¢, 10¢, 15¢, 20¢, 25¢, coke}. State set: S = {0, 5, 10, 15, 20, 25, 30}. Representing how much money has been taken. (c)2001-2002, Michael P. Frank

Transition Function Table Discrete Mathematics and its Applications 1/14/2019 Transition Function Table Old state Input New state Output n 5  d 10 q 25 b 15 30 Old state Input New state Output 10 n 15  d 20 q 30 5¢ b 25 10¢ 5 (c)2001-2002, Michael P. Frank

Transition Function Table cont. Discrete Mathematics and its Applications 1/14/2019 Transition Function Table cont. Old state Input New state Output 20 n 25  d 30 q 15¢ b 5¢ 20¢ Old state Input New state Output 30 n 5¢ d 10¢ q 25¢ b coke (c)2001-2002, Michael P. Frank

Another Format: State Table Discrete Mathematics and its Applications 1/14/2019 Another Format: State Table Each pair shows new state, output symbol Old state Input Symbol n d q b 5, 10, 25, 0, 5 15, 30, 10 20, 30,5¢ 15 30,10¢ 20 30,15¢ 25 30,20¢ 30 30,25¢ 0,coke (c)2001-2002, Michael P. Frank

Directed-Graph State Diagram Discrete Mathematics and its Applications 1/14/2019 Directed-Graph State Diagram As you can see, these can get kind of busy. q,5¢ d,5¢ q q q,20¢ d d d n n n n n n 5 10 15 20 25 30 n,5¢ b b b b b b d,10¢ q,15¢ q,25¢ b,coke q,10¢ (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Formalizing FSMs Just like the general transition-function definition from earlier, but with the output function separated from the transition function, and with the various sets added in, along with an initial state. A finite-state machine M=(S, I, O, f, g, s0) S is the state set. I is the alphabet (vocabulary) of input symbols O is the alphabet (vocabulary) of output symbols f:S×I→S is the state transition function g:S×I→O is the output function s0 is the initial state. Our transition function from before is T = (f,g). (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Construct a state table for the finite-state machine in Fig. 3. Find the output string for the input 101011 (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 A unit-delay machine: Construct a finite-state machine that delays an input string by one unit of time: Input: x1x2 … xk-1xk Output: 0x1x2 … xk-1 (c)2001-2002, Michael P. Frank

Discrete Mathematics and its Applications 1/14/2019 Language recognizer: Construct a finite-state machine that outputs 1 iff the input string read so far ends with 111 otherwise it outputs 0. (c)2001-2002, Michael P. Frank