Introduction to Automata

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

Models of Computation. by Costas Busch, LSU

Properties of Context-Free Languages

Finite Automata. Seungjin Choi

Automata Theory and Formal Grammars: Lecture 1

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

INF210 Datamaskinteori (Models of Computation)

ACS2: Decidability Decidability

Theory of Computation

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

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

CSE 20. Final Review. CSE 20: Final Review

Automata and Languages

CSCI 2200 Foundations of Computer Science Spring 2018 Quiz 3 (May 2, 2018) SOLUTIONS

Propositional Logic, Predicates, and Equivalence

Sri vidya college of engineering and technology

Mathematics Review for Business PhD Students

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

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

REVIEW FOR THIRD 3200 MIDTERM

Mathematics Review for Business PhD Students Lecture Notes

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

Finite Automata and Languages

3515ICT: Theory of Computation. Regular languages

Uses of finite automata

Automata Theory for Presburger Arithmetic Logic

Introduction to Computers & Programming

Theory of Computation Lecture 1. Dr. Nahla Belal

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Show Your Work! Point values are in square brackets. There are 35 points possible. Some facts about sets are on the last page.

Mathematical Preliminaries. Sipser pages 1-28

4.2 The Halting Problem

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

Lecture #14: NP-Completeness (Chapter 34 Old Edition Chapter 36) Discussion here is from the old edition.

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

BASIC MATHEMATICAL TECHNIQUES

Context-Free Grammars and Languages

CS 208: Automata Theory and Logic

Foundations of Informatics: a Bridging Course

CSCE 551: Chin-Tser Huang. University of South Carolina

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

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

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

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Chapter 1 : The language of mathematics.

Theory of Computation

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Final exam study sheet for CS3719 Turing machines and decidability.

Context-Free Grammars: Normal Forms

UNIT-VIII COMPUTABILITY THEORY

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

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Computational Models - Lecture 4

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Complexity Theory. Knowledge Representation and Reasoning. November 2, 2005

CS243, Logic and Computation Nondeterministic finite automata

Peter Wood. Department of Computer Science and Information Systems Birkbeck, University of London Automata and Formal Languages

6.1 The Pumping Lemma for CFLs 6.2 Intersections and Complements of CFLs

COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3

Chapter 3. Regular grammars

DM17. Beregnelighed. Jacob Aae Mikkelsen

CITS2211 Discrete Structures (2017) Cardinality and Countability

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Background for Discrete Mathematics

CPSC 421: Tutorial #1

NPDA, CFG equivalence

CS481F01 Solutions 6 PDAS

Formal Languages, Automata and Models of Computation

Chapter 1. Introduction

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

Chapter 1. Sets and Mappings

THEORY OF COMPUTATION

Any Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?

CS Automata, Computability and Formal Languages

Properties of Context-Free Languages. Closure Properties Decision Properties

Theory of Computation

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

Chapter 2 : Time complexity

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

CA320 - Computability & Complexity

5 Set Operations, Functions, and Counting

What is this course about?

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

1.4 Cardinality. Tom Lewis. Fall Term Tom Lewis () 1.4 Cardinality Fall Term / 9

Context-Free Languages (Pre Lecture)

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

1 Chapter 1: SETS. 1.1 Describing a set

Transcription:

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

Automata Theory? Automata theory = the study of abstract computing machines (or models of computation) Computation is a sequence of steps that can be performed by a computer. 1930 s: Turing machines 1940 s and 50 s: Finite automata, formal grammars (Chomsky) 1960 s and 70 s: Extension of Turing s (Cook), decidability (what could and what could not computed) and intractability (P, NP-complete, NP-hard) 2 / 20

Finite Automata Finite automata are used as a model for Software for designing and checking the behavior of digital circuits Lexical analyzer of a compiler Searching for keywords in a file or on the web Software for verifying finite state systems, such as communication protocols. 3 / 20

Examples of Finite Automata psuh start off on push (a) start t h e n t th the (b) then Figure: (a) a finite automaton modeling an on/off switch; (b) a finite automaton modeling recognition of then. 4 / 20

Sets Definition A set is a collection of elements without any structure other than membership. Subset: A B, proper subset: A B. S = {0, 1, 2}, S = {i i > 0, i is even}. S 1 S 2 (union), S 1 S 2 (intersection), S 1 S 2 (difference), S (complementation). Disjoint: S 1 S 2 = φ (where φ denotes empty set). Power set of S, denoted by 2 S, is the set of all subsets of a set S. For example, given S = {a, b}, the power set is 2 S = {φ, {a}, {b}, {a, b}}. Note that 2 S = 2 S. Cartesian product: S = S 1 S 2 = {(x, y) x S 1, y S 2 }. 5 / 20

Functions Definition Let A and B be sets. A function, f from A to B is an assignment of exactly one element of B to each element of A. f : A B (f maps A to B), where A is domain of f, B is codomain of f, and the range of f is the set of all images of elements of A. A function f is said to be one-to-one (injective) iff f (x) = f (y) implies x = y for all x and y in the domain of f. A function f is said to be onto (surjective) iff for b B, there exists a A with f (a) = b. That is, the range of f is equal to B. A function f is a one-to-one correspondence (bijection) if it is both one-to-one and onto. 6 / 20

Graphs and Trees A graph, G(V, E) consists of two finite sets, V (a set of vertices) and E (a set of edges). Walk, trail, path, closed, cycle Tree: connected acyclic graph Probabilistic graphical model: Happy marriage between graph theory and probability theory 7 / 20

Walk, Trail, Path Walk: A sequence of edges (v 0, v j ), (v j, v k ),..., (v m, v n ) is said to be a walk from v 0 to v n. Trail: A walk in which all the edges are distinct. Path: A walk in which all the edges are distinct and the vertices are distinct (except v 0 = v n ). Closed: A path is closed if v 0 = v n. Cycle: A closed path containing at least one edge is a cycle. 8 / 20

Example A walk: v w x y z z y w A trail: v w x y z z x A path: v w x y z 9 / 20

Proof Techniques Deductive proof: Consists of a sequence of statements whose truth leads us from the hypothesis to a conclusion statement. Proof by induction Basis: Prove that P(1) is true. Induction step: For each i 1, assume that P(i) is true and use this assumption to show that P(i + 1) is true. Proof by contradiction: Assume that the theorem is false and then show that this assumption leads to an obviously false consequence (contradiction) 10 / 20

Example: Proof by Induction Theorem A binary tree is a tree in which no parent can have more than two children. Prove that a binary tree of height n has at most 2 n leaves. Proof. 11 / 20

Proof Denote by l(n) the maximum number of leaves of a binary tree of height n. Then we want to show that l(n) 2 n. Basis: One can easily see that l(0) = 1 = 2 0. IH: l(i) 2 i for i = 0, 1,..., n. To get a binary tree of height n + 1 from the one of height n, we can create at most two leaves in place of each previous one. Therefore l(n + 1) 2 l(n) = 2 n+1. 12 / 20

Example: Proof by Contradiction Theorem Show that 2 is irrational. Proof. 13 / 20

Proof Assume that 2 is a rational number, leading to 2 = n m, where n and m are integers without a common factor. Square both sides of this equation yields 2m 2 = n 2. n 2 must be even, so n = 2k. Then 2m 2 = 4k 2, i.e., m 2 = 2k 2, leading to m is even. But this contradicts our assumption that n and m have no common factors. Thus n and m can not exist and 2 is not a rational number. 14 / 20

Central Concepts of Automata Theory Alphabet: A finite nonempty set Σ of symbols. Σ = {0, 1}, the binary alphabet. Σ = {a, b,..., z}, the set of all lower-case letters. String: A finite sequence of symbols chosen from some alphabet Given Σ = {0, 1}, 0011 is a string from the binary alphabet and 101 is another string from this alphabet. Empty string: the string with zero occurrences of symbols, denoted by ɛ. Note that ɛ is a string that may be chosen from any alphabet whatsoever. Length of string: the number of positions for symbols in the string. For example, for w = 001, w = 3 (cardinality). Note that ɛ = 0. 15 / 20

Powers of an alphabet: Σ k = the set of strings of length k, each of whose symbols is in Σ. For example, given Σ = {0, 1}, Σ 1 = {0, 1}. Σ 2 = {00, 01, 10, 11}. Σ 0 = {ɛ}. How many string are there in Σ 3? Σ : the set of all strings over Σ. Σ + = Σ 1 Σ 2 Σ 3 Σ = Σ + {ɛ} = Σ 0 Σ 1 Σ 2 Concatenation: Let w = a 1 a 2 a n and v = b 1 b 2 b m, then wv = a 1 a 2 a n b 1 b 2 b m. Note that ɛw = wɛ = w. w n = } ww {{ w } and w 0 = ɛ. n 16 / 20

Languages Given an alphabet Σ, a language L is a set of strings all of which are chosen from Σ. In other words, L Σ, then L is a language over Σ. Examples of languages include: The set of legal English words. The set of legal C programs. The set of strings consisting of n 0 s followed by n 1 s for some n 0, i.e., {ɛ, 01, 0011, 000111,...}. The set of strings of 0 s and 1 s with an equal number of each: {ɛ, 01, 10, 0011, 0101,...}. 17 / 20

More Examples The set of binary numbers whose value is a prime: {10, 11, 101, 111, 1011,...}. Σ is a language for any alphabet Σ. The empty language φ is a language over any alphabet. {ɛ}, the language consisting of only the empty string, is also a language over any alphabet. Note that φ {ɛ}; the former has no strings and the latter has one string. 18 / 20

Problems If Σ is an alphabet and L is a language over Σ, then the problem is: Given a string w in Σ, decide whether or not w is in L. Let L p = {w w is a binary number that is prime}. Is 11101 L p? What computational resources are needed to answer the question? Usually we think of problems not as yes/no decision, but as something that transforms an input into an output. For instance, the task of the parser in a C compiler does more than decide. Nevertheless, the definition of problems as languages has stood the test of time as the appropriate way to deal with the important questions of complexity theory. 19 / 20

Structural Representations These are alternatively ways of specifying a machine. Grammars Regular expressions 20 / 20