Lecture 3UofH - COSC 3340 - Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Lecture 23UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 23.
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.
Introduction to Computability Theory
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 Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions 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
1 Introduction to Computability Theory Discussion1: Non-Deterministic Finite Automatons Prof. Amos Israeli.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
CS5371 Theory of Computation
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
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.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
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.
Lecture 5UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 5.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
Lecture 2UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 2.
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.
1 For each language, give a regular expression that generates the language and a DFA that accepts it. L 1 = { w  {0, 1}* : has both 00 and 11 as substrings}
Lecture 10UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 10.
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.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
 2004 SDU Lecture4 Regular Expressions.  2004 SDU 2 Regular expressions A third way to view regular languages. Say that R is a regular expression if.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
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.
Nondeterminism The Chinese University of Hong Kong Fall 2011
CIS Automata and Formal Languages – Pei Wang
Properties of Regular Languages
CS314 – Section 5 Recitation 3
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
COSC 3340: Introduction to Theory of Computation
Lecture3 DFA vs. NFA, properties of RL
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
COSC 3340: Introduction to Theory of Computation
CSE322 Definition and description of finite Automata
Non Deterministic Automata
COSC 3340: Introduction to Theory of Computation
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Chapter 1 Regular Language
Pushdown automata The Chinese University of Hong Kong Fall 2011
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Nondeterminism The Chinese University of Hong Kong Fall 2010
COSC 3340: Introduction to Theory of Computation
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3

UofH - COSC Dr. Verma 2 Closure properties of Regular Languages Regular languages are closed under: – Union Notation:  – Intersection Notation:  L 1  L 2 is regular if L 1 and L 2 are regular. L 1  L 2 is regular if L 1 and L 2 are regular.

Lecture 3UofH - COSC Dr. Verma 3 Examples Let  = {a,b}. Let L 1 = { w in  * | w has even number of a's}. – Is L 1 regular? L 2 = { w in  * | w has odd number of b's}. – Is L 2 regular? L 1  L 2 = ? – Ans: {w in  * | w has even a's or odd b's}. L 1  L 2 = ? – Ans: {w in  * | w has even a's and odd b's}. By closure properties, both these are regular.

Lecture 3UofH - COSC Dr. Verma 4 DFA of L 1 = {w in {a,b}* | w has even number of a's}.

Lecture 3UofH - COSC Dr. Verma 5 DFA of L 2 = { w in {a,b}* | w has odd number of b's}.

Lecture 3UofH - COSC Dr. Verma 6 DFA of L 1  L 2 = {w in {a,b}* | w has even a's or odd b's}.

Lecture 3UofH - COSC Dr. Verma 7 DFA of L 1  L 2 = {w in {a,b}* | w has even a's and odd b's}.

Lecture 3UofH - COSC Dr. Verma 8 DFA of L 1  L 2 = {w in {a,b}* | w has even a's or odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 9 DFA of L 1  L 2 = {w in {a,b}* | w has even a's or odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 10 DFA of L 1  L 2 = {w in {a,b}* | w has even a's or odd b's}. abaaba

Lecture 3UofH - COSC Dr. Verma 11 DFA of L 1  L 2 = {w in {a,b}* | w has even a's or odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 12 DFA of L 1  L 2 = {w in {a,b}* | w has even a's and odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 13 DFA of L 1  L 2 = {w in {a,b}* | w has even a's and odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 14 DFA of L 1  L 2 = {w in {a,b}* | w has even a's and odd b's}. abaaba

Lecture 3UofH - COSC Dr. Verma 15 DFA of L 1  L 2 = {w in {a,b}* | w has even a's and odd b's}. aba

Lecture 3UofH - COSC Dr. Verma 16 DFA of A = {w | w contains at least one 1 and an even number of 0s follow the last 1}

Lecture 3UofH - COSC Dr. Verma 17 General Construction for  and  Idea: Simulate two DFA's in parallel. Let M 1 = (Q 1, ,  1, s 1, F 1 ) and M 2 = (Q 2, ,  2, s 2, F 2 ) M = (Q, , , s, F) where: Q = Q 1 X Q 2 s = (s 1, s 2 )  ((q 1, q 2 ),  ) = (  1 (q 1,  ),  2 (q 2,  )) For Union, F = ? – Ans: (Q 1 X F 2 ) U (F 1 X Q 2 ) For Intersection, F = ? – Ans: F 1 X F 2

Lecture 3UofH - COSC Dr. Verma 18 Nondeterministic Finite Automaton (NFA) Generalization of DFA. Allows: – 0 or more next states for the same (q,  ). Guessing – Transitions labeled by the empty string. Changing state without reading input Motivation: Flexibility. – Easier to prove many closure properties.

Lecture 3UofH - COSC Dr. Verma 19 How does an NFA work? w is accepted by an NFA provided there is a sequence of guesses that leads to a final state. Language accepted by NFA is the set of all strings accepted by it.

Lecture 3UofH - COSC Dr. Verma 20 Example: {w in {0,1}* | the second last symbol of w is a 1}

Lecture 3UofH - COSC Dr. Verma 21 NFA A = {w in {0,1}* | the second last symbol of w is a 1} 110

Lecture 3UofH - COSC Dr. Verma 22 NFA A = {w in {0,1}* | the second last symbol of w is a 1} 110

Lecture 3UofH - COSC Dr. Verma 23 NFA A = {w in {0,1}* | the second last symbol of w is a 1}

Lecture 3UofH - COSC Dr. Verma 24 NFA A = {w in {0,1}* | the second last symbol of w is a 1} 110

Lecture 3UofH - COSC Dr. Verma 25 Formal definition of NFA Notation:  e =  U {e}. NFA M = (Q, , , s, F) where: – Q - finite set of states –  - input alphabet – s - initial state – F  Q - set of final states –  is a subset of Q X  e X Q. If (p, u, q) in , then NFA in state p can read u and go to q.