6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, Class 4 Nancy Lynch
|
|
|
- Buck Butler
- 9 years ago
- Views:
Transcription
1 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch
2 Today Two more models of computation: Nondeterministic Finite Automata (NFAs) Add a guessing capability to FAs. But provably equivalent to FAs. Regular expressions A different sort of model---expressions rather than machines. Also provably equivalent. Topics: Nondeterministic Finite Automata and the languages they recognize NFAs vs. FAs Closure of FA-recognizable languages under various operations, revisited Regular expressions Regular expressions denote FA-recognizable languages Reading: Sipser, Sections 1.2, 1.3 Next: Section 1.4
3 Nondeterministic Finite Automata and the languages they recognize
4 Nondeterministic Finite Automata Generalize FAs by adding nondeterminism, allowing several alternative computations on the same input string. Ordinary deterministic FAs follow one path on each input. Two changes: Allow δ(q, a) to specify more than one successor state: a q a Add -transitions, transitions made for free, without consuming any input symbols. q 1 q 2 Formally, combine these changes:
5 Formal Definition of an NFA An NFA is a 5-tuple ( Q, Σ, δ, q 0, F ), where: Q is a finite set of states, Σ is a finite set (alphabet) of input symbols, δ: Q Σ P(Q) is the transition function, The arguments are a state and either an alphabet symbol or. Σ means Σ { }. The result is a set of states. q 0 Q, is the start state, and F Q is the set of accepting, or final states.
6 Formal Definition of an NFA An NFA is a 5-tuple ( Q, Σ, δ, q 0, F ), where: Q is a finite set of states, Σ is a finite set (alphabet) of input symbols, δ: Q Σ P(Q) is the transition function, q 0 Q, is the start state, and F Q is the set of accepting, or final states. How many states in P(Q)? 2 Q Example: Q = { a, b, c } P(Q) = {, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c} }
7 NFA Example 1 0,1 0 1 a b c Q = { a, b, c } Σ = { 0, 1 } q 0 = a 0 1 F = { c } a {a,b} {a} δ: b {c} c
8 NFA Example 2 0,1 b 0 1 c d a 0 1 a {a} {a} {b,c} b {c} c {d} d e {f} f {g} g 1 0 e f g
9 Nondeterministic Finite Automata NFAs are like DFAs with two additions: Allow δ(q, a) to specify more than one successor state. Add -transitions. Formally, an NFA is a 5-tuple ( Q, Σ, δ, q 0, F ), where: Q is a finite set of states, Σ is a finite set (alphabet) of input symbols, δ: Q Σ P(Q) is the transition function, Σ means Σ { }. q 0 Q, is the start state, and F Q is the set of accepting, or final states.
10 Example 1: NFA Examples 0,1 a 0 1 b c Example 2: 0,1 b 0 1 c d a 1 0 e f g
11 Informally: How NFAs compute Follow allowed arrows in any possible way, while consuming the designated input symbols. Optionally follow any arrow at any time, without consuming any input. Accepts a string if some allowed sequence of transitions on that string leads to an accepting state.
12 Example 1 0,1 a 0 1 b c L(M) = { w w ends with 01 } M accepts exactly the strings in this set. Computations for input word w = 101: Input word w: States: a a a a Or: a a b c Since c is an accepting state, M accepts 101
13 Example 1 0,1 a 0 1 b c Computations for input word w = 0010: Possible states after 0: { a, b } Then after another 0: { a, b } After 1: { a, c } After final 0: { a, b } Since neither a nor b is accepting, M does not accept { a } Æ { a, b } Æ { a, b } Æ { a, c } Æ { a, b } 1
14 Example 2 0,1 b 0 1 c d a 1 0 e f g L(M) = { w w ends with 01 or 10 } Computations for w = 0010: Possible states after no input: { a, b, e } After 0: { a, b, e, c } After 0: { a, b, e, c } After 1: { a, b, e, d, f } After 0: { a, b, e, c, g } Since g is accepting, M accepts { a, b, e } Æ { a, b, e, c } Æ { a, b, e, c} Æ { a, b, e, d, f } Æ { a, b, e, c, g }
15 Example 2 0,1 b 0 1 c d a 1 0 e f g Computations for w = 0010: 0 0 { a, b, e } Æ { a, b, e, c } Æ { a, b, e, c } 1 0 Æ { a, b, e, d, f } Æ { a, b, e, c, g } Path to accepting state: a Æ a Æ a Æ e Æ f Æ g
16 Viewing computations as a tree 0, 1 a b 0 1 c d 1 0 e f g In general, accept if there is a path labeled by the entire input string, possibly interspersed with s, leading to an accepting state. Here, leads to accepting state d. b a 1 e Input w = 01 b a 0 Stuck: No moves on or 1 e f 1 a b 0 c d 1 e Stuck: No moves on or 0 Done, accept
17 Formal definition of computation Define E(q) = set of states reachable from q using zero or more -moves (includes q itself). Example 2: E(a) = { a, b, e } Define δ*: Q Σ* P(Q), state and string yield a set of states: δ*( q, w ) = states that can be reached from q by following w. Defined iteratively: Compute δ*( q, a 1 a 2 a k ) by: S : = E(q) for i = 1 to k do S := r δ( r, ai) for some r in S E(r ) Or define recursively, LTTR.
18 Formal definition of computation δ*( q, w ) = states that can be reached from q by following w. String w is accepted if δ*( q 0, w ) F, that is, at least one of the possible end states is accepting. String w is rejected if it isn t accepted. L(M), the language recognized by NFA M, = { w w is accepted by M}.
19 NFAs vs. FAs
20 NFAs vs. DFAs DFA = Deterministic Finite Automaton, new name for ordinary Finite Automata (FA). To emphasize the difference from NFAs. What languages are recognized by NFAs? Since DFAs are special cases of NFAs, NFAs recognize at least the DFA-recognizable (regular) languages. Nothing else! Theorem: If M is an NFA then L(M) is DFA-recognizable. Proof: Given NFA M 1 = ( Q 1, Σ, δ 1, q 01, F 1 ), produce an equivalent DFA M 2 = ( Q 2, Σ, δ 2, q 02, F 2 ). Equivalent means they recognize the same language, L(M 2 ) = L(M 1 ). Each state of M 2 represents a set of states of M 1 : Q 2 = P(Q 1 ). Start state of M 2 is E(start state of M 1 ) = all states M 1 could be in after scanning : q 02 = E(q 01 ).
21 NFAs vs. DFAs Theorem: If M is an NFA then L(M) is DFArecognizable. Proof: Given NFA M 1 = ( Q 1, Σ, δ 1, q 01, F 1 ), produce an equivalent DFA M 2 = ( Q 2, Σ, δ 2, q 02, F 2 ). Q 2 = P(Q 1 ) q 02 = E(q 01 ) F 2 = { S Q 1 S F 1 } Accepting states of M 2 are the sets that contain an accepting state of M 1. δ 2 ( S, a ) = r S E( δ 1 ( r, a ) ) Starting from states in S, δ 2 ( S, a ) gives all states M 1 could reach after a and possibly some -transitions. M 2 recognizes L(M 1 ): At any point in processing the string, the state of M 2 represents exactly the set of states that M 1 could be in.
22 Example: NFA Æ DFA M 1 : 0,1 0 1 a b c States of M 2 :, {a}, {b}, {c}, {a,b}, {a,c}, {b,c}, {a,b,c} 1 0 δ 2 : {a} 0 1 {a,b} {a,c} Other 5 subsets aren t reachable from start state, don t bother drawing them. 0 1 F 2
23 NFAs vs. DFAs NFAs and DFAs have the same power. But sometimes NFAs are simpler than equivalent DFAs. Example: L = strings ending in 01 or 10 Simple NFA, harder DFA (LTTR) Example: L = strings having substring 101 Recall DFA: 0 1 0,1 NFA: a b c d 0, ,1 Simpler---has the power to guess when to start matching.
24 NFAs vs. DFAs Which brings us back to last time. We got stuck in the proof of closure for DFA languages under concatenation: Example: L = { 0, 1 }* { 0 } { 0 }* 0,1 0 0 NFA can guess when the critical 0 occurs.
25 Closure of regular (FA- recognizable) languages under various operations, revisited
26 Closure under operations The last example suggests we retry proofs of closure of FA languages under concatenation and star, this time using NFAs. OK since they have the same expressive power (recognize the same languages) as DFAs. We already proved closure under common settheoretic operations---union, intersection, complement, difference---using DFAs. Got stuck on concatenation and star. First (warmup): Redo union proof in terms of NFAs.
27 Closure under union Theorem: FA-recognizable languages are closed under union. Old Proof: Start with DFAs M 1 and M 2 for the same alphabet Σ. Get another DFA, M 3, with L(M 3 ) = L(M 1 ) L(M 2 ). Idea: Run M 1 and M 2 in parallel on the same input. If either reaches an accepting state, accept.
28 Closure under union Example: M 1 : Substring ,1 0 a b c 1 M 2 : Odd number of 1s M 3 : ad bd 1 cd ae be ce 1 d 1 1 e
29 Closure under union, general rule Assume: M 1 = ( Q 1, Σ, δ 1, q 01, F 1 ) M 2 = ( Q 2, Σ, δ 2, q 02, F 2 ) Define M 3 = ( Q 3, Σ, δ 3, q 03, F 3 ), where Q 3 =Q 1 Q 2 Cartesian product, {(q 1,q 2 ) q 1 Q 1 and q 2 Q 2 } δ 3 ((q 1,q 2 ), a) = (δ 1 (q 1, a), δ 2 (q 2, a)) q 03 = (q 01, q 02 ) F 3 ={ (q 1,q 2 ) q 1 F 1 or q 2 F 2 }
30 Closure under union Theorem: FA-recognizable languages are closed under union. New Proof: Start with NFAs M 1 and M 2. Get another NFA, M 3, with L(M 3 ) = L(M 1 ) L(M 2 ). M 1 Use final states from M 1 and M 2. Add new start state M 2
31 Closure under union Theorem: FA-recognizable languages are closed under union. New Proof: Simpler! Intersection: NFAs don t seem to help. Concatenation, star: Now try NFA-based constructions.
32 Closure under concatenation L 1 L 2 = { x y x L 1 and y L 2 } Theorem: FA-recognizable languages are closed under concatenation. Proof: Start with NFAs M 1 and M 2. Get another NFA, M 3, with L(M 3 ) = L(M 1 ) L(M 2 ). M 1 M 2 These are no longer final states. These are still final states.
33 Closure under concatenation Example: Σ = { 0, 1}, L 1 = Σ*, L 2 = {0} {0}*. L 1 L 2 = strings that end with a block of at least one 0 M 1 : M 2 : 0,1 NFAs 0 0 Now combine: 0,1 0 0
34 Closure under star L* = { x x = y 1 y 2 y k for some k 0, every y in L } = L 0 L 1 L 2 Theorem: FA-recognizable languages are closed under star. Proof: Start with FA M 1. Get an NFA, M 2, with L(M 2 ) = L(M 1 )*. M 1 Use final states from M 1 and M 2. Add new start state; it s also a final state, since is in L(M 1 )*.
35 Closure under star Example: Σ = { 0, 1}, L 1 = { 01, 10 } (L 1 )* = even-length strings where each pair consists of a 0 and a 1. M 1 : Construct M 2 :
36 Closure, summary FA-recognizable (regular) languages are closed under set operations, concatenation, and star. Regular operations: Union, concatenation, and star. Can be used to build regular expressions, which denote languages. E.g., regular expression ( 0 1 )* 0 0* denotes the language { 0, 1 }* {0} {0}* Study these next
37 Regular Expressions
38 Regular expressions An algebraic-expression notation for describing (some) languages, rather than a machine representation. Languages described by regular expressions are exactly the FA-recognizable languages. That s why FA-recognizable languages are called regular. Definition: R is a regular expression over alphabet Σ exactly if R is one of the following: a, for some a in Σ,,, ( R 1 R 2 ), where R 1 and R 2 are smaller regular expressions, ( R 1 R 2 ), where R 1 and R 2 are smaller regular expressions, or ( R 1 * ), where R 1 is a smaller regular expression. A recursive definition.
39 Regular expressions Definition: R is a regular expression over alphabet Σ exactly if R is one of the following: a, for some a in Σ,,, ( R 1 R 2 ), where R 1 and R 2 are smaller regular expressions, ( R 1 R 2 ), where R 1 and R 2 are smaller regular expressions, or ( R 1 * ), where R 1 is a smaller regular expression. These are just formal expressions---we haven t said yet what they mean. Example: ( ( ( 0 1 ) )* 0 ) Abbreviations: Sometimes omit, use juxtaposition. Sometimes omit parens, use precedence of operations: * highest, then, then. Example: Abbreviate above as ( ( 0 1 ) )* 0 Example: ( 0 1 )* 111 ( 0 1 )*
40 How regular expressions denote languages Define the languages recursively, based on the expression structure: Definition: L(a) = { a }; one string, with one symbol a. L() = { }; one string, with no symbols. L( ) = ; no strings. L( R 1 R 2 ) = L( R 1 ) L( R 2 ) L( R 1 R 2 ) = L( R 1 ) L( R 2 ) L( R 1 * ) = ( L(R 1 ) )* Example: Expression ( ( 0 1 ) )* 0 denotes language { 0, 1 }* { 0 } = { 0, 1 }*, all strings. Example: ( 0 1 )* 111 ( 0 1 )* denotes { 0, 1 }* { 111 } { 0, 1 }*, all strings with substring 111.
41 More examples Definition: L(a) = { a }; one string, with one symbol a. L() = { }; one string, with no symbols. L( ) = ; no strings. L( R 1 R 2 ) = L( R 1 ) L( R 2 ) L( R 1 R 2 ) = L( R 1 ) L( R 2 ) L( R 1 * ) = ( L(R 1 ) )* Example: L = strings over { 0, 1 } with odd number of 1s. 0* 1 0* ( 0* 1 0* 1 0* )* Example: L = strings with substring 01 or 10. ( 0 1 )* 01 ( 0 1 )* ( 0 1 )* 10 ( 0 1 )* Abbreviate (writing Σ for ( 0 1 )): Σ* 01 Σ* Σ* 10 Σ*
42 More examples Example: L = strings with substring 01 or 10. ( 0 1 )* 01 ( 0 1 )* ( 0 1 )* 10 ( 0 1 )* Abbreviate: Σ* 01 Σ* Σ* 10 Σ* Example: L = strings with neither substring 01 or 10. Can t write complement. But can write: 0* 1*. Example: L = strings with no more than two consecutive 0s or two consecutive 1s Would be easy if we could write complement. ( 1 11 ) (( 0 00 ) (1 11 ) )* ( 0 00 ) Alternate one or two of each.
43 More examples Regular expressions commonly used to specify syntax. For (portions of) programming languages Editors Command languages like UNIX shell Example: Decimal numbers D D*. D* D*. D D*, where D is the alphabet { 0,, 9 } Need a digit either before or after the decimal point.
44 Regular Expressions Denote FA-Recognizable Languages
45 Languages denoted by regular expressions The languages denoted by regular expressions are exactly the regular (FA-recognizable) languages. Theorem 1: If R is a regular expression, then L(R) is a regular language (recognized by a FA). Proof: Easy. Theorem 2: If L is a regular language, then there is a regular expression R with L = L(R). Proof: Harder, more technical.
46 Theorem 1 Theorem 1: If R is a regular expression, then L(R) is a regular language (recognized by a FA). Proof: For each R, define an NFA M with L(M) = L(R). Proceed by induction on the structure of R: Show for the three base cases. Show how to construct NFAs for more complex expressions from NFAs for their subexpressions. Case 1: R = a a L(R) = { a } Accepts only a. Case 2: R = L(R) = { }. Accepts only
47 Theorem 1 Theorem 1: If R is a regular expression, then L(R) is a regular language (recognized by a FA). Proof: Case 3: R = L(R) = Accepts nothing. Case 4: R = R 1 R 2 M 1 recognizes L(R 1 ), M 1 M 2 recognizes L(R 2 ). Same construction we used to show regular languages are closed under M 2 union.
48 Theorem 1 Theorem 1: If R is a regular expression, then L(R) is a regular language (recognized by a FA). Proof: Case 5: R = R 1 R 2 M 1 recognizes L(R 1 ), M 2 recognizes L(R 2 ). Same construction we used to show regular languages are closed under concatenation. M 1 M 2
49 Theorem 1 Theorem 1: If R is a regular expression, then L(R) is a regular language (recognized by a FA). Proof: Case 6: R = (R 1 )* M 1 recognizes L(R 1 ), Same construction we used to show regular languages are closed under star. M 1
50 Example for Theorem 1 L = ab a* Construct machines recursively: a: a b: b ab: a b a*: a a b ab a*: a
51 Theorem 2 Theorem 2: If L is a regular language, then there is a regular expression R with L = L(R). Proof: For each NFA M, define a regular expression R with L(R) = L(M). Show with an example: b a a a x y z Convert to a special form with only one final state, no incoming arrows to start state, no outgoing arrows from final state. b b q 0 b a a a b x y z q f b
52 Theorem 2 b a a a b q 0 x y z q f b Now remove states one at a time (any order), replacing labels of edges with more complicated regular expressions. First remove z: q 0 b a a b a* x y q f b New label b a* describes all strings that can move the machine from state y to state q f, visiting (just) z any number of times.
53 Theorem 2 q 0 b a a b a* x b y q f Then remove x: q 0 b*a a bb* a y b a* q f New label b*a describes all strings that can move the machine from q 0 to y, visiting (just) x any number of times. New label a bb* a describes all strings that can move the machine from y to y, visiting (just) x any number of times.
54 Theorem 2 q 0 a bb* a b*a b a* y q f Finally, remove y: b*a (a bb* a)* b a* q 0 q f New label describes all strings that can move the machine from q 0 to q f, visiting (just) y any number of times. This final label is the needed regular expression.
55 Theorem 2 Define a generalized NFA (gnfa). Same as NFA, but: Only one accept state, start state. Start state has no incoming arrows, accept state no outgoing arrows. Arrows are labeled with regular expressions. How it computes: Follow an arrow labeled with a regular expression R while consuming a block of input that is a word in the language L(R). Convert the original NFA M to a gnfa. Successively transform the gnfa to equivalent gnfas (recognize same language), each time removing one state. When we have 2 states and one arrow, the regular expression R on the arrow is the final answer: R q 0 q f
56 Theorem 2 To remove a state x, consider every pair of other states, y and z, including y = z. New label for edge (y, z) is the union of two expressions: What was there before, and One for paths through (just) x. If y z: y z we get: y z S U R x T R SU*T If y = z: R U R SU*T S y x y T
57 Next time Existence of non-regular languages Showing specific languages aren t regular The Pumping Lemma Algorithms that answer questions about FAs. Reading: Sipser, Section 1.4; some pieces from 4.1
58 MIT OpenCourseWare J / J Automata, Computability, and Complexity Spring 2011 For information about citing these materials or our Terms of Use, visit:
Formal Languages and Automata Theory - Regular Expressions and Finite Automata -
Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March
C H A P T E R Regular Expressions regular expression
7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun
Automata and Computability. Solutions to Exercises
Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata
Finite Automata. Reading: Chapter 2
Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream
Regular Expressions and Automata using Haskell
Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions
CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.
CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write
Automata and Formal Languages
Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,
Finite Automata. Reading: Chapter 2
Finite Automata Reading: Chapter 2 1 Finite Automata Informally, a state machine that comprehensively captures all possible states and transitions that a machine can take while responding to a stream (or
Scanner. tokens scanner parser IR. source code. errors
Scanner source code tokens scanner parser IR errors maps characters into tokens the basic unit of syntax x = x + y; becomes = + ; character string value for a token is a lexeme
Reading 13 : Finite State Automata and Regular Expressions
CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model
Regular Languages and Finite State Machines
Regular Languages and Finite State Machines Plan for the Day: Mathematical preliminaries - some review One application formal definition of finite automata Examples 1 Sets A set is an unordered collection
Turing Machines: An Introduction
CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,
3515ICT Theory of Computation Turing Machines
Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation
Automata on Infinite Words and Trees
Automata on Infinite Words and Trees Course notes for the course Automata on Infinite Words and Trees given by Dr. Meghyn Bienvenu at Universität Bremen in the 2009-2010 winter semester Last modified:
Deterministic Finite Automata
1 Deterministic Finite Automata Definition: A deterministic finite automaton (DFA) consists of 1. a finite set of states (often denoted Q) 2. a finite set Σ of symbols (alphabet) 3. a transition function
CS 3719 (Theory of Computation and Algorithms) Lecture 4
CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a
(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.
3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem
CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013
CMPSCI 250: Introduction to Computation Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013 Regular Expressions and Their Languages Alphabets, Strings and Languages
Finite Automata and Regular Languages
CHAPTER 3 Finite Automata and Regular Languages 3. Introduction 3.. States and Automata A finite-state machine or finite automaton (the noun comes from the Greek; the singular is automaton, the Greek-derived
CS5236 Advanced Automata Theory
CS5236 Advanced Automata Theory Frank Stephan Semester I, Academic Year 2012-2013 Advanced Automata Theory is a lecture which will first review the basics of formal languages and automata theory and then
Genetic programming with regular expressions
Genetic programming with regular expressions Børge Svingen Chief Technology Officer, Open AdExchange [email protected] 2009-03-23 Pattern discovery Pattern discovery: Recognizing patterns that characterize
Regular Languages and Finite Automata
Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a
Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy
Regular Expressions with Nested Levels of Back Referencing Form a Hierarchy Kim S. Larsen Odense University Abstract For many years, regular expressions with back referencing have been used in a variety
ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:
ω-automata ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: in verification, as encodings of non-terminating executions of a program. in arithmetic,
Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile
Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along
CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions
CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions Theory of Formal Languages In the English language, we distinguish between three different identities: letter, word, sentence.
Compiler Construction
Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation
Lecture I FINITE AUTOMATA
1. Regular Sets and DFA Lecture I Page 1 Lecture I FINITE AUTOMATA Lecture 1: Honors Theory, Spring 02, Yap We introduce finite automata (deterministic and nondeterministic) and regular languages. Some
CSE 135: Introduction to Theory of Computation Decidability and Recognizability
CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing
Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh [email protected].
Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh [email protected] 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free
Lecture 2: Regular Languages [Fa 14]
Caveat lector: This is the first edition of this lecture note. Please send bug reports and suggestions to [email protected]. But the Lord came down to see the city and the tower the people were building.
CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions
CSC45 AUTOMATA 2. Finite Automata: Examples and Definitions Finite Automata: Examples and Definitions A finite automaton is a simple type of computer. Itsoutputislimitedto yes to or no. It has very primitive
The Halting Problem is Undecidable
185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine
SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN
Course Code : CS0355 SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN Course Title : THEORY OF COMPUTATION Semester : VI Course : June
Computational Models Lecture 8, Spring 2009
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown Univ. p. 1 Computational Models Lecture 8, Spring 2009 Encoding of TMs Universal Turing Machines The Halting/Acceptance
Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi
Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the
1 Definition of a Turing machine
Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,
Regular Languages and Finite Automata
Regular Languages and Finite Automata A C Norman, Lent Term 1996 Part IA 1 Introduction This course is short, but it is present in Part 1A because of the way it introduces links between many different
6.080/6.089 GITCS Feb 12, 2008. Lecture 3
6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my
Informatique Fondamentale IMA S8
Informatique Fondamentale IMA S8 Cours 1 - Intro + schedule + finite state machines Laure Gonnord http://laure.gonnord.org/pro/teaching/ [email protected] Université Lille 1 - Polytech Lille
Introduction to Finite Automata
Introduction to Finite Automata Our First Machine Model Captain Pedro Ortiz Department of Computer Science United States Naval Academy SI-340 Theory of Computing Fall 2012 Captain Pedro Ortiz (US Naval
ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition
ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK 5 april 23 Master Edition CONTEXT FREE LANGUAGES & PUSH-DOWN AUTOMATA CONTEXT-FREE GRAMMARS, CFG Problems Sudkamp Problem. (3.2.) Which language generates the grammar
How To Compare A Markov Algorithm To A Turing Machine
Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also
Introduction to Automata Theory. Reading: Chapter 1
Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a
Computability Theory
CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.
Markov random fields and Gibbs measures
Chapter Markov random fields and Gibbs measures 1. Conditional independence Suppose X i is a random element of (X i, B i ), for i = 1, 2, 3, with all X i defined on the same probability space (.F, P).
Omega Automata: Minimization and Learning 1
Omega Automata: Minimization and Learning 1 Oded Maler CNRS - VERIMAG Grenoble, France 2007 1 Joint work with A. Pnueli, late 80s Summary Machine learning in general and of formal languages in particular
2110711 THEORY of COMPUTATION
2110711 THEORY of COMPUTATION ATHASIT SURARERKS ELITE Athasit Surarerks ELITE Engineering Laboratory in Theoretical Enumerable System Computer Engineering, Faculty of Engineering Chulalongkorn University
Mathematical Induction. Lecture 10-11
Mathematical Induction Lecture 10-11 Menu Mathematical Induction Strong Induction Recursive Definitions Structural Induction Climbing an Infinite Ladder Suppose we have an infinite ladder: 1. We can reach
T-79.186 Reactive Systems: Introduction and Finite State Automata
T-79.186 Reactive Systems: Introduction and Finite State Automata Timo Latvala 14.1.2004 Reactive Systems: Introduction and Finite State Automata 1-1 Reactive Systems Reactive systems are a class of software
Lecture 1. Basic Concepts of Set Theory, Functions and Relations
September 7, 2005 p. 1 Lecture 1. Basic Concepts of Set Theory, Functions and Relations 0. Preliminaries...1 1. Basic Concepts of Set Theory...1 1.1. Sets and elements...1 1.2. Specification of sets...2
CAs and Turing Machines. The Basis for Universal Computation
CAs and Turing Machines The Basis for Universal Computation What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*.
Fundamentele Informatica II
Fundamentele Informatica II Answer to selected exercises 1 John C Martin: Introduction to Languages and the Theory of Computation M.M. Bonsangue (and J. Kleijn) Fall 2011 Let L be a language. It is clear
Online EFFECTIVE AS OF JANUARY 2013
2013 A and C Session Start Dates (A-B Quarter Sequence*) 2013 B and D Session Start Dates (B-A Quarter Sequence*) Quarter 5 2012 1205A&C Begins November 5, 2012 1205A Ends December 9, 2012 Session Break
THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER
THE TURING DEGREES AND THEIR LACK OF LINEAR ORDER JASPER DEANTONIO Abstract. This paper is a study of the Turing Degrees, which are levels of incomputability naturally arising from sets of natural numbers.
Lights and Darks of the Star-Free Star
Lights and Darks of the Star-Free Star Edward Ochmański & Krystyna Stawikowska Nicolaus Copernicus University, Toruń, Poland Introduction: star may destroy recognizability In (finitely generated) trace
Two Way F finite Automata and Three Ways to Solve Them
An Exponential Gap between LasVegas and Deterministic Sweeping Finite Automata Christos Kapoutsis, Richard Královič, and Tobias Mömke Department of Computer Science, ETH Zürich Abstract. A two-way finite
INCIDENCE-BETWEENNESS GEOMETRY
INCIDENCE-BETWEENNESS GEOMETRY MATH 410, CSUSM. SPRING 2008. PROFESSOR AITKEN This document covers the geometry that can be developed with just the axioms related to incidence and betweenness. The full
1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:
Exercises 1 - number representations Questions 1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal: (a) 3012 (b) - 435 2. For each of
1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)
Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:
Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology
Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information
We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: 9081 + 900b + 90c = 9001 + 100c + 10b
In this session, we ll learn how to solve problems related to place value. This is one of the fundamental concepts in arithmetic, something every elementary and middle school mathematics teacher should
The common ratio in (ii) is called the scaled-factor. An example of two similar triangles is shown in Figure 47.1. Figure 47.1
47 Similar Triangles An overhead projector forms an image on the screen which has the same shape as the image on the transparency but with the size altered. Two figures that have the same shape but not
Boolean Algebra Part 1
Boolean Algebra Part 1 Page 1 Boolean Algebra Objectives Understand Basic Boolean Algebra Relate Boolean Algebra to Logic Networks Prove Laws using Truth Tables Understand and Use First Basic Theorems
Converting Finite Automata to Regular Expressions
Converting Finite Automata to Regular Expressions Alexander Meduna, Lukáš Vrábel, and Petr Zemek Brno University of Technology, Faculty of Information Technology Božetěchova 1/2, 612 00 Brno, CZ http://www.fit.vutbr.cz/
Theory of Computation Chapter 2: Turing Machines
Theory of Computation Chapter 2: Turing Machines Guan-Shieng Huang Feb. 24, 2003 Feb. 19, 2006 0-0 Turing Machine δ K 0111000a 01bb 1 Definition of TMs A Turing Machine is a quadruple M = (K, Σ, δ, s),
ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605
ASSIGNMENT ONE SOLUTIONS MATH 4805 / COMP 4805 / MATH 5605 (1) (a) (0 + 1) 010 (finite automata below). (b) First observe that the following regular expression generates the binary strings with an even
Continued Fractions and the Euclidean Algorithm
Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction
Relational Databases
Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 18 Relational data model Domain domain: predefined set of atomic values: integers, strings,... every attribute
Basic Concepts of Set Theory, Functions and Relations
March 1, 2006 p. 1 Basic Concepts of Set Theory, Functions and Relations 1. Basic Concepts of Set Theory...1 1.1. Sets and elements...1 1.2. Specification of sets...2 1.3. Identity and cardinality...3
Computer Architecture Syllabus of Qualifying Examination
Computer Architecture Syllabus of Qualifying Examination PhD in Engineering with a focus in Computer Science Reference course: CS 5200 Computer Architecture, College of EAS, UCCS Created by Prof. Xiaobo
Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP
International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation
Hint 1. Answer (b) first. Make the set as simple as possible and try to generalize the phenomena it exhibits. [Caution: the next hint is an answer to
Problem. Consider the collection of all subsets A of the topological space X. The operations of osure A Ā and ementation A X A are functions from this collection to itself. (a) Show that starting with
Testing LTL Formula Translation into Büchi Automata
Testing LTL Formula Translation into Büchi Automata Heikki Tauriainen and Keijo Heljanko Helsinki University of Technology, Laboratory for Theoretical Computer Science, P. O. Box 5400, FIN-02015 HUT, Finland
CHAPTER 5. Number Theory. 1. Integers and Division. Discussion
CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a
Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU
Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: [email protected] office hour: Tuesday 10:30 11:30 slides: http://www.ist.tugraz.at/pact.html
26 Integers: Multiplication, Division, and Order
26 Integers: Multiplication, Division, and Order Integer multiplication and division are extensions of whole number multiplication and division. In multiplying and dividing integers, the one new issue
The Optimum One-Pass Strategy for Juliet
Master s Thesis One-Pass Strategies for Context-Free Games Christian Cöster August 2015 Examiners: Prof. Dr. Thomas Schwentick Prof. Dr. Christoph Buchheim Technische Universität Dortmund Fakultät für
4.6 The Primitive Recursive Functions
4.6. THE PRIMITIVE RECURSIVE FUNCTIONS 309 4.6 The Primitive Recursive Functions The class of primitive recursive functions is defined in terms of base functions and closure operations. Definition 4.6.1
CPSC 121: Models of Computation Assignment #4, due Wednesday, July 22nd, 2009 at 14:00
CPSC 2: Models of Computation ssignment #4, due Wednesday, July 22nd, 29 at 4: Submission Instructions Type or write your assignment on clean sheets of paper with question numbers prominently labeled.
Notes on Complexity Theory Last updated: August, 2011. Lecture 1
Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look
CONTENTS 1. Peter Kahn. Spring 2007
CONTENTS 1 MATH 304: CONSTRUCTING THE REAL NUMBERS Peter Kahn Spring 2007 Contents 2 The Integers 1 2.1 The basic construction.......................... 1 2.2 Adding integers..............................
Base Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
Lecture 2: Universality
CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal
Turing Machines, Part I
Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context
Quotient Rings and Field Extensions
Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.
Chapter 6: Episode discovery process
Chapter 6: Episode discovery process Algorithmic Methods of Data Mining, Fall 2005, Chapter 6: Episode discovery process 1 6. Episode discovery process The knowledge discovery process KDD process of analyzing
NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions
NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions Ville Laurikari Helsinki University of Technology Laboratory of Computer Science PL 9700,
A Propositional Dynamic Logic for CCS Programs
A Propositional Dynamic Logic for CCS Programs Mario R. F. Benevides and L. Menasché Schechter {mario,luis}@cos.ufrj.br Abstract This work presents a Propositional Dynamic Logic in which the programs are
6.3 Conditional Probability and Independence
222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted
WRITING PROOFS. Christopher Heil Georgia Institute of Technology
WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this
Graph Theory Problems and Solutions
raph Theory Problems and Solutions Tom Davis [email protected] http://www.geometer.org/mathcircles November, 005 Problems. Prove that the sum of the degrees of the vertices of any finite graph is
MACM 101 Discrete Mathematics I
MACM 101 Discrete Mathematics I Exercises on Combinatorics, Probability, Languages and Integers. Due: Tuesday, November 2th (at the beginning of the class) Reminder: the work you submit must be your own.
Automata and Formal Languages. Push Down Automata. Sipser pages 109-114. Lecture 13. Tim Sheard 1
Automata and Formal Languages Push Down Automata Sipser pages 109-114 Lecture 13 Tim Sheard 1 Push Down Automata Push Down Automata (PDAs) are ε-nfas with stack memory. Transitions are labeled by an input
Math Workshop October 2010 Fractions and Repeating Decimals
Math Workshop October 2010 Fractions and Repeating Decimals This evening we will investigate the patterns that arise when converting fractions to decimals. As an example of what we will be looking at,
Lecture 18 Regular Expressions
Lecture 18 Regular Expressions Many of today s web applications require matching patterns in a text document to look for specific information. A good example is parsing a html file to extract tags
Solution to Homework 2
Solution to Homework 2 Olena Bormashenko September 23, 2011 Section 1.4: 1(a)(b)(i)(k), 4, 5, 14; Section 1.5: 1(a)(b)(c)(d)(e)(n), 2(a)(c), 13, 16, 17, 18, 27 Section 1.4 1. Compute the following, if
