Complexity and Computability Theory I Lecture #8 Instructor: Rina Zviel-Girshin Lea Epstein.

Slides:



Advertisements
Similar presentations
CMPS 3223 Theory of Computation
Advertisements

Lecture 24 MAS 714 Hartmut Klauck
Complexity and Computability Theory I Lecture #4 Rina Zviel-Girshin Leah Epstein Winter
Deterministic Finite Automata (DFA)
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
1 Introduction to Computability Theory Lecture2: Non Deterministic Finite Automata Prof. Amos Israeli.
1 Introduction to Computability Theory Lecture3: Regular Expressions Prof. Amos Israeli.
Introduction to Computability Theory
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
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.
CS 310 – Fall 2006 Pacific University CS310 Decidability Section 4.1/4.2 November 10, 2006.
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.
1 Lecture 16 FSA’s –Defining FSA’s –Computing with FSA’s Defining L(M) –Defining language class LFSA –Comparing LFSA to set of solvable languages (REC)
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)
Theory of Computing Lecture 22 MAS 714 Hartmut Klauck.
Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY For next time: Read 2.1 & 2.2.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA minimization.
Great Theoretical Ideas in Computer Science.
Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { ‘{‘, ‘}’ } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite language,
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
Theory of Languages and Automata
Theory of Computation, Feodor F. Dragan, Kent State University 1 Regular expressions: definition An algebraic equivalent to finite automata. We can build.
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
Pushdown Automata (PDAs)
Decidable Questions About Regular languages 1)Membership problem: “Given a specification of known type and a string w, is w in the language specified?”
Complexity and Computability Theory I Lecture #9 Instructor: Rina Zviel-Girshin Lea Epstein.
Complexity and Computability Theory I Lecture #2 Rina Zviel-Girshin Leah Epstein Winter
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
CSCI 2670 Introduction to Theory of Computing September 13.
The decidability of Presburger Arithmetic By Guillermo Guillen 04/13/05 Dr. Smith COT 6421 FIU Spring 2005.
CS 154 Formal Languages and Computability February 9 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 4 Decidability Some slides are in courtesy.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Regular Languages Chapter 1 Giorgi Japaridze Theory of Computability.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
 2005 SDU Lecture11 Decidability.  2005 SDU 2 Topics Discuss the power of algorithms to solve problems. Demonstrate that some problems can be solved.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
Lecture #5 Advanced Computation Theory Finite Automata.
CIS 262 Automata, Computability, and Complexity Fall Instructor: Aaron Roth
Complexity and Computability Theory I
Non Deterministic Automata
CSE 105 theory of computation
Complexity and Computability Theory I
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
Hierarchy of languages
Non-Deterministic Finite Automata
COSC 3340: Introduction to Theory of Computation
4. Properties of Regular Languages
Nondeterministic Finite Automata
Minimal DFA Among the many DFAs accepting the same regular language L, there is exactly one (up to renaming of states) which has the smallest possible.
CSC 4170 Theory of Computation Nondeterminism Section 1.2.
CSCI 2670 Introduction to Theory of Computing
Presentation transcript:

Complexity and Computability Theory I Lecture #8 Instructor: Rina Zviel-Girshin Lea Epstein

Rina Overview Minimalization Equivalence Minimalization algorithm Examples

Rina Example over  ={0,1} Consider the following automata that accept L =  *. A:B: C:

Rina Minimalization Input A DFA A Output A DFA B such that L(B)=L(A) B accepts the same language A does B has a minimal number of states among all DFA’s accepting the language Such B will be called the minimal DFA of A.

Rina Minimalization Idea We will convert a non minimal DFA into a minimal DFA. What do we mean when we say: “The automaton is not minimal”. That means exist at least two states which can be unified into one.

Rina Unification Two states can be unified if they have the same behavior. For all possible strings, whether we are in one state or another, we get the same result – –either both lead to accepting the string (to an accepting state) or –both lead to rejection of the string (to a non accepting state).

Rina Example from real life An automaton which decides whether to take an umbrella We have two states: –one “there is rain outside” and –another “drops of water are falling from the sky” –then on input “I have to go out”, both will lead to the same conclusion of the need of umbrella. Therefore the states can be unified.

Rina Example of automaton q0 and q2 have the same behavior. For each letter go to the same state: for 1 to q3 and for 0 to q1.

Rina Example (cont) The minimal automaton:

Rina State equivalence States that have the same behavior and therefore can be united called equivalent states. Informally: Two states are equivalent if there is no string which leads from one to an accepting state and from the other to a non accepting state. Formally: Two states p and q are equivalent iff for all w  *  ’(q,w)  F iff  ’(p,w)  F

Rina Separating words If two states p and q are not equivalent then there is a string w which leads from one state to an accepting state and from the other to a non accepting state. Such a word w is called a separation word for the two states. Either  ’(q,w)  F and  ’(p,w)  F or  ’(q,w)  F and  ’(p,w)  F We can also say that p and q are separated by w.

Rina k-equivalence Informally: Two states p and q are k-equivalent if they have no separating word of length not exceeding k (less or equal k) Notation: pE k q

Rina Example States q0 and q1 are 2-equivalent because the is no separation word of length less or equal 2. q0E 2 q1 But states q0 and q1 are not 3-equivalent because there is a word w=000 that separates them.  ’(q0,000)=q3  F and  ’(q1,000)=q4  F

Rina k-equivalence Formally: Two states p and q are k-equivalent if”f for all w  * such that |w|  k  ’(q,w)  F iff  ’(p,w)  F Other formulations of the same definition. If there is a separating word its length is greater than k. For all words of length not greater than k p and q are equivalent.

Rina Equivalence of states Two states are equivalent if they are k- equivalent for all k. or There is no separating word of any length between the states.

Rina Example In this example q0 and q2 are equivalent because after first letter of the word they go to the same state. That means that for each word with length greater than 1 they behave in the same way.

Rina Example So there is no separation word of any length between q0 and q2.

Rina Terminology We will use the term set of states Q for the set of all states of an automaton. The “clusters” of an equivalence relation states are called classes. Q can be divided into classes of states. In previous example: {q0,q2} is called a class.

Rina Minimalization algorithm technique The minimalization algorithm will use the dynamic programming technique. We will incrementally separate the set of states into equivalent subsets using k equivalence.

Rina Minimalization algorithm technique (cont.) Step by step we will find whether there is a separating word of the class and divide the class which it separates into subclasses. At each step we will increase the length of separating word starting with 0. At each step we will use the result of the previous step and apply a simple checking mechanism on the classes derived in the previous step.

Rina Example There is a word of length 0 that separates between q0 and q1,q2. So we can divide the Q into two classes: {q0},{q1,q2}.

Rina Example (cont.) The class with only one state can't be divided into subclasses. But the class with more than one state can be divided. So lets check the class {q1,q2}.

Rina Example (cont.) For any word of length equal to 1 both of them lead to the same state q0. So there is no separation word between q1 and q2. That means that they are 1-equivalent.

Rina Example (cont.) The classes of Q remain the same: {q0},{q1,q2}. So it is a final partition of Q.

Rina Example (cont.) The minimal automaton has two states {q0},{q1,q2}.

Rina When to stop? When do we stop to compute E i ? When there is no difference between the equivalent subsets of the last two states: E k =E k+1. Why? Because for each letter of  we go to equivalent classes.

Rina Theorem If E k =E k+1 then E k+1 =E k+2. Proof: Assume that E k =E k+1 and prove that for any pair of states p and q pE k+1 q iff pE k+2 q. If pE k+2 q then pE k+1 q.If there is no separation word of length k+2 so there is obviously no separation word of length less than k+2.

Rina Theorem If E k =E k+1 then E k+1 =E k+2. Proof (cont.) pE k+1 q means that pE k q and for each   (p,  )E k  (q,  ). We know that E k =E k+1. So we know that pE k+1 q and for each   (p,  )E k+1  (q,  ). That means that pE k+2 q.

Rina Theorem conclusion Conclusion: The computation of equivalence states stops when E k =E k+1.

Rina Minimalization algorithm Input: A DFA A. Output: A minimal state DFA B. 1.Divide Q into two subsets: final states F and non final states Q-F.

Rina Minimalization algorithm (cont.) 2. While in the previous step a change was made do at step j+1 for each j-equivalence class C (subset in the previous step) for each pair of states p and q in C for each  if  (p,  ) is not j-equal to  (q,  ) than divide C into classes in such way that p and q will be in different classes.

Rina Minimalization algorithm (cont.) 3. The set of the states in B is the set of classes resulting from the step The starting state of B will be the class that includes the starting state of A. 5. The final states of B will be the classes including final states of A. 6. Transition function of B: for each state P in B and   (P,  )=R if for all p  P  A (p,  )  R.

Rina Example Construct a minimal DFA equivalent to a given DFA:

Rina Example (cont.) E 0 ={{q0,q3}, {q1,q2}} E 1 =E 0

Rina Example (cont.) So the minimal DFA is:

Rina Another example Construct a minimal DFA equivalent to a given DFA b

Rina Another example (cont.) 1. First lets find the states that are 0-equivalent: E 0 = { F, Q-F} = { {q4}, {q0,q1,q2,q3}} b

Rina Another example (cont.) 2. Now we find the states that are 1-equivalent. The only class that can be divided is {q0,q1,q2,q3}. E1E1 ab q0q2q1 q3q1 q2q3q2 q3 q4

Rina Another example (cont.) So for the word w=a all the states go to the same class in E 0. Another word of length 1 is w=b. We can see that {q0,q1,q2} go to the same class in E 0 and q3 goes to the other class. So q3 should be separated from other states in its class. The separation word is b. The result is: E 1 = { {q4}, {q3}, {q0,q1,q2}}

Rina Another example (cont.) 3. Now we find the states that are 2-equivalent. The only class that can be divided is {q0,q1,q2}. E1E1 ab q0q2 q1q4 q2q4 So q0 san be separated from q1,q2. E 2 = { {q4}, {q3}, {q0}, {q1,q2}} ab is a separating word

Rina Another example (cont.) 4. Now we find the states that are 3-equivalent. The only class that can be divided is {q1,q2}. It can't be divided. Over a q1,q2 both go to q3 and than behave the same way. Over b each of them stay in the same non accepting state. So E 2 =E 3 = { {q4}, {q3}, {q0}, {q1,q2}}.

Rina Another example (cont.) The resulting automaton is:

Rina Any Questions?