Theory of Computation

Size: px
Start display at page:

Download "Theory of Computation"

Transcription

1 Thomas Zeugmann Hokkaido University Laboratory for Algorithmics thomas/toc/ Lecture 3: Finite State Automata

2 Motivation In the previous lecture we learned how to formalize the generation of languages, i.e., we looked at formal languages from the perspective of a speaker.

3 Motivation In the previous lecture we learned how to formalize the generation of languages, i.e., we looked at formal languages from the perspective of a speaker. Now, we turn our attention to accepting languages, i.e., we are going to formalize the perspective of a listener.

4 Motivation In the previous lecture we learned how to formalize the generation of languages, i.e., we looked at formal languages from the perspective of a speaker. Now, we turn our attention to accepting languages, i.e., we are going to formalize the perspective of a listener. In this lecture we deal with regular languages, and the machine model accepting them.

5 Overall Goal Let Σ be again an alphabet, and let L Σ be any regular language. Now, for every string s Σ we want to have a possibility to decide whether or not s L.

6 Overall Goal Let Σ be again an alphabet, and let L Σ be any regular language. Now, for every string s Σ we want to have a possibility to decide whether or not s L. Looking at the definition of a regular grammar, the following method may be easily discovered. We start generating strings until one of the following two conditions happens: (1) The string s is generated. Clearly, then s L. (2) The length of our string s is exceeded. Taking into account that all further generable strings must be longer, we may conclude that s L.

7 Overall Goal Let Σ be again an alphabet, and let L Σ be any regular language. Now, for every string s Σ we want to have a possibility to decide whether or not s L. Looking at the definition of a regular grammar, the following method may be easily discovered. We start generating strings until one of the following two conditions happens: (1) The string s is generated. Clearly, then s L. (2) The length of our string s is exceeded. Taking into account that all further generable strings must be longer, we may conclude that s L. But this method lacks efficiency. It may take time that is exponential in the length of the input string s to terminate.

8 Nondeterministic Finite Automata I The approach described at the previous slide hardly reflects what humans are doing when accepting sentences of natural languages. Therefore, we favor another approach.

9 Nondeterministic Finite Automata I The approach described at the previous slide hardly reflects what humans are doing when accepting sentences of natural languages. Therefore, we favor another approach. Idea: Looking at a regular grammar, we have productions σ a σ aσ

10 Nondeterministic Finite Automata I The approach described at the previous slide hardly reflects what humans are doing when accepting sentences of natural languages. Therefore, we favor another approach. Idea: Looking at a regular grammar, we have productions σ a σ aσ Now, we simply change the direction of the, i.e., σ a σ aσ

11 Nondeterministic Finite Automata II This leads to the following definition: Definition 1 (NDFA) A 5-tuple A = [Σ, Q, δ, q 0, F] is said to be a nondeterministic finite automaton if (1) Σ is an alphabet (the so-called input alphabet); (2) Q is a finite nonempty set (the set of states); (3) δ: Q Σ (Q), the transition relation; (4) q 0 Q, the initial state, and (5) F Q, the set of final states.

12 Nondeterministic Finite Automata II This leads to the following definition: Definition 1 (NDFA) A 5-tuple A = [Σ, Q, δ, q 0, F] is said to be a nondeterministic finite automaton if (1) Σ is an alphabet (the so-called input alphabet); (2) Q is a finite nonempty set (the set of states); (3) δ: Q Σ (Q), the transition relation; (4) q 0 Q, the initial state, and (5) F Q, the set of final states. In the definition above, (Q) denotes the power set of Q, i.e., the set of all subsets of Q.

13 Deterministic Finite Automata There is also a deterministic counterpart of a nondeterministic finite automaton which we define next.

14 Deterministic Finite Automata There is also a deterministic counterpart of a nondeterministic finite automaton which we define next. Definition 2 (DFA) A 5-tuple A = [Σ, Q, δ, q 0, F] is said to be a deterministic finite automaton if (1) Σ is an alphabet (the so-called input alphabet); (2) Q is a finite nonempty set (the set of states); (3) δ: Q Σ Q, the transition function, which must be defined for every input; (4) q 0 Q, the initial state, and (5) F Q, the set of final states.

15 Computing with Finite Automata I When we do not want to specify whether an automaton is deterministic or nondeterministic, we simply refer to it as a finite automaton.

16 Computing with Finite Automata I When we do not want to specify whether an automaton is deterministic or nondeterministic, we simply refer to it as a finite automaton. So far, we have explained what an automaton is but not what it does. In order to explain how to compute with an automaton, we need some more definitions. For the deterministic case, we can easily define the language accepted by a finite automaton.

17 Computing with Finite Automata I When we do not want to specify whether an automaton is deterministic or nondeterministic, we simply refer to it as a finite automaton. So far, we have explained what an automaton is but not what it does. In order to explain how to compute with an automaton, we need some more definitions. For the deterministic case, we can easily define the language accepted by a finite automaton. First, we extend the definition of δ to strings. That is, formally we inductively define a function by setting δ : Q Σ Q, δ (q, λ) = q for all q Q, δ (q, sa) = δ(δ (q, s), a) for all s Σ, a Σ, and q Q.

18 Computing with Finite Automata II Furthermore, we also need the following lemma: Lemma 1 Let A = [Σ, Q, δ, q 0, F] be a deterministic finite automaton. Then for all strings v, w Σ and all q Q we have δ (q, vw) = δ (δ (q, v), w).

19 Computing with Finite Automata II Furthermore, we also need the following lemma: Lemma 1 Let A = [Σ, Q, δ, q 0, F] be a deterministic finite automaton. Then for all strings v, w Σ and all q Q we have δ (q, vw) = δ (δ (q, v), w). Now, we can define the language accepted by a deterministic finite automaton. Definition 3 Let A = [Σ, Q, δ, q 0, F] be a deterministic finite automaton. The language L(A) accepted by A is L(A) = {s s Σ, δ (q 0, s) F}.

20 Computing with Finite Automata III If we have s L(A) for a string s Σ then we say that there is an accepting computation for s. We adopt this notion also to nondeterministic automata. Note that λ L(A) iff q 0 F.

21 Computing with Finite Automata III If we have s L(A) for a string s Σ then we say that there is an accepting computation for s. We adopt this notion also to nondeterministic automata. Note that λ L(A) iff q 0 F. In order to keep notation simple, in the following we shall identify δ with δ. It should be clear from context what is meant.

22 Computing with Finite Automata III If we have s L(A) for a string s Σ then we say that there is an accepting computation for s. We adopt this notion also to nondeterministic automata. Note that λ L(A) iff q 0 F. In order to keep notation simple, in the following we shall identify δ with δ. It should be clear from context what is meant. Well, this seems very abstract, and so some explanation is in order.

23 Computing with Finite Automata IV Conceptually, a finite automaton possesses an input tape that is divided into cells. Each cell can store a symbol from Σ or it may be empty. Additionally, a finite automaton has a head to read what is stored in the cells. Initially, a string s = s 1 s 2 s k is written on the tape and the head is positioned on the leftmost symbol of the input, i.e., on s 1.

24 Computing with Finite Automata IV Conceptually, a finite automaton possesses an input tape that is divided into cells. Each cell can store a symbol from Σ or it may be empty. Additionally, a finite automaton has a head to read what is stored in the cells. Initially, a string s = s 1 s 2 s k is written on the tape and the head is positioned on the leftmost symbol of the input, i.e., on s 1. s 1 s 2 s k s k+1 head moves in this direction, one finite state control cell at a time

25 Computing with Finite Automata V s 1 s 2 s k s k+1 head moves in this direction, one finite state control cell at a time The automaton is put into its initial state q 0. Now, it reads s 1. Then, it changes its state to one of the possible states in δ(q 0, s 1 ), say q, and the head moves right to the next cell. In the deterministic case, the state δ(q 0, s 1 ) is uniquely defined. Next, s 2 is read, and the automaton changes its state to one of the possible states in δ(q, s 2 ). This process is iterated until the automaton reaches the first cell which is empty. After having read the whole string, the automaton is in some state, say r. If r F, then the computation has been an accepting one, otherwise, the string s is rejected.

26 Computing with Finite Automata VI Now, we see what the problem is in defining the language accepted by a nondeterministic finite automaton. On input a string s, there are many possible computations. Some of these computations may finish in an accepting state and some may not. We therefore define the language accepted by a nondeterministic finite automaton as follows:

27 Computing with Finite Automata VI Now, we see what the problem is in defining the language accepted by a nondeterministic finite automaton. On input a string s, there are many possible computations. Some of these computations may finish in an accepting state and some may not. We therefore define the language accepted by a nondeterministic finite automaton as follows: Definition 4 Let A = [Σ, Q, δ, q 0, F] be a nondeterministic finite automaton. The language L(A) accepted by A is the set of all strings s Σ such that there exists an accepting computation for s.

28 State Diagrams I Finite automata may be conveniently represented by their state diagram. The state diagram is a directed graph whose nodes are labeled by the states of the automaton. The edges are labeled by symbols from Σ. Let p and q be nodes. Then, there is a directed edge from p to q if and only if there exists an a Σ such that q = δ(p, a) (deterministic case) or q δ(p, a) (nondeterministic case). Final states have an extra circle. The state diagram of a finite automaton accepting the language L = {a i b j i 0, j 0} is shown below.

29 State Diagrams I Finite automata may be conveniently represented by their state diagram. The state diagram is a directed graph whose nodes are labeled by the states of the automaton. The edges are labeled by symbols from Σ. Let p and q be nodes. Then, there is a directed edge from p to q if and only if there exists an a Σ such that q = δ(p, a) (deterministic case) or q δ(p, a) (nondeterministic case). Final states have an extra circle. The state diagram of a finite automaton accepting the language L = {a i b j i 0, j 0} is shown below. a b a, b b 1 2 a 3

30 Illustrating the Example First, let us consider the computation performed by the state diagram on input abb. Having read a a b a, b b 1 2 a 3

31 Illustrating the Example First, let us consider the computation performed by the state diagram on input abb. Having read ab a b a, b b 1 2 a 3

32 Illustrating the Example First, let us consider the computation performed by the state diagram on input abb. Having read abb a b a, b b 1 2 a 3 Thus, the string abb is accepted.

33 Illustrating the Example Second, let us consider the computation performed by the state diagram on input ba. Having read b a b a, b b 1 2 a 3

34 Illustrating the Example Second, let us consider the computation performed by the state diagram on input ba. Having read ba a b a, b b 1 2 a 3 Thus, the string ba is rejected.

35 Automata and Regular Languages Now that we know what finite automata are, we can answer the question you probably have already in mind, i.e., Question What have finite automata to do with regular languages?

36 Automata and Regular Languages Now that we know what finite automata are, we can answer the question you probably have already in mind, i.e., Question What have finite automata to do with regular languages? For answering this question, we show the following theorem:

37 Main Theorem Theorem 2 Let L Σ be any language. Then, the following three assertions are equivalent: (1) There exists a deterministic finite automaton A such that L = L(A). (2) There exists a nondeterministic finite automaton A such that L = L(A). (3) L is regular. We show the equivalence by proving (1) implies (2), (2) implies (3), and (3) implies (1).

38 Proof of the Main Theorem Claim 1. (1) implies (2). This is obvious by definition, since a deterministic finite automaton is a special case of a nondeterministic one.

39 Proof of the Main Theorem Claim 2. (2) implies (3). Let A = [Σ, Q, δ, q 0, F] be a nondeterministic finite automaton such that L = L(A). We have to construct a grammar G generating L. Let G = [Σ, Q {σ}, σ, P], where P is the following set of productions: P = {σ q 0 } {p aq a Σ, p, q Q, q δ(p, a)} {p λ p F}. Obviously, G is regular. We have to show L(G) = L(A). First we prove L(A) L(G).

40 Proof of the Main Theorem Let s = a 1 a k L. Then, there exists an accepting computation of A for s. Let q 0, p 1,..., p k be the sequence of states through which A goes while performing this accepting computation. Therefore, p 1 δ(q 0, a 1 ), p 2 δ(p 1, a 2 ),..., p k δ(p k 1, a k ), and p k F. Thus, σ q 0 a 1 p 1 a 1 a k 1 p k 1 a 1 a k p k a 1 a k. Hence, s L(G).

41 Proof of the Main Theorem Let s = a 1 a k L. Then, there exists an accepting computation of A for s. Let q 0, p 1,..., p k be the sequence of states through which A goes while performing this accepting computation. Therefore, p 1 δ(q 0, a 1 ), p 2 δ(p 1, a 2 ),..., p k δ(p k 1, a k ), and p k F. Thus, σ q 0 a 1 p 1 a 1 a k 1 p k 1 a 1 a k p k a 1 a k. Hence, s L(G). The direction L(G) L(A) can be proved analogously, and is therefore left as an exercise.

42 Proof of the Main Theorem Claim 3. (3) implies (1). In principle, we want to use an idea similar to the one used to prove Claim 2. But productions may have strings on their right hand side, while the transition function has to be defined over states and letters. Therefore, we first have to show a normal form lemma for regular grammars.

43 Proof of the Main Theorem Claim 3. (3) implies (1). In principle, we want to use an idea similar to the one used to prove Claim 2. But productions may have strings on their right hand side, while the transition function has to be defined over states and letters. Therefore, we first have to show a normal form lemma for regular grammars. Normal Form Lemma For every regular grammar G = [T, N, σ, P] there exists a grammar G such that L(G) = L(G ) and all productions of G have the form h ah or h λ, where h, h N and a T.

44 Proof of the Normal Form Lemma First, each production of the form h a 1 a k h, k > 0, is equivalently replaced by the following productions: h a 1 h a2 a k h, h a 2 a k h a 2h a3 a k h,..., h ak h a kh.

45 Proof of the Normal Form Lemma First, each production of the form h a 1 a k h, k > 0, is equivalently replaced by the following productions: h a 1 h a2 a k h, h a 2 a k h a 2h a3 a k h,..., h ak h a kh. Next, each production of the form h a 1 a k, k > 0, is equivalently replaced by the following productions: h a 1 h a2 a k, h a2 a k a 2 h a3 a k,..., h ak a k h λ and h λ λ.

46 Proof of the Normal Form Lemma First, each production of the form h a 1 a k h, k > 0, is equivalently replaced by the following productions: h a 1 h a2 a k h, h a 2 a k h a 2h a3 a k h,..., h ak h a kh. Next, each production of the form h a 1 a k, k > 0, is equivalently replaced by the following productions: h a 1 h a2 a k, h a2 a k a 2 h a3 a k,..., h ak a k h λ and h λ λ. Finally, we have to deal with productions of the form h h where h, h N.

47 Proof of the Normal Form Lemma continued Let Ĝ = [T, ˆN, σ, ˆP] be the grammar constructed so far. Furthermore, let U(h) = df {h h ˆN and h h }.

48 Proof of the Normal Form Lemma continued Let Ĝ = [T, ˆN, σ, ˆP] be the grammar constructed so far. Furthermore, let U(h) = df {h h ˆN and h h }. Clearly, U(h) is computable. Now, we delete all productions of the form h h and add the following productions to ˆP: If h λ ˆP and h U(h), then we add h λ. Moreover, we add all h xh for all productions in ˆP such that there is a h U(h) with h xh ˆP.

49 Proof of the Normal Form Lemma continued Let Ĝ = [T, ˆN, σ, ˆP] be the grammar constructed so far. Furthermore, let U(h) = df {h h ˆN and h h }. Clearly, U(h) is computable. Now, we delete all productions of the form h h and add the following productions to ˆP: If h λ ˆP and h U(h), then we add h λ. Moreover, we add all h xh for all productions in ˆP such that there is a h U(h) with h xh ˆP. Let G be the resulting grammar. Clearly, now all productions have the desired form. One easily verifies that L(G) = L(G ). This proves the lemma.

50 Illustration of Normal Form Lemma Let G = [{a, b}, {σ, h}, σ, P] be the grammar given, where P = {σ abσ, σ h, h aah, h λ}. Applying the transformation, first we obtain: ˆP = {σ ah bσ, h bσ bσ, σ h, h ah ah, h ah ah, h λ}. Now, U(σ) = {h}, and U(h) =. Thus, we delete the production σ h and replace it by σ ah ah and σ λ. Summarizing this construction, we now have the following set P of productions: P = {σ ah bσ, h bσ bσ, σ ah ah, σ λ, h ah ah, h ah ah, h λ} as well as the following set N of nonterminals: N = {σ, h ah, h bσ, h}.

51 Proof of (3) implies (1) continued Now, assume that we are given a grammar G = [T, N, σ, P] that is already in the normal form described in the lemma above. We define a deterministic finite automaton A = [T, Q, δ, q 0, F] as follows:

52 Proof of (3) implies (1) continued Now, assume that we are given a grammar G = [T, N, σ, P] that is already in the normal form described in the lemma above. We define a deterministic finite automaton A = [T, Q, δ, q 0, F] as follows: Let Q = (N) and q 0 = {σ}. The transition function δ is defined as δ(p, a) = {h h[h p and h ah P]}.

53 Proof of (3) implies (1) continued Now, assume that we are given a grammar G = [T, N, σ, P] that is already in the normal form described in the lemma above. We define a deterministic finite automaton A = [T, Q, δ, q 0, F] as follows: Let Q = (N) and q 0 = {σ}. The transition function δ is defined as δ(p, a) = {h h[h p and h ah P]}. Finally, we set F = {p h[h p and h λ P]}. We leave it as an exercise to prove L(A) = L(G).

54 Deciding Membership Theorem 2 directly allows for the following corollary: Corollary 3 There is an algorithm that on input any regular grammar G = [T, N, σ, P] and any string s T decides whether or not s L(G).

55 Deciding Membership Theorem 2 directly allows for the following corollary: Corollary 3 There is an algorithm that on input any regular grammar G = [T, N, σ, P] and any string s T decides whether or not s L(G). Proof. As the proof of Theorem 2 shows, given any regular grammar G we can construct a deterministic finite automaton A such that L(G) = L(A). Since A is deterministic, on input any string s T it either accepts s or it rejects it.

56 Showing Non-Regularity of Languages I Finally, we show how to use finite automata to prove that particular languages are not regular. Consider the following grammar: G = [{a, b}, {σ}, σ, {σ aσb, σ λ}]. Then, L(G) = {a i b i i 0}.

57 Showing Non-Regularity of Languages I Finally, we show how to use finite automata to prove that particular languages are not regular. Consider the following grammar: G = [{a, b}, {σ}, σ, {σ aσb, σ λ}]. Then, L(G) = {a i b i i 0}. Clearly, G is not regular, but this does not prove that there is no regular grammar at all that can generate this language.

58 Showing Non-Regularity of Languages I Finally, we show how to use finite automata to prove that particular languages are not regular. Consider the following grammar: G = [{a, b}, {σ}, σ, {σ aσb, σ λ}]. Then, L(G) = {a i b i i 0}. Clearly, G is not regular, but this does not prove that there is no regular grammar at all that can generate this language. Theorem 4 The language L = {a i b i i 0} is not regular.

59 Showing Non-Regularity of Languages II Proof. Suppose the converse. Then, by our Main Theorem there must be a deterministic finite automaton A = [Σ, Q, δ, q 0, F] such that L(A) = L. Clearly, {a, b} Σ, and thus δ(q 0, a i ) must be defined for all i. However, there are only finitely many states, but infinitely many i, and hence there must exist i, j such that i j but δ(q 0, a i ) = δ(q 0, a j ).

60 Showing Non-Regularity of Languages II Proof. Suppose the converse. Then, by our Main Theorem there must be a deterministic finite automaton A = [Σ, Q, δ, q 0, F] such that L(A) = L. Clearly, {a, b} Σ, and thus δ(q 0, a i ) must be defined for all i. However, there are only finitely many states, but infinitely many i, and hence there must exist i, j such that i j but δ(q 0, a i ) = δ(q 0, a j ). Since the automaton is deterministic, δ(q 0, a i ) = δ(q 0, a j ) implies δ(q 0, a i b i ) = δ(q 0, a j b i ). Let q = δ(q 0, a i b i ); then, if q F we directly obtain a j b i L, a contradiction, since i j. But if q F, then a i b i is rejected. This is again a contradiction, since a i b i L. Thus, L is not regular.

61 Thank you!

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

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 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 10: CF, PDAs and Beyond Greibach Normal Form I We want to show that all context-free

More information

Introduction to Formal Languages, Automata and Computability p.1/42

Introduction to Formal Languages, Automata and Computability p.1/42 Introduction to Formal Languages, Automata and Computability Pushdown Automata K. Krithivasan and R. Rama Introduction to Formal Languages, Automata and Computability p.1/42 Introduction We have considered

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 14: Applications of PCP Goal of this Lecture Our goal is to present some typical undecidability

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

Chapter 2: Finite Automata

Chapter 2: Finite Automata Chapter 2: Finite Automata 2.1 States, State Diagrams, and Transitions Finite automaton is the simplest acceptor or recognizer for language specification. It is also the simplest model of a computer. A

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 13: Algorithmic Unsolvability The Halting Problem I In the last lecture we have shown

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

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

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

Finite Automata. Finite Automata

Finite Automata. Finite Automata Finite Automata Finite Automata Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers Parsers, Push-down Automata Context Free Grammar Finite State

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

Finite Automata and Regular Languages (part III)

Finite Automata and Regular Languages (part III) Finite Automata and Regular Languages (part III) Prof. Dan A. Simovici UMB 1 / 1 Outline 2 / 1 Nondeterministic finite automata can be further generalized by allowing transitions between states without

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

Foundations of Informatics: a Bridging Course

Foundations of Informatics: a Bridging Course Foundations of Informatics: a Bridging Course Week 3: Formal Languages and Semantics Thomas Noll Lehrstuhl für Informatik 2 RWTH Aachen University noll@cs.rwth-aachen.de http://www.b-it-center.de/wob/en/view/class211_id948.html

More information

Finite Automata. Mahesh Viswanathan

Finite Automata. Mahesh Viswanathan Finite Automata Mahesh Viswanathan In this lecture, we will consider different models of finite state machines and study their relative power. These notes assume that the reader is familiar with DFAs,

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 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

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 2016 Slides by Ranald Clouston and Katya Lebedeva. COMP 2600 Deterministic

More information

This lecture covers Chapter 7 of HMU: Properties of CFLs

This lecture covers Chapter 7 of HMU: Properties of CFLs This lecture covers Chapter 7 of HMU: Properties of CFLs Chomsky Normal Form Pumping Lemma for CFs Closure Properties of CFLs Decision Properties of CFLs Additional Reading: Chapter 7 of HMU. Chomsky Normal

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

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

Decision, Computation and Language

Decision, Computation and Language Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata

More information

More on Regular Languages and Non-Regular Languages

More on Regular Languages and Non-Regular Languages More on Regular Languages and Non-Regular Languages CSCE A35 Decision Properties of Regular Languages Given a (representation, e.g., RE, FA, of a) regular language L, what can we tell about L? Since there

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 12: Turing Machines Turing Machines I After having dealt with partial recursive functions,

More information

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

(Refer Slide Time: 0:21)

(Refer Slide Time: 0:21) Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata

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

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

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

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

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

(pp ) PDAs and CFGs (Sec. 2.2)

(pp ) PDAs and CFGs (Sec. 2.2) (pp. 117-124) PDAs and CFGs (Sec. 2.2) A language is context free iff all strings in L can be generated by some context free grammar Theorem 2.20: L is Context Free iff a PDA accepts it I.e. if L is context

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

Einführung in die Computerlinguistik

Einführung in die Computerlinguistik Einführung in die Computerlinguistik Context-Free Grammars (CFG) Laura Kallmeyer Heinrich-Heine-Universität Düsseldorf Summer 2016 1 / 22 CFG (1) Example: Grammar G telescope : Productions: S NP VP NP

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Push-Down Automata CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario, Canada janicki@mcmaster.ca Ryszard Janicki Computability

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 11 CHAPTER 3 CONTEXT-FREE LANGUAGES 1. Context Free Grammars 2. Pushdown Automata 3. Pushdown automata and context -free

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

October 6, Equivalence of Pushdown Automata with Context-Free Gramm

October 6, Equivalence of Pushdown Automata with Context-Free Gramm Equivalence of Pushdown Automata with Context-Free Grammar October 6, 2013 Motivation Motivation CFG and PDA are equivalent in power: a CFG generates a context-free language and a PDA recognizes a context-free

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

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

Outline. CS21 Decidability and Tractability. Machine view of FA. Machine view of FA. Machine view of FA. Machine view of FA.

Outline. CS21 Decidability and Tractability. Machine view of FA. Machine view of FA. Machine view of FA. Machine view of FA. Outline CS21 Decidability and Tractability Lecture 5 January 16, 219 and Languages equivalence of NPDAs and CFGs non context-free languages January 16, 219 CS21 Lecture 5 1 January 16, 219 CS21 Lecture

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

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

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

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

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar

Büchi Automata and their closure properties. - Ajith S and Ankit Kumar Büchi Automata and their closure properties - Ajith S and Ankit Kumar Motivation Conventional programs accept input, compute, output result, then terminate Reactive program : not expected to terminate

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

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

(pp ) PDAs and CFGs (Sec. 2.2)

(pp ) PDAs and CFGs (Sec. 2.2) (pp. 117-124) PDAs and CFGs (Sec. 2.2) A language is context free iff all strings in L can be generated by some context free grammar Theorem 2.20: L is Context Free iff a PDA accepts it I.e. if L is context

More information

Pushdown Automata. Reading: Chapter 6

Pushdown Automata. Reading: Chapter 6 Pushdown Automata Reading: Chapter 6 1 Pushdown Automata (PDA) Informally: A PDA is an NFA-ε with a infinite stack. Transitions are modified to accommodate stack operations. Questions: What is a stack?

More information

Chapter 3. Regular grammars

Chapter 3. Regular grammars Chapter 3 Regular grammars 59 3.1 Introduction Other view of the concept of language: not the formalization of the notion of effective procedure, but set of words satisfying a given set of rules Origin

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

Introduction to Theory of Computing

Introduction to Theory of Computing CSCI 2670, Fall 2012 Introduction to Theory of Computing Department of Computer Science University of Georgia Athens, GA 30602 Instructor: Liming Cai www.cs.uga.edu/ cai 0 Lecture Note 3 Context-Free Languages

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

THEORY OF COMPUTATION

THEORY OF COMPUTATION THEORY OF COMPUTATION There are four sorts of men: He who knows not and knows not he knows not: he is a fool - shun him; He who knows not and knows he knows not: he is simple teach him; He who knows and

More information

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Outline Nondeterminism Regular expressions Elementary reductions http://www.cs.caltech.edu/~cs20/a October 8, 2002 1 Determistic Finite Automata A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Q is a finite

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Chomsky Normal Form and TURING MACHINES TUESDAY Feb 4 CHOMSKY NORMAL FORM A context-free grammar is in Chomsky normal form if every rule is of the form:

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

Java II Finite Automata I

Java II Finite Automata I Java II Finite Automata I Bernd Kiefer Bernd.Kiefer@dfki.de Deutsches Forschungszentrum für künstliche Intelligenz November, 23 Processing Regular Expressions We already learned about Java s regular expression

More information

NPDA, CFG equivalence

NPDA, CFG equivalence NPDA, CFG equivalence Theorem A language L is recognized by a NPDA iff L is described by a CFG. Must prove two directions: ( ) L is recognized by a NPDA implies L is described by a CFG. ( ) L is described

More information

Theory of Computation Turing Machine and Pushdown Automata

Theory of Computation Turing Machine and Pushdown Automata Theory of Computation Turing Machine and Pushdown Automata 1. What is a Turing Machine? A Turing Machine is an accepting device which accepts the languages (recursively enumerable set) generated by type

More information

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs

Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harvard CS 121 and CSCI E-207 Lecture 10: CFLs: PDAs, Closure Properties, and Non-CFLs Harry Lewis October 8, 2013 Reading: Sipser, pp. 119-128. Pushdown Automata (review) Pushdown Automata = Finite automaton

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Languages Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable Languages We

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

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

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

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

Theory of Computation (IV) Yijia Chen Fudan University

Theory of Computation (IV) Yijia Chen Fudan University Theory of Computation (IV) Yijia Chen Fudan University Review language regular context-free machine DFA/ NFA PDA syntax regular expression context-free grammar Pushdown automata Definition A pushdown automaton

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Lecture 6 Section 2.2 Robb T. Koether Hampden-Sydney College Mon, Sep 5, 2016 Robb T. Koether (Hampden-Sydney College) Nondeterministic Finite Automata Mon, Sep 5, 2016

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

This lecture covers Chapter 6 of HMU: Pushdown Automata

This lecture covers Chapter 6 of HMU: Pushdown Automata This lecture covers Chapter 6 of HMU: ushdown Automata ushdown Automata (DA) Language accepted by a DA Equivalence of CFs and the languages accepted by DAs Deterministic DAs Additional Reading: Chapter

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

More information

5 Context-Free Languages

5 Context-Free Languages CA320: COMPUTABILITY AND COMPLEXITY 1 5 Context-Free Languages 5.1 Context-Free Grammars Context-Free Grammars Context-free languages are specified with a context-free grammar (CFG). Formally, a CFG G

More information

Classes and conversions

Classes and conversions Classes and conversions Regular expressions Syntax: r = ε a r r r + r r Semantics: The language L r of a regular expression r is inductively defined as follows: L =, L ε = {ε}, L a = a L r r = L r L r

More information

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Deterministic Finite Automata 1 Pop quiz What is

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

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

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

X-machines - a computational model framework.

X-machines - a computational model framework. Chapter 2. X-machines - a computational model framework. This chapter has three aims: To examine the main existing computational models and assess their computational power. To present the X-machines as

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Parikh s theorem. Håkan Lindqvist

Parikh s theorem. Håkan Lindqvist Parikh s theorem Håkan Lindqvist Abstract This chapter will discuss Parikh s theorem and provide a proof for it. The proof is done by induction over a set of derivation trees, and using the Parikh mappings

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. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA) Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine

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

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

Notes on State Minimization

Notes on State Minimization U.C. Berkeley CS172: Automata, Computability and Complexity Handout 1 Professor Luca Trevisan 2/3/2015 Notes on State Minimization These notes present a technique to prove a lower bound on the number of

More information

C2.1 Regular Grammars

C2.1 Regular Grammars Theory of Computer Science March 22, 27 C2. Regular Languages: Finite Automata Theory of Computer Science C2. Regular Languages: Finite Automata Malte Helmert University of Basel March 22, 27 C2. Regular

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

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

C2.1 Regular Grammars

C2.1 Regular Grammars Theory of Computer Science March 6, 26 C2. Regular Languages: Finite Automata Theory of Computer Science C2. Regular Languages: Finite Automata Malte Helmert University of Basel March 6, 26 C2. Regular

More information

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen

Pushdown Automata. Notes on Automata and Theory of Computation. Chia-Ping Chen Pushdown Automata Notes on Automata and Theory of Computation Chia-Ping Chen Department of Computer Science and Engineering National Sun Yat-Sen University Kaohsiung, Taiwan ROC Pushdown Automata p. 1

More information

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

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor

60-354, Theory of Computation Fall Asish Mukhopadhyay School of Computer Science University of Windsor 60-354, Theory of Computation Fall 2013 Asish Mukhopadhyay School of Computer Science University of Windsor Pushdown Automata (PDA) PDA = ε-nfa + stack Acceptance ε-nfa enters a final state or Stack is

More information

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0

Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Griffith University 3130CIT Theory of Computation (Based on slides by Harald Søndergaard of The University of Melbourne) Turing Machines 9-0 Turing Machines Now for a machine model of much greater power.

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

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

3.13. PUSHDOWN AUTOMATA Pushdown Automata

3.13. PUSHDOWN AUTOMATA Pushdown Automata 3.13. PUSHDOWN AUTOMATA 317 3.13 Pushdown Automata We have seen that the regular languages are exactly the languages accepted by DFA s or NFA s. The context-free languages are exactly the languages accepted

More information