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.
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)
8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
1 Introduction to Computability Theory Discussion3: Uses of the Pumping Lemma Prof. Amos Israeli.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
NFAs Sipser 1.2 (pages 47–54). CS 311 Fall Recall… Last time we showed that the class of regular languages is closed under: –Complement –Union.
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.
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
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.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
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.
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
1 Non-Deterministic Automata Regular Expressions.
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
Introduction to Finite Automata Adapted from the slides of Stanford CS154.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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.
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 Languages and Automata
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
CHAPTER 1 Regular Languages
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 1 Regular Languages Some slides are in courtesy.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
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.
Chapter 2 FINITE AUTOMATA.
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
Nondeterministic Finite Automata
Non Deterministic Automata
Chapter 1 Regular Language
CSCI 2670 Introduction to Theory of Computing
CHAPTER 1 Regular Languages
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Introduction to Computability Theory 11:24:47 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli

Roadmap for Lecture In this lecture we: Present the three regular operations. Present Non-Deterministic Finite Automata. Prove that NFA-s and DFA-s are equivalent. Use NFA-s to show that when each of the regular operation is applied on regular languages it yields yet another regular language.

The Regular Operations Let and be 2 regular languages above the same alphabet, . We define the 3 Regular Operations: Union: . Concatenation: . Star: .

Elaboration Union is straight forward. Concatenation is the operation in which each word in A is concatenated with every word in B. Star is a unary operation in which each word in A is concatenated with every other word in A and this happens any finite number of times.

The Regular Operations - Examples .

Motivation for Nondeterminism The Regular Operations give us a way to construct all regular languages systematically. In the previous lecture, we showed that the union operation preserves regularity: Given two regular languages L1 and L2 and their recognizing automata, M1 and M2 ,we constructed an automaton that recognizes .

Motivation for Nondeterminism This approach fails when trying to prove that concatenation and star preserve regularity. To overcome this problem we introduce nondeterminism.

Example of an NFA NFA – Nondeterministic Finite Automaton 0,1 1 ,0 1. A state nay have 0-many 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 0 transition is possible a computation may get “stuck”. Q:Which words are accepted and which are not? A: If word w induces (at least) a single accepting computation, the automaton “chooses” this accepting path and w is accepted.

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

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 An automaton over unary alphabet accepting words whose length is divided either by 2 or by 3.

What is the language of this DFA?

Bit Strings that have 1 in position third from the end

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.

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

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, .

Proof Let recognizing some language A. the state set of the simulating DFA M, should reflect the fact that at each step of the computation, N may occupy several sates. Thus we define the state set of M as the power-set of the state set of N.

Proof (cont.) Let recognizing some language A. First we assume that N has no - transitions. Define where .

Proof (cont.) Our next task is to define M’s transition function, : For any and define If R is a state of M, then it is a set of states of N. When M in state R processes an input symbol a, M goes to the set of states to which N will go in any of the branches of its computation.

Proof (cont.) An alternative way to write the definition of M’s transition function, is: For any and define And the explanation is just the same. Note: if than Which is OK since .

Proof (cont.) The initial state of M is: . Finally, the final state of M is: Since M accepts if N reaches at least one accepting state. The reader can verify for her/him self that M indeed simulates N .

Proof (cont.) It remains to consider - transitions. For any state of define to be the collection of states of R unified with the states reachable from R by - transitions. The old definition of is: And the new definition is:

Proof (end) In addition, we have to change the definition of , the initial state of . The previous definition, , is replaced with . Once again the reader can verify that the new definition of satisfies all requirements.

Corollary A language L is regular if and only if there exists an NFA recognizing L .

The Regular Operations (Rerun) Let and be 2 regular languages above the same alphabet, . We define the 3 Regular Operations: Union: . Concatenation: . Star: .

The Regular Operations - Examples .

Theorem (rerun) The class of Regular languages is closed under the all three regular operations. .

Proof for union Using NFA-s If and are regular, each has its own recognizing automaton and , respectively. In order to prove that the language is regular we have to construct an FA that accepts exactly the words in .

A Pictorial proof F

Proof for union Using NFA-s Let recognizing A1 , and recognizing A2 . Construct to recognize , Where , ,

Theorem The class of Regular languages is closed under the concatenation operation. .

Proof idea Given an input word to be checked whether it belongs to , we may want to run until it reaches an accepting state and then to move to .

Proof idea The problem: Whenever an accepting state is reached, we cannot be sure whether the word of is finished yet. The idea: Use non-determinism to choose the right point in which the word of is finished and the word of starts.

A Pictorial proof F

Proof using NFAs Let recognizing A1 , and recognizing A2 . Construct to recognize , Where , ,

Theorem The class of Regular languages is closed under the star operation. .

A Pictorial proof F

Proof using NFAs Let recognizing A1 . Construct to recognize Where , , and

Wrap Up In this lecture we: Motivated and defined the three Regular Operations. Introduced NonDeterministic Finite Automatons. Proved equivalence between DFA-s and NFA-s. Proved that the regular operations preserve regularity.