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

Similar documents
Introduction to Languages and Computation

Sri vidya college of engineering and technology

Theory of Computation

UNIT-I. Strings, Alphabets, Language and Operations

Automata Theory for Presburger Arithmetic Logic

Mathematical Preliminaries. Sipser pages 1-28

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

Automata Theory and Formal Grammars: Lecture 1

1 Alphabets and Languages

Theory of Computation Lecture 1. Dr. Nahla Belal

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Preliminaries to the Theory of Computation

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Foundations of Mathematics

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

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

Advanced Automata Theory 7 Automatic Functions

COM364 Automata Theory Lecture Note 2 - Nondeterminism

Automata and Languages

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

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

Introduction to Automata

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

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

Preface to the Second Edition. Preface to the Third Edition

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

A statement is a sentence that is definitely either true or false but not both.

CS243, Logic and Computation Nondeterministic finite automata

UNIT-VIII COMPUTABILITY THEORY

CSC173 Workshop: 13 Sept. Notes

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

3130CIT Theory of Computation

Chapter 3. Regular grammars

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

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

With Question/Answer Animations. Chapter 2

NP-completeness. Chapter 34. Sergey Bereg

Closure under the Regular Operations

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

1 More finite deterministic automata

Theory of Languages and Automata

Carmen s Core Concepts (Math 135)

CPSC 421: Tutorial #1

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

Propositional and Predicate Logic - II

Nondeterministic Finite Automata

Foundations of Mathematics

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

Fuzzy and Rough Sets Part I

CSE 105 Theory of Computation

Table of mathematical symbols - Wikipedia, the free encyclopedia

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

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

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

CSE 1400 Applied Discrete Mathematics Definitions

Models of Computation. by Costas Busch, LSU

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

Logic Synthesis and Verification

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CPS 220 Theory of Computation REGULAR LANGUAGES

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

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

What is this course about?

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


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

CHAPTER 1 Regular Languages. Contents

Theory of computation: initial remarks (Chapter 11)

CSC236 Week 10. Larry Zhang

Discrete Mathematics and Its Applications

Fooling Sets and. Lecture 5

Theory of Computation

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Equational Logic. Chapter Syntax Terms and Term Algebras

Comp487/587 - Boolean Formulas

CSE 20 DISCRETE MATH. Winter

CS 455/555: Finite automata

Computation Theory Finite Automata

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,

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

CMSC 330: Organization of Programming Languages

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall

Automata-based Verification - III

3515ICT: Theory of Computation. Regular languages

CSci 311, Models of Computation Chapter 4 Properties of Regular Languages

Automata Theory, Computability and Complexity

Automata-based Verification - III

Automata, Logic and Games: Theory and Application

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

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

Finite Automata Part Two

mat.haus project Zurab Janelidze s Lectures on UNIVERSE OF SETS last updated 18 May 2017 Stellenbosch University 2017

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages

Critical CS Questions

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

Chapter 1. Introduction

Theory of Computation 1 Sets and Regular Expressions

Lecture 7. Logic. Section1: Statement Logic.

Transcription:

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

Automata Theory 2 of 22 Automata theory deals with the definitions and properties of mathematical models of computation. These models play a role in several applied areas of computer science. One model, called the finite automaton, is used in text processing, compilers, and hardware design. Another model, called the context-free grammar, is used in programming languages and artificial intelligence. Automata theory allows practice with formal definitions of computation as it introduces concepts relevant to other nontheoretical areas of computer science.

Computability Theory 3 of 22 There are certain basic problems cannot be solved by computers. One example of this phenomenon is the problem of determining whether a mathematical statement is true or false. In complexity theory, the objective is to classify problems as easy ones and hard ones; whereas in computability theory, the classification of problems is by those that are solvable and those that are not.

Complexity Theory 4 of 22 Computer problems come in different varieties; some are easy, and some are hard. For example, the sorting problem is an easy one. Say that you need to arrange a list of numbers in ascending order. Even a small computer can sort a million numbers rather quickly. Compare that to a scheduling problem. Say that you must find a schedule of classes for the entire university to satisfy some reasonable constraints, such as that no two classes take place in the same room at the same time. The scheduling problem seems to be much harder than the sorting problem. If you have just a thousand classes, finding the best schedule may require centuries, even with a supercomputer.

5 of 22 Math Notes and Terminology : Sets A set is a group of objects represented as a unit. Sets may contain any type of object, including numbers, symbols, and even other sets. The objects in a set are called its elements or members. For example, S = { 7, 21, 57} Where 7,21, and 57 are elements in set S. Therefore, 7 { 7, 21, 57} and 8 { 7, 21, 57} For two sets A and B, A B if every member of A also member of B. The set with 0 members is called the empty set or. For example, { n n = m 2 for some m N } means the set with perfect squares. (N for natural numbers). Union: A B ( combining all elements in A and B) Intersection: A B (a set of elements in A and B) Complement: A ( all elements are not in A)

6 of 22 Math Notes and Terminology: Sequences Sequence: is a list of objects in some order. Usually, a sequence designates by writing the list within parentheses. For example: Sq1=(7, 21, 57) Note: order and repetition don t matter in a set, but in a sequence they do. Sets and sequences may be finite or infinite. For example: (7,21,57) is not the same as (57,7,21) S1= {7,21,57}, S2 = {7,7,21,57} S1 and S2 are identical sets. Sq2=(7, 7, 21, 57) Sq1 and Sq2 are not the identical sequences.

7 of 22 Math Notes and Terminology: Tuples Tuple: is a finite sequence, a sequence with k elements is a k-tuple. For example: Sq1 is a 3-tuple Note: a 2-tuple is called an ordered pair. Note: sets and sequences may appear as elements of other sets of sequences. For example: the power set of A is the set of all subsets of A. let A = {0,1} therefore, the power set of A is {,{0},{1},{0, 1 }} the set of all ordered pairs whose elements are 0s and 1s is {(0, 0 ), ( 0, 1 ), ( 1, 0 ), ( 1, 1 )}

8 of 22 Math Notes and Terminology: Cartesian Product Cartesian Product: (A B), is a set of all ordered pairs wherein the first element is a member of A and the second element is a member of B. Example 1 Let A={1, 2 } and B={x, y, z } then A B= { ( 1, x ), ( 1, y ), ( 1, z ), ( 2, x ), ( 2, y ), ( 2, z ) } A B A = { ( 1, x, 1 ), ( 1, x, 2 ), ( 1, y, 1 ), ( 1, y, 2 ), ( 1, z, 1 ), ( 1, z, 2 ), ( 2, x, 1 ), ( 2, x, 2 ), ( 2, y, 1 ), ( 2, y, 2 ), ( 2, z, 1 ), ( 2, z, 2 )} Note: if we have the Cartesian product of a set with itself, thus Example 2 The set N 2 equal N N, it consist of all ordered pairs of natural numbers; {{i, j ) i, j 1 }

Math Notes and Terminology: Functions and Relations Function: is an object that sets up an input-output relationship. A function takes an input and produces an output. f(a) = b Mapping: if f(a)=b, then f maps a to b. Domain: is a set of possible inputs to the function. Range: the outputs of a function come from a set. For example, f: D R : f is a function with domain D and range R Example 3 This function adds 1 to its input and then outputs the result modulo 5. 9 of 22

10 of 22 Math Notes and Terminology: Graphs A graph (or undirected graph): is a set of points with lines connecting some of the points. Nodes (or vertices): are points in the graph. Edges: are lines in the graph, no more than one edge is allowed between any two nodes. Degree: is the number of edges at a particular node. Note: if V is the set of nodes of G and E is the set of edges, then G=(V,E). For example: All nodes have degree 2 all nodes have degree 3

11 of 22 Math Notes and Terminology: Graphs Example: Describe the following graphs For graph (a) All nodes have degree 2 G= ( V, E ) = ( { 1, 2, 3, 4, 5 },{(1, 2 ), ( 2, 3 ), ( 3, 4 ), ( 4, 5 ), ( 5, 1 ) } ) For graph (b) All nodes have degree 3 G= ( V, E ) = ( { 1, 2, 3, 4 },{(1, 2 ), ( 1, 3 ), ( 1, 4 ), ( 2, 3 ), ( 2, 4 ), ( 3, 4 ) } )

12 of 22 Math Notes and Terminology: Graphs Path: is a sequence of nodes connected by edges A graph is connected if every two nodes have a path between them A path is cycle if it starts and ends in the same node A path is a tree if it is connected and has no simple cycles The nodes of a degree 1 in a tree, other than the root, are called leaves of the tree. a path in a graph a cycle in a graph a tree in a graph

13 of 22 Math Notes and Terminology: Graphs Directed graph: is a graph which has paths with arrows. Note: in a directed graph, an edge from i to j is represented as pair(i,j) Example: Consider the following graph G= ( V, E ) =({1, 2, 3, 4, 5, 6 },{(1, 2 ), ( 1, 5 ), ( 2, 1 ), ( 2, 4 ), ( 5, 4 ), ( 5, 6 ), ( 6, 1 ), ( 6, 3 ) } )

14 of 22 Math Notes and Terminology: Strings and Languages Alphabet : is any nonempty finite set. Symbol: is the member of the alphabet. Note: 1. Strings of characters are fundamental building blocks in computer science. 2. Greek letters and are used to designate alphabets and a typewrite font from symbols from an alphabet. 1 = { 0, 1 } 2 = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } = { 0, 1, x, y, z } String over an alphabet: is a finite sequence of symbols from that alphabet usually written next to one another and not separated by commas. For example: 01001 is a string over 1, and abracadabra is a string over 2.

Math Notes and Terminology: Strings and Languages Length of string : is the number of symbols that the string contains. w is the length of string w over alphabet Empty string : is the string with length zero. The empty string represents 0 in a number system. Example: for w with length n, then w = w 1 w 2 w 3 w n where w i and reverse of w is w n w n-1 w n-2 w 1 Note: String z is substring of w if z appears consecutively within w such, cad is a substring of abracadabra Concatenation: is the string obtained by appending string y to the end of string x. such, string x with length m, string y with length n, then concatenation xy is x 1 x m y 1 y n Note: x k is a string concatenated with itself 15 of 22

Math Notes and Terminology: Strings and Languages 16 of 22 Example : What is the string ordering of all strings over the = {0,1}? Answer: (, 0, 1, 00, 01, 10, 11, 000, )

17 of 22 Math Notes and Terminology: Boolean Logic NOT ( ): negation AND ( ): conjunction OR ( ) : disjunction XOR ( ):exclusive or Equality ( ) Implication ( )

18 of 22 Math Notes and Terminology: Exercises Exercise 1: Name the following sets 1. S1= { 1, 3, 5, 7, } 2. S2 = { n n = 2 m f o r s o me m in N} where N is natural number Answer: 1. Odd natural number 2. S2={2, 4, 6, 8,..} even natural numbers Exercise 2: Write the formal description of the set containing the numbers 1, 10, and 100. Answer: S = {1, 10, 100}

19 of 22 Math Notes and Terminology: Exercises Exercise 3: Let A = { x, y, z }, and B={x, y }. Find A B and A B. Answer: A B = { x, y } A B = {(x, x ), ( x, y ), ( y, x ), ( y, y ). ( z, x ), ( z, y )}

20 of 22 Math Notes and Terminology: Exercises Exercise 4: Let X = {1,2,3,4,5}, and Y={6,7,8,9,10}. The unary function f:x Y and the binary function g: X X Y are described in the following tables 1. What are the range and domain of f? 2. What is the value of g(4,f(4))? Answer 1. the domain is X and the range is Y 2. g(4,7) = 8

21 of 22 Math Notes and Terminology: Exercises Exercise 5: Describe the following graph Answer The graph is the directed graph V = {0,1,2,3,4,5,6} E={(0, 2), (0, 4), (0, 5), (1, 0), (2, 1), (2, 5), (3, 1), (3, 6), (4, 0), (4, 5), (6, 3), (6, 5)}

22 of 22 End of Chapter 0! Questions?