CSCI 2670 Introduction to Theory of Computing August 26, 2004.

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

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.
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
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
Intro to DFAs Readings: Sipser 1.1 (pages 31-44) With basic background from Sipser 0.
Finite Automata and Non Determinism
CS 310 – Fall 2006 Pacific University CS310 Finite Automata Sections:1.1 page 44 September 8, 2006.
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 Languages and Finite Automata or how to talk to machines...
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.
Lecture 7 Sept 22, 2011 Goals: closure properties regular expressions.
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.
CS5371 Theory of Computation Lecture 4: Automata Theory II (DFA = NFA, Regular Language)
1 Regular Languages Finite Automata eg. Supermarket automatic door: exit or entrance.
Lecture 4UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 4.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (Section 1.2: NFA’s) David Martin With some modifications.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
THEORY OF COMPUTATION 08 KLEENE’S THEOREM.
CSCI 2670 Introduction to Theory of Computing August 24, 2005.
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
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong NFA to DFA.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
CS 208: Computing Theory Assoc. Prof. Dr. Brahim Hnich Faculty of Computer Sciences Izmir University of Economics.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
Theory of Computing CSCI 356/541 Lab Session. Outline Lab 1: Finite Automata  Construct and Run Construct and Run  Manipulating Transitions Manipulating.
August 23, 2005 CSCI 2670 Introduction to Theory of Computing August 23, 2005.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
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
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
Introduction to Automata Theory Theory of Computation Lecture 3 Tasneem Ghnaimat.
CSCI 2670 Introduction to Theory of Computing
Non Deterministic Automata
Properties of Regular Languages
Formal Language & Automata Theory
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Closure Properties for Regular Languages
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
Non Deterministic Automata
CSE 2001: Introduction to Theory of Computation Fall 2009
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
CSCI 2670 Introduction to Theory of Computing
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
CSCI 2670 Introduction to Theory of Computing
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Chapter 1 Regular Language
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
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing August 26, 2004

Agenda Last class –Defined regular languages –Discussed creating DFA’s This class –Finish Section 1.1 Next week –Section 1.2 (pages 47 – 63) Read pages 47 – 54 this weekend

Announcement Tutorials will be in room 524 with Junfeng Qu –Monday 8:00 – 9:00 AM –Thursday 4:00 – 5:00 PM

Designing finite automata Select states specifically to reflect some important concept Ensure this meaning is relevant to the language you are trying to define Try to get “in the head” of the automaton

Example Design a DFA accepting all strings over {0,1,2,3} such that the sum of the symbols in the string is equivalent to 2 modulo 4 or 3 modulo 4

Step 1 What states do we need? –One state for each value modulo 4 q 1 represents 1 modulo 4 q 2 represents 2 modulo 4 q 3 represents 3 modulo 4 q 4 represents 0 modulo 4

Step 2 Create the state transition table 0123 q 1 (1 mod 4)q1q1 q2q2 q 2 (2 mod 4)q2q2 q3q3 q 3 (3 mod 4)q3q3 q4q4 q 4 (0 mod 4)q4q4 q1q1

Step 3 What do we know? –Q, , and  So we still need q 0 and F –q 0 = q 4 –F = {q 2, q 3 }

Draw DFA q1q1 q3q3 q4q4 q2q

Combining regular languages We can create a regular language from other regular languages A and B using specific allowable operations called regular operations –Union: A  B –Concatenation: A  B –Kleene star: A *

Union is a regular operation Theorem: The class of regular languages is closed under the union operation Proof approach: Assume A 1 and A 2 are both regular languages with A 1 =L(M 1 ) and A 2 =L(M 2 ) and create a DFA M such that L(M) = A 1  A 2 Method: Proof by construction

Idea of construction Each state of the new DFA represents both where the same word would be if it was being processed in M 1 and where it would be if it were processed in M 2 –Keeping track of the progress of the string in both DFA’s simultaneously

Example q1q1 q2q2 q3q3 00 0,1 1 1 M1M1 q1,q1’q1,q1’q2,q1’q2,q1’ 0 q3,q2’q3,q2’ 1 1 q1’q1’q2’q2’q3’q3’ M2M2 1 1 etc. q3,q1’q3,q1’0 q1,q2’q1,q2’ 1 Maximum number of states? 9 product of number of states in M 1 and in M 2

Formally defining M M = (Q, , ,q 0,F) –Q = Q 1 × Q 2 Q 1 and Q 2 are the states in machines M 1 and M 2, respectively –  =  1   2  1 and  2 are the alphabets for machines M 1 and M 2, respectively –  ((r 1,r 2 ),a) = (  1 (r 1,a),  2 (r 2,a))  1 and  2 are the state transition functions for machines M 1 and M 2, respectively

Formally defining M M = (Q, , ,q 0,F) –q 0 = (r 1, r 2 ) r 1 and r 2 are the starting states in machines M 1 and M 2, respectively –F = {(r 1,r 2 ) | r 1  F 1 or r 2  F 2 } F 1 and F 2 are the accepting states for machines M 1 and M 2, respectively

Concatenation is a regular operation Theorem: The class of regular languages is closed under the concatenation operation Proof approach: Assume A 1 and A 2 are both regular languages with A 1 =L(M 1 ) and A 2 =L(M 2 ) and create a DFA M such that L(M) = A 1  A 2 Method: Proof by construction

Idea of construction Any accepting state in M 1 has a copy of M 2 “tacked on” –Problem: if we tack a copy of M 2 on at each accepting states, we lose the deterministic property

Example q1q1 q2q2 q3q3 00 0,1 1 1 M1M1 1 q1’q1’q2’q2’q3’q3’ M2M2 1 q1q1 q2q2 q3q q1’q1’q2’q2’q3’q3’ ε Can jump to q 1 ’ non- deterministically

Next week Non-determinism