P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:

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.
Regular operations Sipser 1.1 (pages 44 – 47). CS 311 Mount Holyoke College 2 Building languages If L is a language, then its complement is L’ = {w |
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Costas Busch - RPI1 Single Final State for NFAs. Costas Busch - RPI2 Any NFA can be converted to an equivalent NFA with a single final state.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
Fall 2006Costas Busch - RPI1 Regular Expressions.
CS 310 – Fall 2006 Pacific University CS310 Converting NFA to DFA Sections:1.2 Page 54 September 15, 2006.
1 Regular Expressions. 2 Regular expressions describe regular languages Example: describes the language.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Regular.
Fall 2004COMP 3351 Single Final State for NFA. Fall 2004COMP 3352 Any NFA can be converted to an equivalent NFA with a single final state.
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.
1 NFAs accept the Regular Languages. 2 Equivalence of Machines Definition: Machine is equivalent to machine if.
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
NFA Closure Properties Sipser pages pages NFAs also have closure properties We have given constructions for showing that DFAs are closed under.
1 Problems of the day: 1. Let P= {(b, acbb), (aac, a), (b, ca)}. Prove that P has a match. 2. How many ways can aab be factored as x y z such that |y|≥
1 Proof of the Day: Let P= {(b, acbb), (aac, a), (b, ca)}. 1.Prove that P has a match. 2. Find Q which is P encoded in binary. 3.What match of Q corresponds.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
1 Let L= { w= u v : u  {a, b}*, v  {c, d}* and |u|= |v|} 1.Design a context-free grammar that generates L. 2.Use your grammar and the construction from.
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}
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Problem of the Day: Factor (ab) k as xyz in all ways such that y ≠ ε.
CSCI 2670 Introduction to Theory of Computing August 26, 2004.
CSCI 2670 Introduction to Theory of Computing August 25, 2005.
Prof. Busch - LSU1 NFAs accept the Regular Languages.
CSCI 2670 Introduction to Theory of Computing September 1, 2005.
Lecture 5 Sept 06, 2012 Regular expressions – examples Converting DFA to regular expression. (same works for NFA to r.e. conversion.) Converting R.E. to.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Regular Expressions Costas Busch - LSU.
1 Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism.
Regular Languages ภาษาปกติ. Jaruloj Chongstitvatana Outline Regular expressions Regular languages Equivalence between languages accepted by.
1 For each language, give a DFA that accepts it. L 1 = { w  {a, b}* : w at most 2 a’s} L 2 = { w  {0, 1}* : has both 00 and 11 as substrings} L 3 = {
Lecture 2 Overview Topics What I forgot from last lecture Proof techniques continued Alphabets, strings, languages Automata June 2, 2015 CSCE 355 Foundations.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
1 Language Recognition (11.4) Longin Jan Latecki Temple University Based on slides by Costas Busch from the courseCostas Busch
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
CSCI 2670 Introduction to Theory of Computing September 11, 2007.
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.
1 Use the pumping theorem for context-free languages to prove that L= { a n b a n b a p : n, p ≥ 0, p ≥ n } is not context-free. Hint: For the pumping.
Languages.
Closure Properties of Regular Languages
Properties of Regular Languages
CSE 105 theory of computation
Formal Language & Automata Theory
Single Final State for NFA
Closure Properties for Regular Languages
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Closure Properties of Regular Languages
Properties of Context-Free languages
Closure Properties of Regular Languages
Regular Languages ภาษาปกติ.
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Design NDFA’s which accept:
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
CSC312 Automata Theory Kleene’s Theorem Lecture # 12
NFAs accept the Regular Languages
Presentation transcript:

P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:

Announcements No office hours today. Assignment #2 is due on Wednesday. Send if you need help on the weekend.

(Comic by Randall Munroe.) CSC 320 Lecture 11: DFA’s and Regular Expressions

Lecture 11: Regular Languages The goal of the lecture is to prove that: R= { L : L is generated by a regular expression}, and S= { L : L is L(M) for a DFA(M)} are the same sets of languages (R=S). We already proved that S is the same set as T= {L : L = L(M) for some NDFA M} (Lecture 10). Before proving this, it is helpful to first show that the set S is closed under union, concatenation and Kleene star.

A set S is closed with respect to a binary operation · if for all s and t in S, s · t is in S. Examples: N= {0, 1, 2, 3, …} Closed for addition and multiplication. Not closed under subtraction or division.

The set S = { L : L is L(M) for some DFA M} is closed under union. Let M 1 = (K 1, Σ, δ 1, s 1, F 1 ) accept L 1 and M 2 = (K 2, Σ, δ 2, s 2, F 2 ) accept L 2. Proof 1: A construction for a new DFA M= (K, Σ, δ, s, F) which accepts L 1 ⋃ L 2. Proof 2: A construction for a new NDFA M= (K, Σ, Δ, s, F) which accepts L 1 ⋃ L 2.

The set S={ L : L is L(M) for some DFA M} is closed under concatenation. Let M 1 = (K 1, Σ, δ 1, s 1, F 1 ) accept L 1 and M 2 = (K 2, Σ, δ 2, s 2, F 2 ) accept L 2. Proof: A construction for a new NDFA M= (K, Σ, Δ, s, F) which accepts L 1 ۰ L 2.

The set S= { L : L is L(M) for some DFA M} is closed under Kleene star. Let M 1 = (K 1, Σ, δ 1, s 1, F 1 ) accept L 1. Proof: A construction for a new NDFA M= (K, Σ, Δ, s, F) which accepts L 1 *.

Theorem: If L is a regular language, then L is L(M) for some DFA M. Proof: By showing how to construct a NDFA for L. Last lecture, we proved by construction that for every NDFA, there is an equivalent DFA. So this indirectly gives a construction for a DFA.

Regular expressions over Σ: [Basis] 1. Φ and σ for each σ  Σ are regular expressions. [Inductive step] If α and β are regular expressions, then so are: 2. ( αβ) 3. (α ⋃ β) and 4. α * Note: Regular expressions are strings over Σ ⋃ { (, ), Φ, ⋃, * } for some alphabet Σ.

Theorem: If L is accepted by a DFA M, then there is a regular expression which generates L. There is a proof which constructs a regular expression from the DFA in the text (in the proof of Theorem 2.3.2). I expect you to know that this theorem is true but you are not responsible for the proof. Conclusion: A language is regular if and only if it is accepted by a finite automaton.

The set of S= { L : L is L(M) for some DFA M} is closed under complement. Let M 1 = (K 1, Σ, δ 1, s 1, F 1 ) accept L 1. Proof: A construction for a new DFA M= (K, Σ, δ, s, F) which accepts the complement of L 1. Regular languages are also closed for intersection (assignment #2).