CSCI 2670 Introduction to Theory of Computing

Slides:



Advertisements
Similar presentations
Non-Deterministic Finite Automata
Advertisements

Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Introduction to Computability Theory
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 Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
NFAs Sipser 1.2 (pages 47–54). CS 311 Mount Holyoke College 2 Recall… Last time we showed that the class of regular languages is closed under: –Complement.
Introduction to Computability Theory
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
CS5371 Theory of Computation
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.
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.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
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.
CSCI 2670 Introduction to Theory of Computing August 24, 2005.
REGULAR LANGUAGES.
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
August 23, 2005 CSCI 2670 Introduction to Theory of Computing August 23, 2005.
CSCI 2670 Introduction to Theory of Computing September 7, 2004.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
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.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Theory of Languages and Automata By: Mojtaba Khezrian.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Deterministic Finite-State Machine (or Deterministic Finite Automaton) A DFA is a 5-tuple, (S, Σ, T, s, A), consisting of: S: a finite set of states Σ:
WELCOME TO A JOURNEY TO CS419 Dr. Hussien Sharaf Dr. Mohammad Nassef Department of Computer Science, Faculty of Computers and Information, Cairo University.
CSCI 2670 Introduction to Theory of Computing
Lexical analysis Finite Automata
Non Deterministic Automata
Finite Automata a b A simplest computational model
Nondeterministic Finite Automata
Chapter 2 FINITE AUTOMATA.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Hierarchy of languages
Non-Determinism 12CS45 Finite Automata.
Lecture3 DFA vs. NFA, properties of RL
Non-Deterministic Finite Automata
CS 154, Lecture 3: DFANFA, Regular Expressions.
COSC 3340: Introduction to Theory of Computation
Non-Deterministic Finite Automata
Nondeterministic Finite Automata
Non Deterministic Automata
NFAs and Transition Graphs
CSE 2001: Introduction to Theory of Computation Fall 2009
Finite Automata.
4b Lexical analysis Finite Automata
CSCI 2670 Introduction to Theory of Computing
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
4b Lexical analysis Finite Automata
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSE 311 Foundations of Computing I
Chapter 1 Regular Language
Finite-State Machines with No Output
CSCI 2670 Introduction to Theory of Computing
CHAPTER 1 Regular Languages
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
COSC 3340: Introduction to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing August 30, 2005

Announcements Homework due next Tues, Sept 6 1.7b, 1.8a, 1.10a, 1.15, 1.17a&b, 1.31, 1.32 Old Text 1.5b, 1.6a, 1.8a, 1.24, 1.25 (1.15 & 1.17 are not in old text) Office hours with TA Ryan Foster Monday 2:30 – 3:30 Friday 10:00 – 11:00 Room 301 B (knock if locked) Change in syllabus First midterm exam Tues, September 27

Agenda Last class This week Combined regular languages Introduced non-determinism This week Section 1.2 Start Section 1.3

Find M such that L(M) = L(M1)  L(M2) q1 q2 q3 0,1 1 M1 1 q1’ q2’ q3’ M2 Example Find M such that L(M) = L(M1)  L(M2) q1 q2 q3 0,1 1 q1’ q2’ q3’ ε Can jump to q1’ non-deterministically

NFA vs. DFA DFA NFA Exactly one arrow exiting each node for each symbol of the alphabet Number of exiting arrows can be anything from 0 to the number of nodes Each arrow is labeled only with characters of the alphabet Characters may be labeled with an empty string, ε Each string reaches exactly one state at the end of the input A string may reach several different states states at the end of the input

Computing on an NFA For each symbol of the string, keep track of all possible transitions in parallel When input ends, there may be several possible ending states If at least one of the possibilities is an accepting state, then the NFA accepts the string

Example Does this NFA accept the string 001? From state(s) Input 0,1 1 q1 q2 ε q3 1 1 Does this NFA accept the string 001? From state(s) Input To state(s) q1 q2, q3 1 q1, q3 Yes q1, q3

Example Any string containing two 1’s separated by at most one 0 0,1 1 ε Any string containing two 1’s separated by at most one 0

Example Zero or more concatenations of the strings aba and ab   b a

Example ε a, b, c a, b, d a, c, d b, c, d Strings of any length containing at most three of the symbols in  = {a, b, c, d}

The power of non-determinism Strings of any length containing at most two of the symbols in  = {a, b, c} c a b a, b, c a, c b,c a, b DFA a, b a, c b, c ε NFA

Non-deterministic finite automaton A non-deterministic finite automaton is a 5-tuple (Q,,,q0,F), where Q is a finite set of states  is a (finite) alphabet  : Q × ε  P(Q) is the transition function  maps to sets of states q0 is the start state, and F  Q is the set of accept states

Equivalence of DFAs and NFAs Theorem: Every non-deterministic finite automaton has an equivalent deterministic finite automaton Both FAs accept the same language Proof method Construction Similar to method used for calculating strings Follow all paths in parallel where states represent parallel paths

Proof idea Given NFA M1={Q,,,q0,F} construct DFA M2={Q’,,’,q0’,F’} with L(M1)=L(M2) Intuition Recall :Q×εP(Q) Our DFA’s transition function will generate paths within P(Q) ’: P(Q)×P(Q)

Defining M2 Determine Q’, q0’, and F’ Q’ = P(Q) q0’ = {q0} F’ = {R  Q’ | R  F  } i.e., R contains at least one of M1’s accept states Defining ’ (for now ignore ε jumps)