Lecture 5 Examples of DFA

Slides:



Advertisements
Similar presentations
Chapter Three: Closure Properties for Regular Languages
Advertisements

8/27/2009 Sofya Raskhodnikova Intro to Theory of Computation L ECTURE 2 Theory of Computation Finite Automata Operations on languages Nondeterminism L2.1.
By: Matthew Ng. AND, XOR, OR, Complement, Circular Left shift, and Addition Modulo Circular Left Shift is done with s positions (0 ≤ s ≤ 31) – Denoted.
Chapter 4 Finite Fields. Introduction of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key concern operations on “numbers”
Consecutive Integer Problems. What is a consecutive integer? Integer: natural numbers and zero Integer: natural numbers and zero Consecutive: one after.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Prof. Busch - LSU1 Properties of Context-Free languages.
Finite Automata and Non Determinism
1 Positive Properties of Context-Free languages. 2 Context-free languages are closed under: Union is context free is context-free.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
Homework #2 Solutions.
Congruence of Integers
Fall 2006Costas Busch - RPI1 Properties of Regular Languages.
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.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
1 A Non Context-Free Language (We will prove it at the next class)
Lecture 12: Computer Arithmetic Today’s topic –Numerical representations –Addition / Subtraction –Multiplication / Division 1.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
1 State SymbolRead- Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
Theory of Computing Lecture 21 MAS 714 Hartmut Klauck.
TK PrasadPumping Lemma1 Nonregularity Proofs. TK PrasadPumping Lemma2 Grand Unification Regular Languages: Grand Unification (Parallel Simulation) (Rabin.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
INHERENT LIMITATIONS OF COMPUTER PROGAMS CSci 4011.
Chapter 4 Integer Data Representation. Unsigned Integers.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
Costas Busch - LSU1 Properties of Context-Free languages.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 9 Mälardalen University 2006.
Finite State Machines 1.Finite state machines with output 2.Finite state machines with no output 3.DFA 4.NDFA.
Lecture # 15. Mealy machine A Mealy machine consists of the following 1. A finite set of states q 0, q 1, q 2, … where q 0 is the initial state. 2. An.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen.
Finite Automata A simple model of computation. 2 Finite Automata2 Outline Deterministic finite automata (DFA) –How a DFA works.
P Symbol Q E(Q) a b a b a b Convert to a DFA: Start state: Final States:
1 Closure E.g., we understand number systems partly by understanding closure properties: Naturals are closed under +, , but not -, . Integers are closed.
Decidability.
Chapter 4 Operations on Bits.
CSE 105 theory of computation
Properties of Regular Languages
Objectives Solve compound inequalities with one variable.
Theory of Computation Lecture # 9-10.
The Definition of Algorithm
Analytic Number Theory MTH 435
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Undecidable Problems (unsolvable problems)
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE322 PROPERTIES OF REGULAR LANGUAGES
Properties of Regular Languages
CSE 311: Foundations of Computing
COSC 3340: Introduction to Theory of Computation
CSE322 CONSTRUCTION OF FINITE AUTOMATA EQUIVALENT TO REGULAR EXPRESSION Lecture #9.
Decidable Languages Costas Busch - LSU.
Deterministic PDAs - DPDAs
CSE322 Minimization of finite Automaton & REGULAR LANGUAGES
Closure Properties of Context-Free languages
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
Closure Properties of Regular Languages
Properties of Context-Free languages
Add or Subtract? x =.
Convert to a DFA: Start state: Final States: State Symbol Read- Q E(Q)
Convert to a DFA: Start state: Final States: P Symbol Q E(Q) a b.
Instructor: Aaron Roth
It is the whole universe under consideration.
CSE 105 theory of computation
Lecture 3 Strings and Things (Section 1.1)
CSE 105 theory of computation
Presentation transcript:

Lecture 5 Examples of DFA

Construct DFA to accept (0+1)* 1

Construct DFA to accept 00(0+1)* 1 1 1 1

(0+1)*00(0+1)* Idea: Suppose the string x1x2 ···xn is on the tape. Then we check x1x2, x2x3, ..., xn-1xn in turn. Step 1. Build a checker

Step 2. Find all edges by the following consideration: Consider x1x2. If x1=1, then we give up x1x2 and continue to check x2x3. So, we have δ(q0, 1) = q0. If x1x2 = 01, then we also give up x1x2 and continue to check x2x3. So, δ(q1, 1) = δ(q0, 1) =q0. If x1x2 = 00, then x1x2··· xn is accepted for any x3···xn. So, δ(q2,0)=δ(q2,1)=q2.

(0+1)*00(0+1)* 1 1 1

(0+1)*00 1 1 1

In general, suppose x1 x2 … xn is the string on the tape And we want check x1 …xk, x2 …xk+1, …, in turn. If x1…xk Is not the substring that we want and we need to check x2…xk+1, then we set that for and i < k, δ( δ(s, x1 …xi), xi+1) = δ(s, x1…xi xi+1).

(0+1)*(00+01) 1 1 1 1

2nd Solution-Parallel Machine L(M) = (0+1)*00 M=(Q, Σ, δ, s, F) L(M’)= (0+1)*01 M’=(Q’, Σ, δ’, s’, F’) L(M’’) = (0+1)(00+01) = L(M) U L(M’) Q’’ = {(q, q’) | q in Q, q’ in Q’} δ’’((q, q’), a) = (δ(q, a), δ’(q’, a)) s’’ = (s, s’) F’’ = { (q, q’) | q in F or q’ in F’ }.

1 1 1 c a c b a b 1 1 1 1 a b c a b b 1 1 a 1 c

Union, Intersection, subtraction Union: F’’ = {(q,q’) | q in F or q’ in F’} Intersection: F’’= {(q,q’) | q in F and q’ in F’} Subtraction: L(M) \ L(M’) F’’ = {(q,q’) | q in F and q’ not in F’}

(0+1)*00 ∩ (0+1)*01 1 1 1 c a c b a b 1 1 1 1 a b c a b b 1 1 a 1 c c 1 1 c a c b a b 1 1 1 1 a b c a b b 1 1 (0+1)*00 ∩ (0+1)*01 a 1 c c c

1 1 1 c a c b a b 1 1 1 1 a b c a b b 1 1 (0+1)*00 \ (0+1)*01 a 1 c

Complement L(M’)= Σ*-L(M) F’ = Q - F 1 1 (0+1)*00

The set of all binary strings beginning with 1 which interpreted as a binary representation of an integer, is congruent to zero modulo 5. Idea: To construct a DFA, we need to figure out what should be states and where each edge should go. Usually, states can be found through studying the condition for accepting. The condition for accepting a string x1x2···xn is x1x2···xn ≡ 0 mod(5). So, we first choose residues 0, 1, 2, 3, 4 as states.

2i + 0 ≡ ? (mod 5) 2i + 1 ≡ ? (mod 5) 1 1 2 1 1 1 1 1 3 4 0,1