CSE 311 Foundations of Computing I Lecture 24 Finite State Machines Autumn 2012 CSE 3111.

Slides:



Advertisements
Similar presentations
NFAε - NFA - DFA equivalence
Advertisements

Modeling Computation Chapter 13.
CSE 311 Foundations of Computing I
CSC 361NFA vs. DFA1. CSC 361NFA vs. DFA2 NFAs vs. DFAs NFAs can be constructed from DFAs using transitions: Called NFA- Suppose M 1 accepts L 1, M 2 accepts.
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
CSE 311: Foundations of Computing Fall 2013 Lecture 23: Finite state machines and minimization.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Discussion1: Non-Deterministic Finite Automatons Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Finite Automata and Non Determinism
CS5371 Theory of Computation
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Finite Automata Finite-state machine with no output. FA consists of States, Transitions between states FA is a 5-tuple Example! A string x is recognized.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
1 Single Final State for NFAs and DFAs. 2 Observation Any Finite Automaton (NFA or DFA) can be converted to an equivalent NFA with a single final state.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Nondeterminism.
Lecture 3 Goals: Formal definition of NFA, acceptance of a string by an NFA, computation tree associated with a string. Algorithm to convert an NFA to.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
1 Non-Deterministic Automata Regular Expressions.
Finite Automata Costas Busch - RPI.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
CSE 311: Foundations of Computing Fall 2014 Lecture 23: State Minimization, NFAs.
Rosen 5th ed., ch. 11 Ref: Wikipedia
NFA ε - NFA - DFA equivalence. What is an NFA An NFA is an automaton that its states might have none, one or more outgoing arrows under a specific symbol.
Finite-State Machines with Output
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.
CSE 311 Foundations of Computing I Lecture 23 Finite State Machines Autumn 2012 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Autumn 2011 CSE 3111.
CSE 311 Foundations of Computing I Lecture 21 Finite State Machines Spring
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CSE 311 Foundations of Computing I Lecture 27 FSM Limits, Pattern Matching Autumn 2012 CSE
CMSC 330: Organization of Programming Languages Theory of Regular Expressions Finite Automata.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
NFA defined. NFA A Non-deterministic Finite-state Automata (NFA) is a language recognizing system similar to a DFA. It supports a level of non-determinism.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSE 311 Foundations of Computing I Lecture 20 Relations, Graphs, Finite State Machines Autumn 2011 CSE 3111 TexPoint fonts used in EMF. Read the TexPoint.
CSE 311 Foundations of Computing I Lecture 24 FSM Limits, Pattern Matching Autumn 2011 CSE 3111.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
1 Lexical Analysis Uses formalism of Regular Languages Uses formalism of Regular Languages Regular Expressions Regular Expressions Deterministic Finite.
Deterministic Finite Automata Nondeterministic Finite Automata.
1 Finite Automata. 2 Introductory Example An automaton that accepts all legal Pascal identifiers: Letter Digit Letter or Digit "yes" "no" 2.
Theory of Computation Automata Theory Dr. Ayman Srour.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CSE 311 Foundations of Computing I
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE322 Finite Automata Lecture #2.
CSE 311 Foundations of Computing I
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Non Deterministic Automata
CSE 311: Foundations of Computing
Finite Automata.
CSE 311: Foundations of Computing
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE 311 Foundations of Computing I
Chapter 1 Regular Language
Non Deterministic Automata
Nondeterminism The Chinese University of Hong Kong Fall 2010
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 24 Finite State Machines Autumn 2012 CSE 3111

Announcements Reading assignments – 7 th Edition, Sections 13.3 and 13.4 – 6 th Edition, Section 12.3 and 12.4 – 5 th Edition, Section 11.3 and 11.4 Homework 9 will be posted today – Due date, Friday November 30 Autumn 2012CSE 3112

Last lecture highlights Finite state machines – States, transitions, start state, final states – Languages recognized by FSMs Autumn s0s0 s2s2 A s1s1 10,1 R

Non-determinism A non-deterministic finite automaton (NFA) allows multiple outputs to have the same label A string s is accepted by a NFA if there is some path through the NFA with labels s that reaches an accepting state Autumn 2012CSE 3114 s0s0 s2s2 A s1s1 0,1 1

Strings over {0, 1, 2}* M 1 : Strings with an even number of 2’s M 2 : Strings where the sum of digits mod 3 is 0 Autumn 2012CSE 3115 s0s0 s1s1 t0t0 t2t2 t1t1

Recognize strings with an even number of 2’s and a mod 3 sum of 0 Autumn 2012CSE 3116 s0t0s0t0 s1t0s1t0 s1t2s1t2 s0t1s0t1 s0t2s0t2 s1t1s1t1

State machines with output Autumn 2012CSE 3117 InputOutput StateLR s1s1 s1s1 s2s2 Beep s2s2 s1s1 s3s3 s3s3 s2s2 s4s4 s4s4 s3s3 s4s4 S3S3 S4S4 S1S1 S2S2 R L R L R L L R “Tug-of-war”

Vending Machine Autumn 2012CSE 3118 Enter 15 cents in dimes or nickels Press S or B for a candy bar

Vending Machine, Version DD N N N, D B, S Basic transitions on N (nickel), D (dime), B (butterfinger), S (snickers)

Vending Machine, Version 2 0’ B Adding output to states: N – Nickel, S – Snickers, B – Butterfinger 15’ N 0 0” S N N N N N B D D D D DB S S

Vending Machine, Final Version 0’ B Adding additional “unexpected” transitions 15’ N 0 0” S N N N N N B D D D D D B S S 15” D S B B,S N N N D D D

Vending Machine, Final Version 0’ B Slide from Nov 21, 2011 Lecture 15’ N 0 0” S N N N N N B D D D D D B S S 15” D S B B,S N N N D D D Find the bug!

Another way to look at DFAs Autumn 2011CSE s0s0 s2s2 s3s3 s1s , Lemma: x is in the language recognized by a DFA iff x labels a path from the start state to some final state Definition: The label of a path in a DFA is the concatenation of all the labels on its edges in order

Nondeterministic Finite Automaton (NFA) Graph with start state, final states, edges labeled by symbols (like DFA) but – Not required to have exactly 1 edge out of each state labeled by each symbol - can have 0 or >1 – Also can have edges labeled by empty string Definition: x is in the language recognized by an NFA iff x labels a path from the start state to some final state Autumn 2011CSE s0s0 s2s2 s3s3 s1s ,1

Design an NFA to recognize the set of binary strings that contain 111 or have an even # of 1’s Autumn 2011CSE 31115

Three ways of thinking about NFAs Outside observer: Is there a path labeled by x from the start state to some final state? Perfect guesser: The NFA has input x and whenever there is a choice of what to do it magically guesses a good one (if one exists) Parallel exploration: The NFA computation runs all possible computations on x step-by- step at the same time in parallel Autumn 2011CSE 31116