CSCI 2670 Introduction to Theory of Computing August 25, 2005.

Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION Closure Properties of Regular Languages
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.
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
Finite Automata Section 1.1 CSC 4170 Theory of Computation.
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
Regular operations Sipser 1.2 (pages 47-63). First… a sample proof
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
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)
Finite Automata Costas Busch - RPI.
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
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.
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
Lecture 05: Theory of Automata:08 Kleene’s Theorem and NFA.
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 26, 2004.
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.
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.
CSCI 2670 Introduction to Theory of Computing
Languages.
Non Deterministic Automata
Formal Language & Automata Theory
Closure Properties for Regular Languages
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
CSCI 2670 Introduction to Theory of Computing
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
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
Presentation transcript:

CSCI 2670 Introduction to Theory of Computing August 25, 2005

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

Announcement Tutorials will be with Ryan Foster (room TBA) –Monday 2:30 – 3:30 –Friday 10:00 – 11:00 Hint on problem 0.12 –The proof can be done without induction. What can you conclude if all nodes have different degrees? In a graph with n nodes, what are the possible values for the degree of any node?

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 Can also design a DFA by combining two other DFA’s

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

q1q1 q2q2 q3q M1M1 q1’q1’q2’q2’ 1 0 M2M2 0,1 Another Example 1 Q = –{(q 1,q 1 ’), (q 1,q 2 ’), (q 2,q 1 ’), (q 2,q 2 ’), (q 3,q 1 ’), (q 3,q 2 ’)} Σ = {0,1} q0 = –(q 1,q 1 ’) F = –{(q 1,q 1 ’), (q 1,q 2 ’), (q 2,q 2 ’), (q 3,q 2 ’)}

q1q1 q2q2 q3q M1M1 q1’q1’q2’q2’ 1 0 M2M2 0,1 Another Example 1 01 (q 1,q 1 ’)(,) (q 1,q 2 ’)(,) (q 2,q 1 ’)(,) (q 2,q 2 ’)(,) (q 3,q 1 ’)(,) (q 3,q 2 ’)(,) (q 2,) (q 1,) (q 3,) (q 2,) (q 1,) (q 3,) (q 2,q 1 ’) (q 3,q 1 ’) (q 1,q 1 ’) (q 1,q 2 ’) (q 2,q 2 ’) (q 3,q 2 ’) (q 2,q 2 ’) (q 3,q 2 ’) (q 1,q 2 ’) (q 2,q 2 ’) (q 3,q 2 ’)

Another example q 1’ q 1 ’ q 2’ q 1 ’ q 3’ q 1 ’ q 1’ q 2 ’q 2’ q 2 ’ q 3’ q 2 ’

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