Introduction to Computability Theory

Slides:



Advertisements
Similar presentations
CSE 311 Foundations of Computing I
Advertisements

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.
Lecture 6 Nondeterministic Finite Automata (NFA)
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)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2005.
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 Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture4: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture5: Context Free Languages Prof. Amos Israeli.
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.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata (cont.) Prof. Amos Israeli.
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 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
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.
CS5371 Theory of Computation Lecture 6: Automata Theory IV (Regular Expression = NFA = DFA)
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Non-Deterministic Automata Regular Expressions.
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
1.Defs. a)Finite Automaton: A Finite Automaton ( FA ) has finite set of ‘states’ ( Q={q 0, q 1, q 2, ….. ) and its ‘control’ moves from state to state.
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
1 A Single Final State for Finite Accepters. 2 Observation Any Finite Accepter (NFA or DFA) can be converted to an equivalent NFA with a single final.
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.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
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.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
REGULAR LANGUAGES.
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
4b 4b Lexical analysis Finite Automata. Finite Automata (FA) FA also called Finite State Machine (FSM) –Abstract model of a computing entity. –Decides.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
Nondeterministic Finite Automata (NFAs). Reminder: Deterministic Finite Automata (DFA) q For every state q in Q and every character  in , one and only.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Lecture #5 Advanced Computation Theory Finite Automata.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Theory of Computation Automata Theory Dr. Ayman Srour.
Non Deterministic Automata
Lecture3 DFA vs. NFA, properties of RL
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
Non Deterministic Automata
Presentation transcript:

Introduction to Computability Theory 12:25:32 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli

Roadmap for Lecture In this lecture we: Present and motivate Non-Deterministic Finite Automata. Demonstrate that NFA-s and DFA-s are equivalent.

Example of an NFA NFA – Nondeterministic Finite Automaton 0,1 1 ,0 1. A state nay have 0 or more transitions labeled with the same symbol. 2. transitions are possible.

Computation of an NFA When several transitions with the same label exist, an input word may induce several paths. When no transition is possible a computation is “stuck”. Q:Which words are accepted and which are not? A: If word w induces (at least) a single accepting path, the automaton “chooses” this accepting path and w is accepted.

Possible Computations DFA NFA At each step of the computation: DFA - A single state is occupied. NFA - Several states may be occupied. . . . . .

Computation of an NFA - Example 0,1 1 ,0 On the input word w=01011 there exist an accepting path and w is accepted. Can we characterize (find) the language recognized by this automaton? Words containing either 101 or 11 as substrings.

Computation tree of 01011 0,1 1 ,0 1 1 1 1 1 1 1 Accepting branch 1

Why do we Care About NFAs? NFA-s and DFA-s are equivalent (Meaning: They recognize the same set of languages). In other words: Each NFA recognizing language L has an equivalent DFA recognizing L. (Note: This statement must be proved.) But usually, the NFA is much simpler. Enables the proof of theorems. (e.g. about regular operations)

Example - A Complicated DFA Can you guess the language? 1 1 1 1 1 1 1 1

Example – An Equivalent NFA Can you guess the language? 1 0,1 Bit Strings that have 1 in position third from the end

Example - A Complicated DFA Can you guess the language? 1 1 1 1 1 1 1 1 Can you verify it now?

DFA – A Formal Definition(Rerun) A finite automaton is a 5-tupple where: is a finite set called the states. is a finite set called the alphabet. is the transition function. is the start state, and is the set of accepting states.

NFA – A Formal Definition A finite automaton is a 5-tupple where: is a finite set called the states. is a finite set called the alphabet. is the transition function. ( ) is the start state, and is the set of accept states

Differences between NFA-s and DFA-s There are two differences: 1. The range of the transition function is now . (The set of subsets of the state set ) 2. The transition function allows transitions.

Computations of NFA-s In general a computation of an NFA, N, on input w, induces a computation tree. Each path of the computation tree represents a possible computation of N. The NFA N accepts w, if its computation tree includes at least one path ending with an accepting state.

Computations of NFA-s There are two ways to look at computations of an NFA: The first is to say that the NFA N “chooses” the right path on its tree of possible computations. The second is to say that the NFA N traverses its computation tree “in parallel”.

Equivalence Between DFAs and NFAs Now we prove that the class of NFAs is Equivalent to the class of DFA: Theorem: For every NFA , there exists a DFA , such that . Proof Idea: The proof is Constructive: We assume that we know , and construct a simulating DFA, .

Construction Demonstration We start with an NFA with no transitions. The equivalent DFA is denoted by: 0,1 1

Construction Demonstration The state set of the equivalent DFA, D, should reflect the fact that at each step of the computation, N may occupy several sates, Thus we define the state set of D as the power-set of the state set of N, namely:

Construction Demonstration Recall that the transition function of any NFA is defined by . Do not be confused by the use of as the state set of D . D is a DFA, not the original NFA.

Construction Demonstration The alphabet of D, , is identical to the alphabet of N. The starting state of D corresponds to the starting state of N, namely . The most complex part of the construction is the transition function: In the sequel it is demonstrated stage by stage:

Construction Demonstration 0,1 1 Since the only state reachable from by 0 is , we get .

Construction Demonstration 0,1 1 Since both and are reachable from by 1, we get . 1

Construction Demonstration 0,1 1 Similarly we get . 1 1

Construction Demonstration 0,1 1 and . 1 1

Construction Demonstration 0,1 1 Since and , we get . 1 1 1

Construction Demonstration 0,1 1 Finally we get the following DFA: 1 1 1 1

Construction Demonstration And its disconnected section: 1 1 1 1

Construction Demonstration 0,1 1 Since 1,0 is accepted we get that is an accepting state. 1 1

Construction Demonstration 0,1 1 Since 1,0,1 is accepted we get that is also an accepting state. 1 1

Wrap Up In this lecture we: Introduced NonDeterministic Finite Automatons. Demonstrated the equivalence between DFA-s and NFA-s.