Chapter 2 Revision of Mathematical Notations and Techniques

Slides:



Advertisements
Similar presentations
Mathematical Preliminaries
Advertisements

Equivalence Relations
Recursive Definitions and Structural Induction
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
2.1 Sets. DEFINITION 1 A set is an unordered collection of objects. DEFINITION 2 The objects in a set are called the elements, or members, of the set.
Relations.
Representing Relations Using Matrices
Applied Discrete Mathematics Week 11: Graphs
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
Regular Languages Sequential Machine Theory Prof. K. J. Hintz Department of Electrical and Computer Engineering Lecture 3 Comments, additions and modifications.
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Relations Chapter 9.
1 CSCI 2400 section 3 Models of Computation Instructor: Costas Busch.
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Induction and recursion
Section 5.3. Section Summary Recursively Defined Functions Recursively Defined Sets and Structures Structural Induction.
CSC312 Automata Theory Lecture # 2 Languages.
Mathematical Preliminaries Strings and Languages Preliminaries 1.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
1 Chapter Elementary Notions and Notations.
1 Chapter 1 Introduction to the Theory of Computation.
Discrete Math for CS Binary Relation: A binary relation between sets A and B is a subset of the Cartesian Product A x B. If A = B we say that the relation.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
Fall 2005Costas Busch - RPI1 Mathematical Preliminaries.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Mathematical Induction
4.3 Recursive Definitions and Structural Induction Sometimes it is difficult to define an object explicitly. However, it may be easy to define this object.
Regular Expressions and Languages A regular expression is a notation to represent languages, i.e. a set of strings, where the set is either finite or contains.
Strings and Languages CS 130: Theory of Computation HMU textbook, Chapter 1 (Sec 1.5)
Mathematical Proofs. Chapter 1 Sets 1.1 Describing a Set 1.2 Subsets 1.3 Set Operations 1.4 Indexed Collections of Sets 1.5 Partitions of Sets.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Mathematical Preliminaries
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
THEORY OF COMPUTATION Komate AMPHAWAN 1. 2.
Chapter 2 With Question/Answer Animations. Section 2.1.
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
CS 203: Introduction to Formal Languages and Automata
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Chapter8 Relations 8.1: Relations and their properties.
Chapter 1 INTRODUCTION TO THE THEORY OF COMPUTATION.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Relations.
Formal Language & Automata Theory
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Equivalence Relations
Relations Chapter 9.
Mathematical Notions and Terminology
CSCI-2400 Models of Computation.
Mathematical Preliminaries Strings and Languages
Mathematical Preliminaries
MCS680: Foundations Of Computer Science
Chapter 1 Introduction to the Theory of Computation
Presentation transcript:

Chapter 2 Revision of Mathematical Notations and Techniques Automata Theory CS 3313 Chapter 2 Revision of Mathematical Notations and Techniques

String Alphabets & Language * A SYMBOL is an abstract entity. * Letters (a-z) and digits (0-9) are examples of frequently used symbols. * A STRING (or word) is a finite sequence of symbols juxtaposed (adjacent). * For example ‘a’, ‘b’ and ‘c’ are the symbols and “abcb” is a string. * The LENGTH of string “w”, denoted |w|, is the number of symbols composing the string. * For example “abcb” has length 4.

The empty string, denoted by “” (in some other books it * The empty string, denoted by “” (in some other books it denoted by “”), is the string consisting of zero symbols. * Thus || = 0. (length of empty is equal to zero) * A PREFIX of a string is any number of leading symbols of that string and a SUFFIX is any number of trailing symbols. * For example, string “abc” has prefixes , a, ab and abc; its suffixes are , c, bc and abc. * Note: A prefix or suffix of a string, other than the string itself is called “PROPER” PREFIX or SUFFIX.

The CONCATENATION of the two strings is the string * The CONCATENATION of the two strings is the string formed by writing the first, followed by the second, with no space between them. * For example, the concatenation of “dog” and “house” is “doghouse”. * Juxtaposition is used as the concatenation operator. * That is, if ‘s1’ and ‘s2’ are strings, then s1s2 is the concatenation of these two strings. * The empty string is the identity for the concatenation operator. *  That is, w = w = w.

* An ALPHABET is the finite set of symbols. * A certain specified set of string of characters from the alphabet will be called the LANGUAGE. * In other words, A LANGUAGE is a set of string of symbols from some one alphabet. * The empty set, , and the set consisting of the empty string {} are languages. * Note: they are distinct; the latter has a member while the former does not. * The set of Palindromes (string that read the same forward and backward) over the alphabet {0, 1} is an infinite language. * Some members of this language are , 0, 1, 00, 11, 010, 101, …, 1101011 etc.

Note that the set of all palindromes over an infinite * Note that the set of all palindromes over an infinite collection of symbols is technically not a language because its string are not collectively built from an alphabet.             * Another language is the set of all string over a fixed alphabet . * We denotes this language by *. * For example,  = {a}, then * = {, a, aa, aaa, … }. * If  = {0, 1}, then * = {, 0, 1, 00, 01, 10, 11, 100, 000, … }. * Some examples: - {X  {a, b}* | |X|  8} = {, a, b, aa, ab, ba, bb, …, bbbbbbbb} - {X  {a, b}* | |X| is odd} = {, a, b, aaa, aab, …, bbbbbbb}

An alphabet is a finite, non-empty set of elements, * An alphabet is a finite, non-empty set of elements, called as symbols or letters. * Let X be an alphabet. * A word over the alphabet X is a finite sequence of symbols from X. * The empty word is ‘L’, is the empty sequence. * Note: The empty word L is a word over any alphabet. * The universal language of all words over an alphabet X is denoted by X*. * X* is an infinite set. * A language L over an alphabet X is a subset of X*. * L Î X* - This means that language is a set of words.

* Note: F, which is empty set, is a language over any alphabet. * Similarly {L }, the set containing only one word, that is empty word, is a language over any alphabet. * But F ¹ { L }

Graphs & Trees:   ·    * A GRAPH denoted G = (V, E), consists of a finite set vertices (or nodes) V and a set of pairs of vertices E called edges. * An example graph is shown in following Figure:

* Here V = {1, 2, 3, 4, 5} and E = {(n, m) | n+m = 4} * A PATH in a graph is sequence of vertices V1, V2, V3, …, Vk, K  1, such that there is an edge (Vi , Vi+1) for each i, 1  i  k.       * E = { (1, 3), (1, 4), (3, 4), (2, 5) }       * The length of the path is k-1. * For example, 1, 3, 4 is a path in the graph of Figure above; so is 5 by itself.             If V1 = Vk the path is a CYCLE.

Directed Graph * A directed graph (or digraph), also denoted G = {V, E}, consists of a finite set of vertices V and a set of ordered pairs of vertices E called arcs. * We denote an arc from V to W by V  W. * A PATH in a digraph is sequence of vertices V1, V2, V3, …, Vk, K  1, such that Vi  Vi+1 is an arc for each i, 1  i  k. * If V  W is an arc we say V is a predecessor of W and W is a successor of V.

Trees * A TREE (strictly speaking, an ordered, directed tree) is a digraph with the following properties. * There is one vertex, called the root, that has no predecessors and from which there is a path to every vertex. * Each vertex other than the root has exactly one predecessor. * The successors of each vertex are ordered “from left to right”. * We shall draw trees with the root at the top and all arcs pointing downward. * The arrow on the arcs are therefore not needed to indicate direction, and they will not be shown.

    * The successors of each vertex will be drawn in left-to-right order. * There is a special terminology for trees that differs from the general terminology for arbitrary graphs. * A successor of a vertex is called a SON, and the predecessor is called the FATHER. * If there is a path from vertex V1 to vertex V2, then V1 is said to be ANCESTOR of V2 and V2 is said to be a DESCENDANT of V1. * Note that the case V1 = V2 is not ruled out; any vertex is an ancestor and a descendant of itself. * A vertex with no sons is called a LEAF, and the other vertices are called INTERIOR vertices.

Inductive Proof * Many theorems will be proved by mathematical induction. * Suppose we have a statement P(n) about a nonnegative integer n. * A commonly chosen example is to take P(n) to be:

* The principle of mathematical induction is that P(n) follows from: a)                P(0), and b)                P (n-1) implies P(n) for n  1. * Condition (a) in an inductive proof is called the BASIS, and condition (b) is called the inductive step. * The left-hand side of (b), that is P(n-1), is called the inductive hypothesis. * Example: let us prove eq. by mathematical induction. * We establish (a) by substituting 0 for n in (eq.) and observing that both are 0. * To prove (b), we substitute n-1 for n in (eq.) and try to prove (eq.) from the result. * That is, we must show for n  1 that …Proof.

* A collection of the objects (members of the set) without repetition. Set Notation * A collection of the objects (members of the set) without repetition. * Finite sets may be specified by listing their members between brackets. * For example, we used {0, 1} to denote the alphabet of symbols 0 and 1. * If every member of A is a member of B, then we write A  B and say A is contained in B. * A  B is synonymous with B  A. * If A  B but A  B, that is, every member of A is in B and there is some member of B that is not in A, then we write A  B. * Sets A and B are equal if they have the same members. * That is A = B if and only if A  B and B  A.

Operations on sets: * The usual operations defined on sets are: 1) A U B, the UNION defined on sets are:                {X / X is in A or X is in B} 2) A B, the INTERSECTION of A and B, is:                {X / X is in A and X is in B} 3) A – B, the difference of A and B, is:          {X / X is in A and is not in B} 4)  A x B, the Cartesian product of A and B, is the set of ordered pair (a, b) such that a is in A and b is in B. 5)   2A, the power set of A, is the set of all subsets of A

· Example, A = {1, 2} and B = {2, 3} ·    AUB = {1, 2, 3} ·    A B = {2} ·    A-B = {1} ·    B-A = {3} ·    AxB = {(1,2), (1,3), (2,2), (2,3)} ·    BxA = {(2,1), (2,2), (3,1), (3,2)} ·    2A = {, {1}, {2}, {1,2}} ·   If A and B have n and m members, respectively, then AxB has nxm members and 2A has 2n members. ·   Cardinality = number of members

Relations · A (binary) relation is a set of pairs. · The first component of each pair is chosen form a set called the “domain” and the second component of each pair is chosen form a (possibly different) set called the range. · We shall use primarily relations in which the domain and range are the same set S. · In that case we say the relation is on S. · If R is a relation and (a, b) is a pair in R, then we often write aRb.

Properties of relations · We say a relation R on set S is: 1)   Reflexive: if aRa for all a in S; 2) Irreflexive: if aRa is false for all a in S; 3) Transitive: if aRb and bRc imply aRc; 4) Symmetric: if aRb implies bRa; 5) Asymmetric: if aRb implies that bRa is false.      * Note that any asymmetric relation must be irreflexive. * Example: the relation < on the set of integers is transitive because a < b and b < c implies a < c. * It is asymmetric and hence irreflexive because a < b implies b < a false. * A relation R that is reflexive, symmetric, and transitive is said to be an equivalence relation.

Closures of Relations · Suppose P is a set of properties of relations. · The P-closure of a relation R is the smallest relation R’ that includes all the pairs of R and possesses the properties in P. · For example, the transitive closure of R, denoted R+ is defined by: 1) If (a, b) is in R, then (a, b) is in R+. 2) If (a, b) is in R+ and (b, c) is in R, then (a, c) is in R+. 3) Noting is in R+ unless it so follows from (1) and (2).  

·. It should be evident that any pair placed in R+ by rule (1) and  ·  It should be evident that any pair placed in R+ by rule (1) and (2) belongs there, else R+ would either not include R or not be transitive. · Also an easy inductive proof shows that R+ is in fact transitive. · Thus R+ includes R, is transitive, and contains as few pairs as any relation that includes R and is transitive. · The reflexive and transitive closure of R, denoted R*. · For example: · let R = {(1, 2), (2, 2), (2, 3)} be a relation on the set of {1, 2, 3}, then · R+ = {(1, 2), (2, 2), (2, 3), (1, 3)}, and · R* = {(1, 1), (1, 2), (1, 3), (2, 2), (2, 3), (3, 3)}

·. let R = {(aRb), (bRb), (bRc)} be a relation on the set of {a, b,  ·  let R = {(aRb), (bRb), (bRc)} be a relation on the set of {a, b, c}, then · R+ = {(aRb), (bRb), (bRc), (aRc)}, and - - aRc also · R* = {(aRa), (aRb), (aRc), (bRb), (bRc), (cRc)} - - all cases