Topics COSC Administrivia. Topics Today. Administrivia (II) Acknowledgements. Slides presented May 9th and 16th,

Size: px
Start display at page:

Download "Topics COSC Administrivia. Topics Today. Administrivia (II) Acknowledgements. Slides presented May 9th and 16th,"

Transcription

1 Topics COSC 2001 Introduction to the Theory of Computation Dr. David Forster Basic concepts of theoretical CS, with practical applications: Regular Languages Context Free Languages Recursively Enumerable Languages Finite Automata & Regular Expressions Context Free Grammars & Pushdown Automata Turing Machines, Computability, Halting Problem NP completeness (time permitting!) Text editor Parser, Compiler General computer model COSC Topics Today Administrivia Motivation & Overview Review: Set theory, relations, proofs Alphabets, Strings, and Languages Administrivia Lecture hours: R 19:00 to 22:00, CSB 121 Office hours: TR 16:00 to 17:00, CSB david@cs.yorku.ca subject: 2001: web page: Text: Kinber & Smith, Theory of Computing: A Gentle Introduction HMU = Hopcroft, Motwani & Ullman, Introduction to Automata Theory, Languages, and Computation COSC COSC Administrivia (II) Evaluation: 5 assignments 10% midterm 30% final 60% Acknowledgements These slides are courtesy Dr. Nancy Ide, Vassar, with some modifications and additions by David Forster. COSC COSC Slides presented May 9th and 16th,

2 Motivation Overview (I) Why do we care about automata? modelling circuits, protocols pattern matching, search lexical analysers (RE) (RL) Automata states (including start & final) input arcs Push compilers (CFL) Start off on Push COSC COSC Overview (II) "Structural Representation" grammars Overview (III) Complexity decidable: what's possible? tractable: what's practical? (Sentence Subject Verb Object) regular expressions [a-za-z_][a-za-z_0-9]* COSC COSC Concept Review sets, membership (x R), subset (R S), union (R S), intersection (R S), cartesian product (R S), complement (R) pigeonhole principle relations: reflexive, symmetric, transitive equivalence relations, equivalence classes Formal Proof need it for this course need it to reason about design? programs? systems? 1. seat of your pants 2. verify everything 3. somewhere in between functions, bijections, inverses COSC COSC Slides presented May 9th and 16th,

3 Deductive Proofs sequence of statements: hypothesis deductions conclusion deduction based on: accepted logical principle given fact previous step combination Example of a Formal Proof Theorem: If x is the sum of the squares of four positive integers, then 2 x x 2 Step Statement x = a 2 + b 2 + c 2 + d 2 a 1; b 1; c 1; d 1 a 2 1; b 2 1; c 2 1; d 2 1 x 4 2 x x 2 Justification Given Given (2) & properties of arithmetic (1), (3), & properties of arithmetic (4) & Theorem 1.3* From HMU: theorem 1.4 & fig. 1.3 *: Previously proved in HMU: If x 4, then2 x x 2 COSC COSC Starting a Proof don't know how to start? reduce terms in hypothesis to their definitions e.g., some definitions: def n 1: a set S is finite if S = n, for some n def n 2: if sets S and T are subsets of a set U, then T is the complement of S w.r.t. U if S T = U and S T = φ now prove: Let S be a finite subset of some infinite set U. Let T be the complement of S with respect to U. Then T is infinite. COSC Example: Restating the givens Theorem: Let S be a finite subset of some infinite set U. Let T be the complement of S with respect to U. Then T is infinite. Original Statement S is finite U is infinite T is the complement of S From HMU: fig. 1.4: Restating the givens of Theorem 1.5 New Statement There is an integer n such that S = n For no integer p is U = p S T = U and S T = φ COSC A Proof 1) S and T are disjoint, so S + T = U 2) S is finite, so S = n for some integer n 3) U is infinite, so there is no p s.t. U = p 4) assume T is finite, so T = m 5) now, U = S + T = n + m 6) but this contradicts (3), so assumption (4) must be false, i.e., T must be infinite. Q.E.D. An "If-then" by any other name H C H implies C H only if C C if H Whenever H holds, C follows C hidden hypothesis? ex., "sin 2 θ + cos 2 θ = 1" is really: "if θ is an angle, sin 2 θ + cos 2 θ = 1" COSC COSC Slides presented May 9th and 16th,

4 A if and only if B: If-and-only-If A B A iffb A is equivalent to B A exactly when B Iff (II) two parts, need to prove both: 1. if A then B 2. if B then A if and only-if are converses of each other "if A then B" says nothing about whether B is true when A is false (and vice versa) COSC COSC Quantifiers for all: there exists: order is important: d represents a driver, c a car d c: driver(d) (car(c) & drives(d,c)) "all drivers drive some car" (not necessarily the same one) c d: driver(d) (car(c)& drives(d,c)) "all drivers drive the same car" Additional forms of proof proofs about sets contrapositive proof by contradiction counterexamples COSC COSC Set Equivalences often need to prove two sets are same, e.g., sets of strings, languages, etc. we write: E = F we mean: "x is in E iff x is in F" e.g.: R S = S R so prove: x is in R S iff x is in S R The Contrapositive "if H then C" "if not C then not H" H C if con. F F T T F T T T T F F F T T T T don't confuse with "converse" COSC COSC Slides presented May 9th and 16th,

5 Proof by Contradiction already demonstrated (slide "A Proof") assume opposite of something to prove show that the assumption must be false therefore, thing to prove must be true Counterexamples theorems are statements about infinite number of cases otherwise: merely an "observation" one false case disproves theorem "All computer scientists wear plaid." COSC COSC Inductive Proofs Prove a statement S(X) about a family of objects X (e.g., integers, trees) in two parts: 1. Basis: Prove for one or several small values of X directly. 2. Inductive step: Assume S(Y) for Y smaller than X; prove S(X) using that assumption. COSC Structural Induction (I) structures with recursive definitions: basis case(s): elementary structures inductive step(s): define complex structure in terms of previously defined structures e.g., complex noun phrases: Noun : "rocket", "manifold", "engine" Complex noun phrase : Noun or noun followed by a complex noun phrase thus: "rocket", "rocket engine", "rocket engine manifold", COSC Structural Induction (II) Use following form to prove theorems about recursively defined structures: Basis: Prove S(X) for the basis structure(s) X. Inductive Step: Take structure X formed from Y 1,,Y k, assume S(Y 1 ),,S(Y k ), use to prove S(X) Example (I) A binary tree with n leaves has 2n - 1 nodes Formally, S(T): if T is a binary tree with n leaves, then T has 2n-1 nodes Induction is on the size = number of nodes of T COSC COSC Slides presented May 9th and 16th,

6 Example (II) Basis: If T has 1 leaf, it is a one-node tree. 2(1) 1 = 1. Induction: Assume S(U) for trees with fewer nodes than T. In particular, assume for the subtrees of T. (so now prove S(T) with this assumption) Example (III) 1. T must be a root plus two subtrees U and V 2. If U and V have u and v leaves, respectively, and T has t leaves, then u + v = t 3. By the inductive hypothesis, U and V have 2u-1 and 2v-1 nodes, respectively 4. Then T has 1+(2u-1)+(2v-1) nodes = 2(u+v) 1 = 2t-1, proving the inductive step. COSC COSC Example: Balanced Parentheses Here are two ways to define "balanced parentheses": 1. Grammatically: a) The empty string ε is balanced b) If w is balanced, then (w) is balanced c) If w and x are balanced, then so is wx 2. By Scanning: w is balanced if and only if: a) w has an equal number of left and right parentheses b) Every prefix of w has at least as many left as right parentheses Call these GB and SB properties, respectively. Theorem: A string of parentheses w is GB if and only if it is SB. If An induction on w (length of w). Assume w is SB; prove it is GB. Basis: If w = ε (length = 0), then w is GB by rule (a). Notice that we do not even have to address the question of whether ε is SB (it is, however). Induction: Suppose the statement "SB implies GB" is true for strings shorter than w. COSC COSC Case 1: w is not ε, but has no non-empty prefix that has an equal number of ( and ). Then w must begin with ( and end with ); i.e., w = (x). x must be SB (why?) By the IH, x is GB GB/SB (II) By rule 1(b), (x) is GB; but (x) = w, so w is GB Case 2: w = xy, where x is the shortest non-empty prefix of w with an equal number of ( and ), and y is not ε. x and y are both SB (why?) By the IH, x and y are GB w is GB by rule 1(c) GB/SB (III) COSC COSC Slides presented May 9th and 16th,

7 Only-If GB/SB (IV) An induction on w. Assume w is GB; prove it is SB. Basis:w = ε. Clearly w obeys the conditions for being SB. Induction: Assume GB implies SB" for strings shorter than w, and assume w is not ε. Case 1: w is GB because of rule 1(b); i.e., w = (x) and x is GB. by the IH, x is SB. GB/SB (V) Since x has equal numbers of ('s and )'s, so does (x). Since x has no prefix with more ('s than )'s, so does (x). COSC COSC Case 2: GB/SB (VI) w is not ε and is GB because of rule (c); i.e., w = xy, and x and y are GB. By the IH, x and y are SB. (Aside) Trickier than it looks: we have to argue that neither x nor y could be ε, because if one were, the other would be w, and this rule application could not be the one that first shows w to be GB. xy has equal numbers of ('s and )'s because x and y both do. If w had a prefix with more )'s than ('s, that prefix would either be a prefix of x (contradicting the fact that x has no such prefix) or it would be x followed by a prefix of y (contradicting the fact that y also has no such prefix). Above is an example of proof by contradiction. We assumed our conclusion about w was false and showed it would imply something that we know is false. COSC Languages Alphabet (Σ): finite set of symbols, e.g., - Σ = {0, 1} (binary alphabet) - ASCII Word or String = finite sequence of symbols chosen from some alphabet, e.g., or abracadabra Language = set of strings chosen from some alphabet COSC Language Examples The set of all binary strings consisting of at least one 0, followed by an equal number of 1's, i.e., {01, 0011, , } C (the set of compilable C programs) English COSC Strings Empty string:ε Length: abcde= 5 uv = u + v Reverse: w R If w= abc, w R = cba Substring: any string of consecutive characters in some w Prefix and suffix: if w = vu, v and u are a prefix and a suffix of w, respectively Convention: Use lower case letters from the beginning of the alphabet for symbols, lower case letters from end of alphabet for strings COSC Slides presented May 9th and 16th,

8 Strings (cont'd) Concatenation : Given strings x and y, concatenation is xy e.g., x = abc, y = def, xy = abcdef Powers Σ k = set of all strings from alphabet Σ with length k Σ 0 = {ε} Σ * = set of all strings from alphabet Σ Σ + = Σ * -{ε} COSC More About Languages Can concatenate languages L 1 L 2 = {xy x L 1, y L 2 } L n = L concatenated with itself n times L 0 = {ε}; L 1 = L Star-closure L * = L 0 L 1 L 2 (note: L + = L * -L 0 ) Languages can be finite or infinite L = {a, aba, bba} L = {a n n > 0} Subtle point: a language may be infinite, but there is some finite set of symbols of which all its strings are composed COSC Finite Automata describe regular languages: simple, highly useful L s graphwith finite number of nodes (states) arcs labelled with one or more symbols from Σ one state is start / initial state some states are final / favoured / accepting states The language of the FA is the set of strings that label paths that go from the start state to some accepting state Example Below FA scans HTML documents, looking for a list of what could be title-author pairs Accepts whenever it finds the end of a list item Could be basis for application COSC COSC Scan HTML Documents HTML Document Example start <ol>, <ul> <li> <li> Any non-tag space b y space <ul> <li> start <ol>, <ul> <li> IALC by HM&U </li> <li> <li> LotR by T </li> </ul> </ol>, </ul> </li> Any non-tag space b y space Any non-tag Any non-tag </ol>, </ul> </li> COSC COSC Slides presented May 9th and 16th,

9 Recognize Simple Identifiers Newspaper Vending Machine quarter start letter letter or digit start dime dime dime quarter dime, quarter other character (delimiter) nickel nickel nickel nickel nickel, dime, quarter quarter COSC COSC Formal Definition of Finite Automaton A FA is represented as the five-tuple: A = (Q, Σ, δ, q 0, F) Q Finite set of states Σ Alphabet of input symbols δ A transition function q 0 start/initial state F Zero or more final/favoured/accepting states FA Transition Function We write: δ(q,a) = p where: q, p are states a is an input symbol Intuitively: if the FA is in state q, and input a is received, then the FA goes to state p (note: q = p is OK) COSC COSC Example: Clamping Logic We may think of an accepting state as representing a "1" output and non-accepting states as representing "0" output. A "clamping" circuit waits for a 1 input, and forever after makes a 1 output. However, to avoid clamping on spurious noise, we'll design an FA that waits for two 1's in a row, and "clam" only then. In general, we may think of a state as representing a summary of the history of what has been seen on the input so far. COSC The states we need are: State q 0, the start state, says that the most recent input (if there was one) was not a 1, and we have never seen two 1's in a row. State q 1 says we have never seen 11, but the previous input was 1. State q 2 is the only accepting state, it says that we have at some time seen 11. Thus, A = ({q 0, q 1, q 2 }, {0, 1}, δ, q 0, {q 2 }), where δ is given by: 0 1 >q 0 q 0 q 1 q 1 q 0 q 2 *q 2 q 2 q 2 By marking the start state with > and accepting states with *, the transition table that defines δ also specifies the entire FA COSC Slides presented May 9th and 16th,

10 Conventions It hel if we can avoid mentioning the type of every name by following some rules: Input symbols are a, b, etc., or digits. Strings of input symbols are u, v,..., z. States are q, p, etc. Transition Diagram An FA can be represented by a graph: nodes = states arc from q to p is labeled by the set of input symbols a such that δ(q, a) = p. No arc if no such a. Start state indicated by word "start" and an arrow. Accepting states get double circles. COSC COSC Example Extension of δ to Paths For the Clamping FA: start ,1 Intuitively, a FA accepts a string w = a 1 a 2 a n if there is a path in the transition diagram that: 1. Begins at the start state, 2. Ends at an accepting state, and 3. Has sequence of labels a 1,a 2,,a n COSC COSC Extension of δ to Paths (II) Formally, extend δ to Basis: i.e., stay put on no input Induction: i.e., see where the FA goes on w, then look for the transition on the last symbol from that state δ (q,w) δ (q,ε) = q δ (q,wa) = δ (δ (q,w),a) Aside Important fact with a straightforward, inductive proof: δ really represents paths. That is, if w = a 1 a 2 a n, and δ ( p i-1,a i ) = p i for all i = 1,..., n, then δ ( p 0,w) = p n COSC COSC Slides presented May 9th and 16th,

11 Acceptance of Strings FA A = (Q, Σ, δ, q 0, F) accepts string w if δ (q 0, w) is in F. Language of a FA FA A accepts the language L(A) = {w δ (q 0, w) is in F}. COSC Type Errors A major source of confusion when dealing with automata (or mathematics in general) is making "type errors." Example: Don't confuse A, a FA, i.e., a program, with L(A), which is of type "set of strings." Example: the start state q 0 is of type "state," but the accepting states F is of type "set of states." Trickier example: Is a a symbol or a string of length 1? Answer: it depends on the context, e.g., is it used in δ(q, a), where it is a symbol, or δ(q, a), where it is a string? COSC Non-deterministic Finite Automata Allow (deterministic) FA to have a choice of 0 or more next states for each state-input pair. Important tool for designing string processors, e.g., grep, lexical analyzers. But "imaginary," in the sense that it has to be implemented deterministically. Example Design an NFA to accept strings over alphabet {1, 2, 3} such that the last symbol appears previously, without any intervening higher symbol, e.g., Trick: use start state to mean "I guess I haven't seen the symbol that matches the ending symbol yet." Three other states represent a guess that the matching symbol has been seen, and remembers what that symbol is. COSC COSC Formal NFA (I) 1,2,3 p q r 2 2 t N = (Q, Σ, δ, q 0, F) where all is as DFA, but δ(q, a) is a set of states, rather than a single state. 3 3 s 1,2 COSC COSC Slides presented May 9th and 16th,

12 Formal NFA (II) Extension to δ Basis: δ (q, ε) = {q}. Induction: Let: δ (q, w) = {p 1, p 2,, p k } δ (p i, a) = S i for i = 1, 2,, k Then: δ (q, wa) = S 1 S 2 S k. COSC Language of a NFA An NFA accepts w if any path from the start state to an accepting state is labeled w. Formally: L(N) = {w δ (q 0, w) F φ}. COSC Equivalence of DFA and NFA For every NFA there is an equivalent (accepts the same language) DFA. But the DFA can have exponentially many states. From NFA N = (Q N, Σ, δ N, q 0, F N ) create equivalent DFA D = (Q D, Σ, δ D, {q 0 }, F D ): 1. Q D = 2 QN, i.e., the set of all subsets of Q N 2. F D is the set of sets S in Q D such that S F N φ 3. δ D ({q 1,q 2, q k }, a) = δ N (p 1,a) δ N (p 2,a) δ N (p k,a) Key theorem (induction on w ): δ D ({q 0 }, w) = δ N (q 0,w) Consequence: L(D) = L(N) DFA from NFA COSC COSC Subset Construction Starting with q 0 in N, for each a Σ, compute the set S of states accessible from q 0 on input a: this set becomes a new state in D, so δ D ({q 0 }, a) = S Repeat for each new state so discovered, so that for each such set S, and each p i S δ D (S, a) =δ N (p 1, a) δ N (p 2, a) δ N (p k, a) COSC Example: DFA from Clamping NFA 1,2,3 p q r s 1,2 COSC t Subset construction: δ({p},1)={p,q} δ({p},2)={p,r} δ({p},3)={p,s} δ({p,q},1)={p,q,t} δ({p,q},2)={p,r} δ({p,q},3)={p,s} δ({p,r},1)={p,q,r} ¼ Slides presented May 9th and 16th,

13 Example: δ for Clamping DFA For the NFA example above, there are 32 possible subsets computing transitions "on demand" gives a DFA with 15 states and this δ D : >p pq *pqt pr *prt *t prs *prst pqs *pqst pqr *pqrt pqrs *pqrst pq pqt pqt pqr pqr pqs pqs pqrs pqrs pqst pqst pqrt pqrt pqrst pqrst pr pr pr prt prt prs prs prst prst prs prs prt prt prst prst t t t t t t t t COSC These slides were presented in the first two lectures of COSC B, Summer COSC Slides presented May 9th and 16th,

Theory of Computation

Theory of Computation Theory of Computation (Feodor F. Dragan) Department of Computer Science Kent State University Spring, 2018 Theory of Computation, Feodor F. Dragan, Kent State University 1 Before we go into details, what

More information

Course 4 Finite Automata/Finite State Machines

Course 4 Finite Automata/Finite State Machines Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Introduction to Automata

Introduction to Automata Introduction to Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 /

More information

What we have done so far

What we have done so far What we have done so far DFAs and regular languages NFAs and their equivalence to DFAs Regular expressions. Regular expressions capture exactly regular languages: Construct a NFA from a regular expression.

More information

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata Automata and Formal Languages - CM81 Non-Deterministic Finite Automata Andrés Sicard-Ramírez Universidad EAFIT Semester 217-2 Non-Deterministic Finite Automata (NFA) Introduction q i a a q j a q k The

More information

Finite Automata. BİL405 - Automata Theory and Formal Languages 1

Finite Automata. BİL405 - Automata Theory and Formal Languages 1 Finite Automata BİL405 - Automata Theory and Formal Languages 1 Deterministic Finite Automata (DFA) A Deterministic Finite Automata (DFA) is a quintuple A = (Q,,, q 0, F) 1. Q is a finite set of states

More information

Sri vidya college of engineering and technology

Sri vidya college of engineering and technology Unit I FINITE AUTOMATA 1. Define hypothesis. The formal proof can be using deductive proof and inductive proof. The deductive proof consists of sequence of statements given with logical reasoning in order

More information

Computational Models - Lecture 4

Computational Models - Lecture 4 Computational Models - Lecture 4 Regular languages: The Myhill-Nerode Theorem Context-free Grammars Chomsky Normal Form Pumping Lemma for context free languages Non context-free languages: Examples Push

More information

Computational Models - Lecture 3

Computational Models - Lecture 3 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models - Lecture 3 Equivalence of regular expressions and regular languages (lukewarm leftover

More information

Automata Theory, Computability and Complexity

Automata Theory, Computability and Complexity Automata Theory, Computability and Complexity Mridul Aanjaneya Stanford University June 26, 22 Mridul Aanjaneya Automata Theory / 64 Course Staff Instructor: Mridul Aanjaneya Office Hours: 2:PM - 4:PM,

More information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

Lecture 17: Language Recognition

Lecture 17: Language Recognition Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova. Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures Tuesday 10:45 pm - 12:15 pm Instructions Tuesday 12:30

More information

Nondeterminism and Epsilon Transitions

Nondeterminism and Epsilon Transitions Nondeterminism and Epsilon Transitions Mridul Aanjaneya Stanford University June 28, 22 Mridul Aanjaneya Automata Theory / 3 Challenge Problem Question Prove that any square with side length a power of

More information

CISC4090: Theory of Computation

CISC4090: Theory of Computation CISC4090: Theory of Computation Chapter 2 Context-Free Languages Courtesy of Prof. Arthur G. Werschulz Fordham University Department of Computer and Information Sciences Spring, 2014 Overview In Chapter

More information

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova. Introduction to the Theory of Computation Automata 1VO + 1PS Lecturer: Dr. Ana Sokolova http://cs.uni-salzburg.at/~anas/ Setup and Dates Lectures and Instructions 23.10. 3.11. 17.11. 24.11. 1.12. 11.12.

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

CS 455/555: Finite automata

CS 455/555: Finite automata CS 455/555: Finite automata Stefan D. Bruda Winter 2019 AUTOMATA (FINITE OR NOT) Generally any automaton Has a finite-state control Scans the input one symbol at a time Takes an action based on the currently

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

Computational Models: Class 3

Computational Models: Class 3 Computational Models: Class 3 Benny Chor School of Computer Science Tel Aviv University November 2, 2015 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay

More information

UNIT-I. Strings, Alphabets, Language and Operations

UNIT-I. Strings, Alphabets, Language and Operations UNIT-I Strings, Alphabets, Language and Operations Strings of characters are fundamental building blocks in computer science. Alphabet is defined as a non empty finite set or nonempty set of symbols. The

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

Deterministic (DFA) There is a fixed number of states and we can only be in one state at a time

Deterministic (DFA) There is a fixed number of states and we can only be in one state at a time CS35 - Finite utomata This handout will describe finite automata, a mechanism that can be used to construct regular languages. We ll describe regular languages in an upcoming set of lecture notes. We will

More information

Regular Expressions and Language Properties

Regular Expressions and Language Properties Regular Expressions and Language Properties Mridul Aanjaneya Stanford University July 3, 2012 Mridul Aanjaneya Automata Theory 1/ 47 Tentative Schedule HW #1: Out (07/03), Due (07/11) HW #2: Out (07/10),

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY YOU NEED TO PICK UP THE SYLLABUS, THE COURSE SCHEDULE, THE PROJECT INFO SHEET, TODAY S CLASS NOTES

More information

UNIT-III REGULAR LANGUAGES

UNIT-III REGULAR LANGUAGES Syllabus R9 Regulation REGULAR EXPRESSIONS UNIT-III REGULAR LANGUAGES Regular expressions are useful for representing certain sets of strings in an algebraic fashion. In arithmetic we can use the operations

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2013 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.eecs.yorku.ca/course/2001 9/10/2013

More information

Theory of Computation Lecture 1. Dr. Nahla Belal

Theory of Computation Lecture 1. Dr. Nahla Belal Theory of Computation Lecture 1 Dr. Nahla Belal Book The primary textbook is: Introduction to the Theory of Computation by Michael Sipser. Grading 10%: Weekly Homework. 30%: Two quizzes and one exam. 20%:

More information

Chapter Five: Nondeterministic Finite Automata

Chapter Five: Nondeterministic Finite Automata Chapter Five: Nondeterministic Finite Automata From DFA to NFA A DFA has exactly one transition from every state on every symbol in the alphabet. By relaxing this requirement we get a related but more

More information

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA

More information

Theory of Computation

Theory of Computation Theory of Computation COMP363/COMP6363 Prerequisites: COMP4 and COMP 6 (Foundations of Computing) Textbook: Introduction to Automata Theory, Languages and Computation John E. Hopcroft, Rajeev Motwani,

More information

Automata Theory for Presburger Arithmetic Logic

Automata Theory for Presburger Arithmetic Logic Automata Theory for Presburger Arithmetic Logic References from Introduction to Automata Theory, Languages & Computation and Constraints in Computational Logic Theory & Application Presented by Masood

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

Theory of Computation (II) Yijia Chen Fudan University

Theory of Computation (II) Yijia Chen Fudan University Theory of Computation (II) Yijia Chen Fudan University Review A language L is a subset of strings over an alphabet Σ. Our goal is to identify those languages that can be recognized by one of the simplest

More information

Fooling Sets and. Lecture 5

Fooling Sets and. Lecture 5 Fooling Sets and Introduction to Nondeterministic Finite Automata Lecture 5 Proving that a language is not regular Given a language, we saw how to prove it is regular (union, intersection, concatenation,

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

CS 154 Introduction to Automata and Complexity Theory

CS 154 Introduction to Automata and Complexity Theory CS 154 Introduction to Automata and Complexity Theory cs154.stanford.edu 1 INSTRUCTORS & TAs Ryan Williams Cody Murray Lera Nikolaenko Sunny Rajan 2 Textbook 3 Homework / Problem Sets Homework will be

More information

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam

ECS 120: Theory of Computation UC Davis Phillip Rogaway February 16, Midterm Exam ECS 120: Theory of Computation Handout MT UC Davis Phillip Rogaway February 16, 2012 Midterm Exam Instructions: The exam has six pages, including this cover page, printed out two-sided (no more wasted

More information

Finite Automata and Formal Languages

Finite Automata and Formal Languages Finite Automata and Formal Languages TMV26/DIT32 LP4 2 Lecture 6 April 5th 2 Regular expressions (RE) are an algebraic way to denote languages. Given a RE R, it defines the language L(R). Actually, they

More information

Mathematical Preliminaries. Sipser pages 1-28

Mathematical Preliminaries. Sipser pages 1-28 Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation

More information

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices Introduction to Theoretical Computer Science Motivation Automata = abstract computing devices Turing studied Turing Machines (= computers) before there were any real computers We will also look at simpler

More information

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

More information

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Before we show how languages can be proven not regular, first, how would we show a language is regular? CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful

More information

The View Over The Horizon

The View Over The Horizon The View Over The Horizon enumerable decidable context free regular Context-Free Grammars An example of a context free grammar, G 1 : A 0A1 A B B # Terminology: Each line is a substitution rule or production.

More information

Finite Automata and Regular Languages

Finite Automata and Regular Languages Finite Automata and Regular Languages Topics to be covered in Chapters 1-4 include: deterministic vs. nondeterministic FA, regular expressions, one-way vs. two-way FA, minimization, pumping lemma for regular

More information

CS 121, Section 2. Week of September 16, 2013

CS 121, Section 2. Week of September 16, 2013 CS 121, Section 2 Week of September 16, 2013 1 Concept Review 1.1 Overview In the past weeks, we have examined the finite automaton, a simple computational model with limited memory. We proved that DFAs,

More information

Introduction to Computers & Programming

Introduction to Computers & Programming 16.070 Introduction to Computers & Programming Theory of computation: What is a computer? FSM, Automata Prof. Kristina Lundqvist Dept. of Aero/Astro, MIT Models of Computation What is a computer? If you

More information

CSC173 Workshop: 13 Sept. Notes

CSC173 Workshop: 13 Sept. Notes CSC173 Workshop: 13 Sept. Notes Frank Ferraro Department of Computer Science University of Rochester September 14, 2010 1 Regular Languages and Equivalent Forms A language can be thought of a set L of

More information

Intro to Theory of Computation

Intro to Theory of Computation Intro to Theory of Computation 1/19/2016 LECTURE 3 Last time: DFAs and NFAs Operations on languages Today: Nondeterminism Equivalence of NFAs and DFAs Closure properties of regular languages Sofya Raskhodnikova

More information

Nondeterministic Finite Automata. Nondeterminism Subset Construction

Nondeterministic Finite Automata. Nondeterminism Subset Construction Nondeterministic Finite Automata Nondeterminism Subset Construction 1 Nondeterminism A nondeterministic finite automaton has the ability to be in several states at once. Transitions from a state on an

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

CS243, Logic and Computation Nondeterministic finite automata

CS243, Logic and Computation Nondeterministic finite automata CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333

More information

Finite Automata and Formal Languages TMV026/DIT321 LP4 2012

Finite Automata and Formal Languages TMV026/DIT321 LP4 2012 Finite Automata and Formal Languages TMV26/DIT32 LP4 22 Lecture 7 Ana Bove March 27th 22 Overview of today s lecture: Regular Expressions From FA to RE Regular Expressions Regular expressions (RE) are

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 14 Ana Bove May 14th 2018 Recap: Context-free Grammars Simplification of grammars: Elimination of ǫ-productions; Elimination of

More information

Equivalence of DFAs and NFAs

Equivalence of DFAs and NFAs CS 172: Computability and Complexity Equivalence of DFAs and NFAs It s a tie! DFA NFA Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: L.von Ahn, L. Blum, M. Blum What we ll do today Prove that DFAs

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

Lecture 3: Nondeterministic Finite Automata

Lecture 3: Nondeterministic Finite Automata Lecture 3: Nondeterministic Finite Automata September 5, 206 CS 00 Theory of Computation As a recap of last lecture, recall that a deterministic finite automaton (DFA) consists of (Q, Σ, δ, q 0, F ) where

More information

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta CSE 2001: Introduction to Theory of Computation Fall 2012 Suprakash Datta datta@cse.yorku.ca Office: CSEB 3043 Phone: 416-736-2100 ext 77875 Course page: http://www.cs.yorku.ca/course/2001 9/6/2012 CSE

More information

Closure under the Regular Operations

Closure under the Regular Operations September 7, 2013 Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have shown this closure

More information

Computational Models - Lecture 4 1

Computational Models - Lecture 4 1 Computational Models - Lecture 4 1 Handout Mode Iftach Haitner and Yishay Mansour. Tel Aviv University. April 3/8, 2013 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Finite State Transducers

Finite State Transducers Finite State Transducers Eric Gribkoff May 29, 2013 Original Slides by Thomas Hanneforth (Universitat Potsdam) Outline 1 Definition of Finite State Transducer 2 Examples of FSTs 3 Definition of Regular

More information

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010 University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

Computational Theory

Computational Theory Computational Theory Finite Automata and Regular Languages Curtis Larsen Dixie State University Computing and Design Fall 2018 Adapted from notes by Russ Ross Adapted from notes by Harry Lewis Curtis Larsen

More information

CSE 105 Theory of Computation Professor Jeanne Ferrante

CSE 105 Theory of Computation  Professor Jeanne Ferrante CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s agenda NFA Review and Design NFA s Equivalence to DFA s Another Closure Property proof for Regular Languages

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

Chapter 5. Finite Automata

Chapter 5. Finite Automata Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical

More information

Further discussion of Turing machines

Further discussion of Turing machines Further discussion of Turing machines In this lecture we will discuss various aspects of decidable and Turing-recognizable languages that were not mentioned in previous lectures. In particular, we will

More information

UNIT-VI PUSHDOWN AUTOMATA

UNIT-VI PUSHDOWN AUTOMATA Syllabus R09 Regulation UNIT-VI PUSHDOWN AUTOMATA The context free languages have a type of automaton that defined them. This automaton, called a pushdown automaton, is an extension of the nondeterministic

More information

10. The GNFA method is used to show that

10. The GNFA method is used to show that CSE 355 Midterm Examination 27 February 27 Last Name Sample ASU ID First Name(s) Ima Exam # Sample Regrading of Midterms If you believe that your grade has not been recorded correctly, return the entire

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) CS/ECE 374: Algorithms & Models of Computation, Fall 28 Deterministic Finite Automata (DFAs) Lecture 3 September 4, 28 Chandra Chekuri (UIUC) CS/ECE 374 Fall 28 / 33 Part I DFA Introduction Chandra Chekuri

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov CMP 309: Automata Theory, Computability and Formal Languages Adapted from the work of Andrej Bogdanov Course outline Introduction to Automata Theory Finite Automata Deterministic Finite state automata

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation / Lecture 3: Overview Decidability of Logical Theories Presburger arithmetic Decidability of Presburger Arithmetic Dr.

More information

Computational Models - Lecture 1 1

Computational Models - Lecture 1 1 Computational Models - Lecture 1 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. February 29/ March 02, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames

More information

CSC236 Week 10. Larry Zhang

CSC236 Week 10. Larry Zhang CSC236 Week 10 Larry Zhang 1 Today s Topic Deterministic Finite Automata (DFA) 2 Recap of last week We learned a lot of terminologies alphabet string length of string union concatenation Kleene star language

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Models of Computation. by Costas Busch, LSU

Models of Computation. by Costas Busch, LSU Models of Computation by Costas Busch, LSU 1 Computation CPU memory 2 temporary memory input memory CPU output memory Program memory 3 Example: f ( x) x 3 temporary memory input memory Program memory compute

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

Concatenation. The concatenation of two languages L 1 and L 2

Concatenation. The concatenation of two languages L 1 and L 2 Regular Expressions Problem Problem Set Set Four Four is is due due using using a late late period period in in the the box box up up front. front. Concatenation The concatenation of two languages L 1

More information

Computational Models Lecture 2 1

Computational Models Lecture 2 1 Computational Models Lecture 2 1 Handout Mode Iftach Haitner. Tel Aviv University. October 30, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

More information

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen

Pushdown automata. Twan van Laarhoven. Institute for Computing and Information Sciences Intelligent Systems Radboud University Nijmegen Pushdown automata Twan van Laarhoven Institute for Computing and Information Sciences Intelligent Systems Version: fall 2014 T. van Laarhoven Version: fall 2014 Formal Languages, Grammars and Automata

More information

Introduction to the Theory of Computing

Introduction to the Theory of Computing Introduction to the Theory of Computing Lecture notes for CS 360 John Watrous School of Computer Science and Institute for Quantum Computing University of Waterloo June 27, 2017 This work is licensed under

More information

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata. CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

More information

Closure under the Regular Operations

Closure under the Regular Operations Closure under the Regular Operations Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

Non-deterministic Finite Automata (NFAs)

Non-deterministic Finite Automata (NFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Non-deterministic Finite Automata (NFAs) Part I NFA Introduction Lecture 4 Thursday, September 7, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 39 Sariel

More information