Language: Set of Strings

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Properties of Regular Languages
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
The Engineering Design of Systems: Models and Methods
CS466 (Prasad)L1Sets1 Introduction Language: Set of Strings.
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Sets 1.
Sets 1.
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Relations Chapter 9.
1 CSCI 2400 section 3 Models of Computation Instructor: Costas Busch.
 2004 SDU Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心 430
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
CSCI 4325 / 6339 Theory of Computation Chapter One Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Functions. Copyright © Peter Cappello2 Definition Let D and C be nonempty sets. A function f from D to C, for each element d  D, assigns exactly 1 element.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
ICS 253: Discrete Structures I
1 Chapter 1 Introduction to the Theory of Computation.
Sets Defined A set is an object defined as a collection of other distinct objects, known as elements of the set The elements of a set can be anything:
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (2)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Sets Define sets in 2 ways  Enumeration  Set comprehension (predicate on membership), e.g., {n | n  N   k  k  N  n = 10  k  0  n  50} the set.
A Quick Math Overview (not the last one!) Section 1.4, you should it read carefully! Reading the corresponding material from the book is strongly encouraged.
CHAPTER 3 FUZZY RELATION and COMPOSITION. 3.1 Crisp relation Product set Definition (Product set) Let A and B be two non-empty sets, the product.
Sets. Definitions (I) Collection of elements such that: There are no duplicates There is no order Special sets Universe (U or E): all elements under consideration.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Mathematical Preliminaries
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
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.
Grammars A grammar is a 4-tuple G = (V, T, P, S) where 1)V is a set of nonterminal symbols (also called variables or syntactic categories) 2)T is a finite.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
Set Theory Concepts Set – A collection of “elements” (objects, members) denoted by upper case letters A, B, etc. elements are lower case brackets are used.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
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 B = {a,b} {( 0, a), (
Advanced Digital Designs Jung H. Kim. Chapter 1. Sets, Relations, and Lattices.
1 A well-parenthesized string is a string with the same number of (‘s as )’s which has the property that every prefix of the string has at least as many.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
The Relation Induced by a Partition
Formal Language & Automata Theory
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CS201: Data Structures and Discrete Mathematics I
Discrete Math (2) Haiming Chen Associate Professor, PhD
CSCI-2400 Models of Computation.
Mathematical Background 1
Mathematical Background 1
Relations and their Properties
Introduction to Relations and Functions
ICS 253: Discrete Structures I
Mathematical Background
Chapter 1 Introduction to the Theory of Computation
Equivalence Relations
Equivalence Relations
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Presentation transcript:

Language: Set of Strings Preliminaries Language: Set of Strings Examples: Names, dates, email addresses, Java, C++, Patterns in PERL, Python, … CSC 361 Preliminaries

Specification and recognition of languages Sets Operations Defining sets (inductively) Proving properties about sets (using induction) Defining functions on sets (using recursion) Proving properties about functions (using induction) Strings Languages : set of strings CSC 361 Preliminaries

Representation of Sets Set: collection of objects Finite : can use enumeration E.g., {a,b,c} Infinite : requires describing an infinite characteristic of members using finite terms E.g., { n e N | even(n) /\ square(n) } CSC 361 Preliminaries

Sets: Examples Sets are denoted by { <collection of elements> } {} {a,b} {{}} {1, 2, …, 100} {0, 1, 2, …} {0,2,4, …} {2n | n  } “the empty set” “the set consisting of the elements a and b” “the set consisting of the empty set” “the set consisting of the first 100 natural numbers” “the set consisting of all natural numbers” “the set of all natural pair numbers” “the set of all natural pair numbers” CSC 361 Preliminaries

Set Inclusion and Set Equality Operations on Sets Set Inclusion and Set Equality Definition: Given 2 sets, A and B, A is contained in B, denoted by A  B, if every element in A is also an element in B True or false: {e,i,t,c} {a, b, …, z} for any set A, A  A for any set A, A  {A} true true false Definition: Given 2 sets A and B, A is equal to B, denoted by A = B, if A  B and B  A CSC 361 Preliminaries

Operations on Sets Review: Member Union Intersection Subset Powerset Cartesian product Definition of an op – its properties CSC 361 Preliminaries

Operations on Sets Set Difference DeMorgan’s Laws CSC 361 Definition of an op – its properties CSC 361 Preliminaries

Operations on Sets Cartesian Product Definition: Given two sets, A and B, the Cartesian product of A and B, denoted by A  B, is the following set: {(a,b) | a A and b  B} pair or 2-tuple Examples: What is: {1, 2 , 3}  {a,b} = True or false: {(1,a), (3,b)}  {1, 2 , 3}  {a,b} True or false: {1,2,3}  {1, 2 , 3}  {a,b} {(1,a), (1,b), (2,a), (2,b), (3,a), (3,b)} true false CSC 361 Preliminaries

Operations on Sets Cartesian Product of More Than 2 Sets Definition: Given three sets, A, B and C, the Cartesian product of A, B, and C denoted by A  B  C, is the following set: {(a,b,c) | a A, b  B, c  C} Triple or 3-tuple Definition. (x,y,z) = (x’,y’, z’) only if x = x’, y = y’ and z = z’ These definitions can be extended to define the Cartesian product: A1  A2  …  An and equality between n-tuples CSC 361 Preliminaries

Operations on Sets Some Cartesian product problems to try out: What is: {1, 2 , 3}  {a,b}  {,} = What is the form of the set A  B  C  D What is the form of the set A  B  (C  D) What is the form of the set (A  B )  (C  D) CSC 361 Preliminaries

Partition of a Set X The set of subsets of X is a partition of X iff “covers all subsets” “pair-wise disjoint” Collectively Exhaustive / Mutually Exclusive Combinatorics: list partition, number partition, … CSC 361 Preliminaries

Examples Set of Natural numbers is partitioned by “mod 5” relation into five “equivalence classes”: { {0,5,10,…}, {1,6,11,…}, {2,7,12,…}, {3,8,13,…}, {4,9,14,…} } “String length” can be used to partition the set of all bit strings. { {},{0,1},{00,01,10,11},{000,…,111},… } Equivalence = Similar for a purpose (approximation) CSC 361 Preliminaries

Relations Definition: Given two sets, A and B, A relation R is any subset of A  B. In other words, R  A  B Relations are used to describe how elements of different sets interact Question: What does the relation A  B indicate? Examples of relations Simple: {(c,s) | c is a class at KU, s is a student at KU, AND s is in C } CSC 361 Preliminaries

Relations Example: Let I be the set of all classroom instructors at Kutztown Let S be the set of all students at Kutztown Then, we can define the relation Students of an Instructor, over I x S, as follows: Students of an Instructor= {(i,s) | i I, s S, s is in a course of instructor i} Questions: Does this relation represent an equivalence relation? Suppose this instructor teaches courses c1, c2, and c3. Would the sets Students in instructor i’s course, for courses c1, c2, and c3, be disjoint? CSC 361 Preliminaries

Equivalence Relations A relation R is an equivalence relation if R is reflexive, symmetric, and transitive Relation R is: reflexive if (a,a)  R for each a in the language symmetric if when (a,b)  R then (b,a)  R transitive if (a,b)  R and (b,c)  R, then (a,c)  R Equivalence relations are generalizations of the equality relation x {(1,2),(1,3),…, (2,3),(2,4),…} {(a,b) | a and b are males between 35 and 40 years old} “the relation x < y”  CSC 361 Preliminaries

Functions Definition: A function f from a set A to a set B, denoted by f: A  B , is rule of correspondence between A and B such that there is a unique element in B assigned to each element in A i.e. for each a A there is one and only one b B such that (a,b) f Note: A is the domain of f B is the range of f Question: Is the following relation also a function from the set of KU classes to the set of KU students? {(c,s) | c is a class at KU, s is a student at KU, AND s is in C } CSC 361 Preliminaries

Functions Kinds of Functions Total One to one (injection) All domain elements map to an element in the range One to one (injection) Total, and each mapping from domain to range is unique Onto (surjection) All elements of the range are mapped to from a domain element 1-1 & Onto (bijection) CSC 361 Preliminaries

(Total) Function Domain Co-domain ( Range) A B f CSC 361 Preliminaries

One to One Function (injection) Domain Co-domain ( Range) A B f CSC 361 Preliminaries

Onto Function (surjection) Domain Co-domain ( Range) A B f CSC 361 Preliminaries

1-1 Onto Function (bijection) Domain Co-domain ( Range) A B f CSC 361 Preliminaries

Inductive Definitions Constructive Example Set of natural numbers N = {0,1,2,3,…} Finite representation in terms of Seed element: zero Closure Operation: successor function {0,s(0),s(s(0)),s(s(s(0))),…} Imposes additional structure on the domain. CSC 361 Preliminaries

(* Minimality condition to uniquely determine N *) Basis case: Recursive step: Closure: only if it can be obtained from 0 by a finite number of applications of the operation s. (* Minimality condition to uniquely determine N *) CSC 361 Preliminaries

Languages A language can be specified as a set of strings. Languages are classified by how they can be formed Regular languages are the most constrained Others Context-free Context-sensitive Recursively enumerable CSC 361 Preliminaries

Language Semantics - Syntax Regular sets/languages Generator Regular Expressions, Regular Grammars Recognizer Finite State Automata Context-free languages Context-free Grammar Push-down Automata Identifiers, numbers, etc in a PL; Tokenizer BNF; Parser DTD; XML Parser CSC 361 Preliminaries