CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN Lecture 1: Introduction
Introduction to the course 2 Required Text Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, BY MICHAEL SIPSER. The slides are only used for presenting the lectures and it is NOT USED FOR STUDY.
Introduction to the course 3 In this course we will cover these topics within 15 weeks.
Introduction to the course 4 Assessment method Assessment Week Grade Percentage from overall grade Comments Work sheets 4 work sheets 10 10% Every sheet covers from 2-3 chapters Quiz #1 Quiz #2 TUE 25/4/1435 TUE 01/6/1435 5 5% Midterm #1 Midterm #2 Project Class participation TUE 10/5/1435 TUE 15/6/1435 MON 28/6/1435 Every lecture 15 15 10 5 15% 15% 10% 5% Oral questions Final exam Total SUN 19/7/1435 40 100 40% 100%
0.1 Introduction 5 The theory of computation is divided over three parts: Part1: Automata Part2: Computability Part3: Complexity. They are all combined in one question: Q: What are the fundamental capabilities and limitations of computers?
Introduction..(cont.) 6 Complexity Computability Automata Computer problems (hard easy) Hard problem options Determine (true-false) deals with definitions and properties of mathematical models of computation Finite automaton (text processing compilershardware design) Who benefits from hard computations Context-free grammar (PL AI)
7 Set: A set is a group of objects represented as a unit. Sets contain any object (numbers, symbols, other sets). Example: A={7, 21, 57} Properties (read page 3-5) Membership- subsets- proper subset- order and repetition (set or multiset) infinite set- empty set. Describing a set {n rule about n} Set operations (union intersection complement) Venn diagram
8 Sequences and tuples. Sequence is a list of objects in some order. Uses parentheses. Tuples are finite sequence Properties (read page 6) Power set pairs Cartesian product or cross product
9 Functions and Relations Functions are central to mathematics. A function is an object that sets up an input-output relationship. (ex. f a = b ) A function is also called mapping. Examples: abs(x), add(a, b),. Domain (possible inputs), range (possible outputs) The notation for that: f: D R Ex. abs: Z Z, what about the add:?? a function that uses all the element in the range is called onto the range Ways to describe a function: procedures use table
10 Ex. f: 0,1,2,3,4 {0,1,2,3,4} What is the function and what is the modulo (m)? Zm = 0,1,2,, m 1, a number modulo m is the reminder after division by m. g: Z4 X Z4 Z4 (two dimension table, function add) When f is A 1 x.x A k, for some sets A 1.. A k, the input to f is a k- tuple (a 1, a 2,., a k ) and we call the a i the arguments to f A function with k arguments is called a k-ary function, and k is called the arity of the function. Some binary functions use infix notation (use symbol) rather than prefix notation (ex. a+b, add(a,b) ) A predicate or property is a function whose range is TRUE or FALSE (ex. Even(4)=TRUE) A property whose domain is a set of k-tuples Ax xa is called a relation. (k-ary relation)(ex. 2-ary relation using less than (<) infix)
11 Example 0.10 Predicate function (range {true, false}) on set {SCISSORS, PAPERS, STONES} relation is beat. Express beat set Equivalence relation R (special type of binary relation) must meat three conditions: Reflexive if for every x, xrx Symettric if for every x and y, xry and yrx Transitive if for every x,y and z, xry and yrz then xrz Example: set S={1,2,3,4}, R1 is less than or equal R2 is has the same parity. Explain which is equivalence relation?
12 Graphs: Undirected graph (graph): set of points with lines connecting some of the points. (points= nodes or vertices) (lines=edges) Directed graph : points with arrows connected the points. Node degree is number of edges on a node. No more than one edge is allowed between two nodes.
13 Graphs (cont.): Order of edge pair (i,j) does not matter only in undirected graph How to write the formal description of a graph G with V nodes and E edges for (a) (b) graphs.
14 Graphs are mostly used to represent data. Labeling the nodes or the edges make it Labeled Graph. Subset graph A path is a sequences of nodes connected by edges. Simple path doesn t repeat any nodes. Connected graph if every two nodes have a path between them. A path is cycle if it starts and ends in the same node. A simple cycle contains at least 3 nodes and repeat only the first and last node. A graph is a tree if connected and have NO simple cycles. Tree properties: root, leaves,
15 In Directed graph: outdegree =number of arrows pointing from a node. indegree= number of arrows pointing to a node Write formal description of the graph: Directed path when all arrows point in the same direction as its steps. Directed graph is strongly connected if a directed path connects every two nodes.
16 Strings and languages: Alphabet is any nonempty finite set and its members are symbols. String over an alphabet is finite sequence of symbols of that alphabet. (ex: 1 = 0,1 ) The length of string is the number of symbols in the string w Length zero is called empty string ( ᵋ ) Reverse of w (w R ) Substring (z of w) if z appears consecutively within w Concatenation. Lexicographic ordering (same as dictionary ordering). Ex. {0,1}
17 Boolean logic: Boolean logic is a mathematical system built around True and False values. (Boolean values) (0,1) Boolean operations: (negation -NOT ( ), conjunction- AND( ), disjunction OR ( )) these operations are used with operands. Other operations:( XOR ( ), equality ( ), implication ( ))
18 Distributive law.