Computational Models - Lecture 1 1

Size: px
Start display at page:

Download "Computational Models - Lecture 1 1"

Transcription

1 Computational Models - Lecture 1 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. February 29/ March 02, Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

2 Talk Outline Languages, words and alphabets Finite automata and regular languages Regular operations Sipser s book, chapter 1.1 Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

3 Part I Languages, words and alphabets Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

4 Languages, words and alphabets Definition 1 An alphabet Σ is a finite set of letters. Σ = {a, b, c,..., z} the English alphabet. Σ = {α, β, γ,..., ζ} the Greek alphabet. Σ = {0, 1} the binary alphabet. Σ = {0, 1,..., 9} the digital alphabet. Definition 2 A word (i.e., string) over Σ, is a finite sequence of letters from Σ. The collection of all strings over Σ is denoted by Σ. For {0, 1}, the binary alphabet, ε, 1, 0, , are all members of Σ. Definition 3 A language over Σ is a (possibly infinite) subset of Σ. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

5 Language Examples Modern English. Ancient Greek. All prime numbers, written using digits. A = {w {0, 1} : w has at most seventeen 0 s}. B = {0 n 1 n : n 0}. C = {w {0, 1} : w has an equal number of 0 s and 1 s}. Make sure you understand what the above notions stand for... Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

6 Part II Finite Automata Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

7 Example: A One-Way Automatic Door front pad rear pad door open when person approaches hold open until person clears don t open when someone standing behind door Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

8 The Automatic Door as DFA REAR BOTH NEITHER closed FRONT open FRONT REAR BOTH NEITHER States: OPEN CLOSED Sensor: FRONT: someone on front pad REAR: someone on rear pad BOTH: someone(s) on both pads NEITHER no one on either pad. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

9 The Automatic Door as DFA A DFA is Deterministic Finite Automata REAR BOTH NEITHER closed FRONT open FRONT REAR BOTH NEITHER neither front rear both closed closed open closed closed open closed open open open Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

10 DFA: Informal definition The machine M 1 : q 1 q q 2 3 States: q 1, q 2, and q 3. Start state: q 1 (arrow from outside ). Accept state: q 2 (double circle). State transitions: arrows tagged with letters. 0,1 Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

11 DFA: Informal definition (cont.) q 1 q q 2 3 0,1 On an input string DFA begins in start state q1 after reading each symbol, DFA makes state transition with matching label. After reading last symbol, DFA produces" output: accept if DFA is an accepting state. reject otherwise. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

12 DFA: Informal definition (cont..) q 1 q q 2 3 0,1 What happens on the following input strings: In general?! Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

13 DFA: Informal definition (cont...) q 1 q q 2 3 This DFA accepts All input strings that end with a 1 All input strings that contain at least one 1, and end with an even number of 0 s No other strings Proof:? 0,1 Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

14 DFA - Formal Definition Definition 4 A deterministic finite automaton (DFA) is a 5-tuple (Q, Σ, δ, q 0, F), where Q is a finite set called the states Σ is a finite set called the alphabet δ : Q Σ Q is the transition function q 0 Q is the start state F Q is the set of accept states Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

15 Back to M q 1 q q 2 3 0,1 M 1 = (Q, Σ, δ, q 1, F) where Q = {q 1, q 2, q 3 }, Σ = {0, 1}, the transition function δ is q 1 is the start state F = {q 2 }. 0 1 q 1 q 1 q 2 q 2 q 3 q 2 q 3 q 2 q 2 Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

16 Another Example a s b a q 1 r 1 b b a a b b q 2 r 2 a Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

17 Formal Model of Computation Definition 5 M = (Q, Σ, δ, q 0, F) accepts w Σ if δ M (q 0, w) F. Definition 6 ( δ) δ M : Q Σ Q is defined by δ M (q, w) = { δ( δ(q, w1,...,n 1 ), w n ), n = w 1 q, w = ε.. w 1,...,k stands for the word w 1,..., w k the k-letter prefix of w (w 1,...,0 = w = ε) Note that δ M (q, σ) = δ(q, σ) for σ Σ. We write δ when M is clear from the context. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

18 An equivalent definition Definition 7 (Equivalent definition) M = (Q, Σ, δ, q 0, F) accepts w = w 1 w 2... w n, if r 0,..., r n Q s.t., r 0 = q 0. δ(r i, w i+1 ) = r i+1, for all 0 i < n. r n F. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

19 The language of a DFA Definition 8 L(M), the language of a DFA M, is the set of strings that M accepts. M may accept many strings M accepts only one language. What language does M accept if it accepts no strings? Definition 9 A language is called regular, if some deterministic finite automaton accepts it. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

20 Example: DFA M 2 Q = {q 1, q 2 }, Σ = {0, 1}, F = {q 2 }, δ =? What is L(M 2 ) := {w {0, 1} : δ(q 1, w) = q 2 }? Theorem 10 L(M 2 ) = {w Σ : # 1 (w) is odd}. # 1 (w) number of ones in w. Proof by induction on the word length What does it mean? The j th assumption: w {0, 1} j is in L(M) iff # 1 (w) is odd Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

21 Proving L(M 2 ) = L := {w Σ : # 1 (w) is odd} Basis (length 0): ε / L and δ(q 1, ɛ) = q 1 = ɛ / L(M 2 ). Step: assume hypothesis holds for words of length j 0. Let x = yσ {0, 1} j+1 for σ {0, 1} If # 1 (y) is even. By assumption δ(q 1, y) = q 1. σ = 1 = 1. # 1 (x) is odd = x L 2. δ(q1, x) := δ( δ(q 1, y), σ) = δ(q 1, 1) = q 2 = x L(M 2 ). σ = 0 = 1. # 1 (x) is even = x / L 2. δ(q1, x) := δ( δ(q 1, y), σ) = δ(q 1, 0) = q 1 = x / L(M 2 ). If # 1 (y) is odd... We proved for x {0, 1} j+1 : x L(M 2 ) x L (hence, y = j). Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

22 The language of M q 1 q q 2 3 Theorem 11 L(M 1 ) = {w10 2k : k 0, w {0, 1} } 0,1 Proof: Claim 12 (implies the theorem) Let L i = {x {0, 1} : δ(q 1, x) = q i } and let L 1 = {0 k : k 0} L 2 = {w10 2k : k 0, w {0, 1} } L 3 = {w10 2k+1 : k 0, w {0, 1} } Then, L i = L i for every i {1, 2, 3} Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

23 Proving Claim 12 We need to prove that i {1, 2, 3}: x L i x L i. Recall that x L i δ(x) = q i Proof by induction on word length. Induction basis: Easy to see that hypothesis holds for ɛ. Induction step: Assume hypothesis holds for words of length j 0. Let x = yσ {0, 1} j+1 for σ {0, 1}. We prove the hypothesis for x, separately for each i {1, 2, 3} Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

24 L 1 = {0 k : k 0} Recall x = yσ {0, 1} j+1 for σ {0, 1}. Proving: x L 1 = δ(q 1, x) = q 1 ( = x L 1 ). x = 0 j+1, y = 0 j and σ = 0. Since y L 1, by i.h. δ(q 1, y) = q 1 Therefore, δ(q 1, x) = δ( δ(q, y), σ) = δ(q 1, 0) = q 1. Proving: δ(q 1, x) = q 1 = x L 1. Let q y = δ(q 1, y) (hence, δ(q 1, x) = δ(q y, σ) = q 1 ) q y = q 1 and σ = 0. (?) By i.h. y = 0 j. Hence, x = yσ = 0 j 0 = 0 j+1 L 1. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

25 L 2 = {w10 2k : k 0, w {0, 1} } Recall x = yσ {0, 1} j+1 for σ {0, 1}. Proving x L 2 = δ(q 1, x) = q 2. Assume σ = 1 Since δ(q i, 1) = q 2 for any i = δ(q 1, x) = q 2. Assume x = w10 2k for k > 0 ( = y = w10 2k 1 and σ = 0) Hence, y L 3. By i.h. δ(q 1, y) = q 3 Thus, δ(q 1, x) = δ(q 3, 0) = q 2. Proving δ(q 1, x) = q 2 = x L 2. Assume σ = 1. = x L 2. (?) Assume σ = 0 q y := δ(q 1, y) = q 3 By i.h. y = w10 2k+1 for some k 0 Therefore x = yσ = w10 2k+1 0 L 2. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

26 L 3 = {w10 2k+1 : k 0, w {0, 1} } Recall x = yσ {0, 1} j+1 for σ {0, 1}. Proving x L 3 = δ(q 1, x) = q 3. x = w10 2k+1, y = w10 2k and σ = 0 y L 2 By i.h. δ(q 1, y) = q 2. Therefore, δ(q 1, x) = δ(q 2, 0) = q 3. Proving δ(q 1, x) = q 3 = x L 3. Let q y = δ(q 1, y) Hence, q y = q 2 and σ = 0 (?) By i.h. y = w10 2k Therefore, x = yσ = w10 2k 0 L 3. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

27 Part III Regular Operations Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

28 Additional examples of regular languages Let Σ = {0, 1}. {w {0, 1} : # 1 (w) 0 mod 7}. Sequence of 0 followed by sequence of 1, i.e., {0 m 1 n : m, n 0}. Any finite language. All the above languages are regular Is there a simple proof? Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

29 The regular operations Let A and B be languages. The union operation: A B = {x : x A x B} The concatenation operation: A B = {xy : x A y B} The star operation: A = {x 1 x 2... x k : k 0 and each x i A} Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

30 The regular operations Examples Let A= {good, bad} and B = {boy, girl}. Union Concatenation A B = {good, bad, boy, girl} A B = {goodboy, goodgirl, badboy, badgirl} Star A = {ε, good, bad, goodgood, goodbad, badbad, badgood,...} Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

31 Closure under union Theorem 13 If L 1 and L 2 are regular languages, then so is L 1 L 2. Approach to Proof: Some DFA M 1 accepts L 1 Some DFA M 2 accepts L 2 Construct DFA M that accepts L 1 L 2. Attempted Proof Idea: first emulate M 1, and if M 1 doesn t accept, then emulate M 2. What s wrong with this? Fix: Emulate both machines simultaneously. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

32 Closure Under Union: Correct Proof Suppose M 1 = (Q 1, Σ, δ 1, q 1, F 1 ) accepts L 1, M 2 = (Q 2, Σ, δ 2, q 2, F 2 ) accepts L 2. Define M as follows (M will accept L 1 L 2 ): Q = Q 1 Q 2. Σ is the same. For each (r 1, r 2 ) Q and a Σ, δ((r 1, r 2 ), a) = (δ 1 (r 1, a), δ 2 (r 2, a)) q 0 = (q 1, q 2 ) F = {(r 1, r 2 ): r 1 F 1 or r 2 F 2 }. Formal proof (next slide) (hey, why not choose F = F 1 F 2?) Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

33 Correctness of the construction Claim 14 L(M) = L(M 1 ) L(M 2 ). Follows by the next claim. Claim 15 δ M ((q 1, q 2 ), x) = ( δ 1 (q 1, x), δ 2 (q 2, x)). Proof: By induction on word length. DIY... Proving Claim 14: x L(M 1 ) = δ 1 (q 1, x) = r 1 F 1. (similar if x L(M 2 ).) By Claim 15, δ M ((q 1, q 2 ), x) = (r 1, ) F = x L(M). x L(M) = δ M ((q 1, q 2 ), x) = (r 1, r 2 ) F. By Claim 15, (r 1, r 2 ) = ( δ 1 (q 1, x), δ 2 (q 2, x)). Hence, either r 1 F 1 or r 2 F 2 = x L(M 1 ) L(M 2 ). Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

34 What about concatenation? Theorem 16 If L 1, L 2 are regular languages, then so is L 1 L 2. Example: L 1 = {good, bad} and L 2 = {boy, girl}. L 1 L 2 = {goodboy, goodgirl, badboy, badgirl} This is much harder to prove. Idea: Simulate M 1 for a while, then switch to M 2. Problem: But when do you switch? This leads us into non-determinism, wait for next class... Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

35 Part IV Non-deterministic Finite Automata Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

36 NFA non-deterministic Finite Automata 0,1 0,1 0 0 q q 1 q q 4 May have more than one transition labeled with the same symbol, May have no transitions labeled with a certain symbol, May have transitions labeled with ε, the symbol of the empty string. Will deal with this latter Every DFA is also an NFA. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

37 Non-deterministic computation 0,1 0,1 0 0 q q 1 q q 4 What happens when more than one transition is possible? The machine splits into multiple copies Each branch follows one possibility Together, branches follow all possibilities. If the input doesn t appear, that branch dies. Automaton accepts if some branch accepts. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

38 Computation on ,1 0,1 0 0 q q 1 q q 4 symbol 1 q 1 0 q 1 0 q 1 q 2 1 q q 1 q 2 3 q 1 q 4 Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

39 Why non-determinism? Theorem 17 (Informal, to be proved soon) Deterministic and non-deterministic finite automata, accept exactly the same set of languages. Q.: So why do we need NFA s? Design a finite automaton for the language L all binary strings with a 1 in their third-to-the-last position? Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

40 NFA for L 0,1 1 0,1 q q 1 q 2 3 0,1 q 4 Guesses which symbol is third from the last, and checks that indeed it is a 1. If guess is premature, that branch dies, and no harm occurs. Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

41 DFA for L Have 8 states, encoding the last three observed letters. A state for each string in {0, 1} 3. Add transitions on modifying the suffix, give the new letter. Mark as accepting, the strings q q 100 q 010 q q 001 q q q DFA has few bugs... Ronitt Rubinfeld and Iftach Haitner (TAU) Computational Models, Lecture 1 February 29/ March 02, / 41

Computational Models #1

Computational Models #1 Computational Models #1 Handout Mode Nachum Dershowitz & Yishay Mansour March 13-15, 2017 Nachum Dershowitz & Yishay Mansour Computational Models #1 March 13-15, 2017 1 / 41 Lecture Outline I Motivation

More information

Critical CS Questions

Critical CS Questions Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Critical CS Questions What is a computer? And What is a Computation? real computers too complex for any

More information

Computational Models: Class 1

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

More information

Computational Models Lecture 2 1

Computational Models Lecture 2 1 Computational Models Lecture 2 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. March 16/18, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Time Magazine (1984)

Time Magazine (1984) Time Magazine (1984) Put the right kind of software into a computer, and it will do whatever you want it to. There may be limits on what you can do with the machines themselves, but there are no limits

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

Non-Deterministic Finite Automata

Non-Deterministic Finite Automata Slides modified Yishay Mansour on modification by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 8 Non-Deterministic Finite Automata 0,1 0,1 0 0,ε q q 1 q 2 3 1 q 4 an NFA

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

CPS 220 Theory of Computation REGULAR LANGUAGES

CPS 220 Theory of Computation REGULAR LANGUAGES CPS 22 Theory of Computation REGULAR LANGUAGES Introduction Model (def) a miniature representation of a thing; sometimes a facsimile Iraq village mockup for the Marines Scientific modelling - the process

More information

CHAPTER 1 Regular Languages. Contents

CHAPTER 1 Regular Languages. Contents Finite Automata (FA or DFA) CHAPTER Regular Languages Contents definitions, examples, designing, regular operations Non-deterministic Finite Automata (NFA) definitions, euivalence of NFAs and DFAs, closure

More information

Computational Models - Lecture 5 1

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

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Computational Models - Lecture 3 1

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

More information

Computational Models - Lecture 4 1

Computational Models - Lecture 4 1 Computational Models - Lecture 4 1 Handout Mode Iftach Haitner. Tel Aviv University. November 21, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

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

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

acs-04: Regular Languages Regular Languages Andreas Karwath & Malte Helmert Informatik Theorie II (A) WS2009/10

acs-04: Regular Languages Regular Languages Andreas Karwath & Malte Helmert Informatik Theorie II (A) WS2009/10 Regular Languages Andreas Karwath & Malte Helmert 1 Overview Deterministic finite automata Regular languages Nondeterministic finite automata Closure operations Regular expressions Nonregular languages

More information

Computational Models - Lecture 3 1

Computational Models - Lecture 3 1 Computational Models - Lecture 3 1 Handout Mode Iftach Haitner. Tel Aviv University. November 14, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

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

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

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

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

COM364 Automata Theory Lecture Note 2 - Nondeterminism

COM364 Automata Theory Lecture Note 2 - Nondeterminism COM364 Automata Theory Lecture Note 2 - Nondeterminism Kurtuluş Küllü March 2018 The FA we saw until now were deterministic FA (DFA) in the sense that for each state and input symbol there was exactly

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

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Computational Models: Class 5

Computational Models: Class 5 Computational Models: Class 5 Benny Chor School of Computer Science Tel Aviv University March 27, 2019 Based on slides by Maurice Herlihy, Brown University, and modifications by Iftach Haitner and Yishay

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

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

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

Theory of Computation (I) Yijia Chen Fudan University

Theory of Computation (I) Yijia Chen Fudan University Theory of Computation (I) Yijia Chen Fudan University Instructor Yijia Chen Homepage: http://basics.sjtu.edu.cn/~chen Email: yijiachen@fudan.edu.cn Textbook Introduction to the Theory of Computation Michael

More information

Computer Sciences Department

Computer Sciences Department 1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular

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

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

Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions

Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular OctoberExpressions Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular Expressions Orit Moskovich Gal Rotem Tel Aviv University October 28, 2015 Recitation 2 - Non Deterministic Finite Automata (NFA) and Regular

More information

Proofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007.

Proofs, Strings, and Finite Automata. CS154 Chris Pollett Feb 5, 2007. Proofs, Strings, and Finite Automata CS154 Chris Pollett Feb 5, 2007. Outline Proofs and Proof Strategies Strings Finding proofs Example: For every graph G, the sum of the degrees of all the nodes in G

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

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

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

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/2/28 Stereotypical computer CISC 49 Theory of Computation Finite state machines & Regular languages Professor Daniel Leeds dleeds@fordham.edu JMH 332 Central processing unit (CPU) performs all the instructions

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

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

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

Homework. Staff. Happy and fruitful New Year. Welcome to CS105. (Happy New Year) שנה טובה. Meeting Times.

Homework. Staff. Happy and fruitful New Year. Welcome to CS105. (Happy New Year) שנה טובה. Meeting Times. Welcome to CS5 and Happy and fruitful ew Year שנה טובה (Happy ew Year) Meeting Times Lectures: Tue Thu 3:3p -4:5p WLH ote: Thu Oct 9 Lecture is canceled there may be a make-up lecture by quarter s end.

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

Finite Automata. Seungjin Choi

Finite Automata. Seungjin Choi Finite 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 / 28 Outline

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

Automata: a short introduction

Automata: a short introduction ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible

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

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

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

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

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by

More information

Lecture 1: Finite State Automaton

Lecture 1: Finite State Automaton Lecture 1: Finite State Automaton Instructor: Ketan Mulmuley Scriber: Yuan Li January 6, 2015 1 Deterministic Finite Automaton Informally, a deterministic finite automaton (DFA) has finite number of s-

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

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

Computational Models - Lecture 5 1

Computational Models - Lecture 5 1 Computational Models - Lecture 5 1 Handout Mode Iftach Haitner. Tel Aviv University. November 28, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice Herlihy, Brown University.

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

Theory of Languages and Automata

Theory of Languages and Automata Theory of Languages and Automata Chapter 1- Regular Languages & Finite State Automaton Sharif University of Technology Finite State Automaton We begin with the simplest model of Computation, called finite

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

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

Finite Automata and Regular languages

Finite Automata and Regular languages Finite Automata and Regular languages Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/

More information

front pad rear pad door

front pad rear pad door front pad rear pad door REAR BOTH NEITHER closed FRONT open FRONT REAR BOTH NEITHER Think of this as a simple program that outputs one of two values (states) when provided with the current state and an

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

More information

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) Sungjin Im University of California, Merced 2-3-214 Example II A ɛ B ɛ D F C E Example II A ɛ B ɛ D F C E NFA accepting

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

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

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

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

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

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa CS:4330 Theory of Computation Spring 2018 Regular Languages Finite Automata and Regular Expressions Haniel Barbosa Readings for this lecture Chapter 1 of [Sipser 1996], 3rd edition. Sections 1.1 and 1.3.

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

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

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Spring 29 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, January 22, 29 L A TEXed: December 27, 28 8:25 Chan, Har-Peled, Hassanieh (UIUC) CS374 Spring

More information

September 11, Second Part of Regular Expressions Equivalence with Finite Aut

September 11, Second Part of Regular Expressions Equivalence with Finite Aut Second Part of Regular Expressions Equivalence with Finite Automata September 11, 2013 Lemma 1.60 If a language is regular then it is specified by a regular expression Proof idea: For a given regular language

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

Computational Models Lecture 5

Computational Models Lecture 5 Computational Models Lecture 5 One More PDAs Example Equivalence of PDAs and CFLs Nondeterminism adds power to PDAs (not in book) Closure Properties of CFLs Algorithmic Aspects of PDAs and CFLs DFAs and

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

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA) Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

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

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

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

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

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission. CSE 5 Homework Due: Monday October 9, 7 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in this

More information

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata : Organization of Programming Languages Theory of Regular Expressions Finite Automata Previous Course Review {s s defined} means the set of string s such that s is chosen or defined as given s A means

More information

Extended transition function of a DFA

Extended transition function of a DFA Extended transition function of a DFA The next two pages describe the extended transition function of a DFA in a more detailed way than Handout 3.. p./43 Formal approach to accepted strings We define the

More information

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three

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

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Lecture 4 Ana Bove March 24th 2017 Structural induction; Concepts of automata theory. Overview of today s lecture: Recap: Formal Proofs

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

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

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Theory of Regular Expressions DFAs and NFAs Reminders Project 1 due Sep. 24 Homework 1 posted Exam 1 on Sep. 25 Exam topics list posted Practice homework

More information

CS21 Decidability and Tractability

CS21 Decidability and Tractability CS21 Decidability and Tractability Lecture 2 January 5, 2018 January 5, 2018 CS21 Lecture 2 1 Outline Finite Automata Nondeterministic Finite Automata Closure under regular operations NFA, FA equivalence

More information

Examples of Regular Expressions. Finite Automata vs. Regular Expressions. Example of Using flex. Application

Examples of Regular Expressions. Finite Automata vs. Regular Expressions. Example of Using flex. Application Examples of Regular Expressions 1. 0 10, L(0 10 ) = {w w contains exactly a single 1} 2. Σ 1Σ, L(Σ 1Σ ) = {w w contains at least one 1} 3. Σ 001Σ, L(Σ 001Σ ) = {w w contains the string 001 as a substring}

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

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata. Finite Automata Automata (singular: automation) are a particularly simple, but useful, model of computation. They were initially proposed as a simple model for the behavior of neurons. The concept of a

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

Nondeterministic finite automata

Nondeterministic finite automata Lecture 3 Nondeterministic finite automata This lecture is focused on the nondeterministic finite automata (NFA) model and its relationship to the DFA model. Nondeterminism is an important concept in the

More information