CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.

Slides:



Advertisements
Similar presentations
1.6 Functions. Chapter 1, section 6 Functions notation: f: A B x in A, y in B, f(x) = y. concepts: –domain of f, –codomain of f, –range of f, –f maps.
Advertisements

22C:19 Discrete Math Sets and Functions Fall 2011 Sukumar Ghosh.
22C:19 Discrete Math Sequence and Sums Fall 2011 Sukumar Ghosh.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
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.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
Sets Section 2.1. Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting.
modified from UCI ICS/Math 6D, Fall Sets+Functions-1 Sets “Set”=Unordered collection of Objects “Set Elements”
Functions Goals Introduce the concept of function Introduce injective, surjective, & bijective functions.
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,
Survey of Mathematical Ideas Math 100 Chapter 2
Chapter 7 Functions Dr. Curry Guinn. Outline of Today Section 7.1: Functions Defined on General Sets Section 7.2: One-to-One and Onto Section 7.3: The.
1 CMSC 250 Chapter 7, Functions. 2 CMSC 250 Function terminology l A relationship between elements of two sets such that no element of the first set is.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Sets Set Operations Functions. 1. Sets 1.1 Introduction and Notation 1.2 Cardinality 1.3 Power Set 1.4 Cartesian Products.
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
2.3 Functions A function is an assignment of each element of one set to a specific element of some other set. Synonymous terms: function, assignment, map.
Foundations of Discrete Mathematics Chapter 3 By Dr. Dalia M. Gil, Ph.D.
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.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
ICS 253: Discrete Structures I
Week 7 - Friday.  What did we talk about last time?  Set disproofs  Russell’s paradox  Function basics.
R. Johnsonbaugh, Discrete Mathematics 5 th edition, 2001 Chapter 2 The Language of Mathematics.
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
Fall 2002CMSC Discrete Structures1 … and the following mathematical appetizer is about… Functions.
10/26/20151 … and the following mathematical appetizer is about… Functions.
FUNCTIONS.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
1 Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 1 The Foundations: Logic, Sets,
1.4 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 2 The set of positive.
Example Prove that: “IF 3n + 2 is odd, then n is odd” Proof by Contradiction: -p = 3n + 2 is odd, q = n is odd. -Assume that ~(p  q) is true OR -(p 
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Basic Structures: Functions Muhammad Arief download dari
Functions Section 2.3. Section Summary Definition of a Function. – Domain, Cdomain – Image, Preimage Injection, Surjection, Bijection Inverse Function.
CS201: Data Structures and Discrete Mathematics I
Discrete Mathematics R. Johnsonbaugh
MATH 224 – Discrete Mathematics
CompSci 102 Discrete Math for Computer Science
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.
ELEMENTARY SET THEORY.
Chapter 2 With Question/Answer Animations. Chapter Summary Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations.
Chapter 2 With Question/Answer Animations. Section 2.1.
Basic Structures: Sets, Functions, Sequences, and Sums.
Introduction to Set theory. Ways of Describing Sets.
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.
Review 2 Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by lower.
Discrete Mathematics Set.
Chapter 2 With Question/Answer Animations. Section 2.1.
CSci 2011 Discrete Mathematics Lecture 9, 10
FUNCTIONS COSC-1321 Discrete Structures 1. Function. Definition Let X and Y be sets. A function f from X to Y is a relation from X to Y with the property.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
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.
FUNCTIONS.
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.
22C:19 Discrete Structures Sequence and Sums Fall 2014 Sukumar Ghosh.
ICS 253: Discrete Structures I
Discrete Mathematics CS 2610
Sets Section 2.1.
CS 2210:0001 Discrete Structures Sets and Functions
MATH 224 – Discrete Mathematics
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Discrete Math (2) Haiming Chen Associate Professor, PhD
CS100: Discrete structures
Discrete Mathematics R. Johnsonbaugh
ICS 253: Discrete Structures I
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007
Presentation transcript:

CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh

What is a set? Definition. A set is an unordered collection of objects. S = {2, 4, 6, 8, …} COLOR = {red, blue, green, yellow} Each object is called an element or a member of the set.

Well known Sets Well known sets N = {0, 1, 2, 3 …}the set of natural numbers Z = {…, -2, -1, 0, 1, 2, …} the set of integers Z+ = {1, 2, 3, …} the set of positive integers R = the set of real numbers

Set builders A mechanism to define the elements of a set. This means, S = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19} Belongs to, an element of Belongs to, an element of

Venn diagram a e i o u The set V of vowels The universal set U contains all objects under consideration

Sets and subsets The null set (or the empty set} ∅ contains no element. A ⊆ B (A is a subset of B) if every element is also an element of B. Thus {0, 1, 2} ⊆ N, S ⊆ S, ∅ ⊆ any set A ⊂ B (called a proper subset of B) if A ⊆ B and A ≠ B The cardinality of S (|S|) is the number of distinct elements in S.

Power Set Given a set S, its power set is the set of all subsets of S. Let S = (a, b, c} power set of S = { ∅, {a}, {b}, {c}, {a, b}, {b, c}, {a, c} {a, b, c} Question. What is the cardinality of the power set of S?

Cartesian Product of Sets Ordered pair. It is a pair (a, b) for which the order is important (unlike a set) Example. The coordinate (x, y) of a point. (3, 5) is not the same as (5,3), so the order matters. Cartesian Product. The Cartesian product of two sets A, B, denoted by is the set of all ordered pairs Whereand.Thus

Example of Cartesian Product Cartesian Product of Set (Example) A = {a1, a2, a3} B= {b1, b2} A B = {(a1, b1), (a1, b2), (a2, b1), (a2, b2), (a3, b1), (a3, b2)} We define A 2 = A X A, A 3 = A 2 X A and so on. What is {0, 1} 3 ?

Union of Sets

Intersection of Sets Set of elements that belong to both sets

Union and Intersection Let A = {1, 2, 3, 4, 5} and B = {0, 2, 5, 8} Then A ⋃ B = {0, 1, 2, 3, 4, 5, 8} (A union B) And A ⋂ B = {2, 5} (A intersection B)

Disjoint Sets

Set difference & complement Let A = {1, 2, 3, 4, 5} and B = {0, 2, 5, 8} A – B = {x | x ∈ A ∧ x ∉ B} So, in this case, A – B = {1, 3, 4} Also A = {x | x ∉ A}

Set difference

Complement

Set identities Recall the laws (also called identities or theorems) with propositions (see page 27). Each such law can be transformed into a corresponding law for sets. Identity law Domination law Idempotent laws Double negation Commutative law Associative law De Morgan’s law Absorption law Negation law Replace ⋁ by ⋃ Replace ⋀ by ⋂ Replace ¬ by complementation Replace F by the empty set Replace T by the Universal set U

Set identities

Example of set identity

Visualizing DeMorgan’s theorem

Function Let A, B be two non-empty sets. (Example: A = set of students, B = set of integers). Then, a function f assigns exactly one element of B to each element of A Also called mapping or transformation … (As an example, if the function f is age, then it “maps” each student from set A To an integer from B to like age (Bob) = 19, age (Alice) = 21 …} function domain Co-domain

Terminology Example of the floor function

Examples

Exercises Let x be an integer. Why is f not a function from R to R if (a) f(x) = 1/x (b) f(x) = x ½ (c) f(x) = ±(x 2 + 1) ½

More examples What is the distinction between co-domain and range?

One-to-one functions The term injective is synonymous with one-to-one

Onto Functions The term surjective is synonymous with onto.

Strictly increasing functions Let where the set of real numbers The function f is called strictly increasing if f(x) < f(y), whenever x < y. One can define strictly decreasing functions in the same way. Is a strictly increasing function a one-to-one function?

Exercise 1-to-1 and onto function are called bijective.

Arithmetic Functions

Identity Function

Inverse Function

Inverse functions can be defined only if the original function is one-to-one and onto

Graph of a function Let. Then the graph of is the set of ordered pairs such that and that can be displayed as a graph. The floor function

Composition of functions Note that f(g(x) is not necessarily equal to g(f(x)

Some common functions Floor and ceiling functions Exponential function e x Logarithmic function log x The function sqrt (x) Question. Which one grows faster? Log x or sqrt (x)? Learn about these from the book (and from other sources).

Exercises on functions 1. Let be real numbers. Then prove or disprove

Countable sets Cardinality measures the number of elements in a set. DEF. Two sets A and B have the same cardinality, if and only if there is a one-to-one correspondence from A to B. Can we extend this to infinite sets? DEF. A set that is either finite or has the same cardinality as the set of positive integers is called a countable set.

Countable sets Example. Show that the set of odd positive integers is countable. f(n) = 2n-1 (n=1 means f(n) = 1, n=2 means f(n) = 3 and so on) Thus f : Z +  {the set of of odd positive integers}. So it is a countable set. The cardinality of such an infinite countable set is denoted by (called aleph null) Larger and smaller infinities ….

Fun with infinite sets Hilbert’s Grand Hotel Accommodates a finite number of guests in a full hotel

Countable sets Theorem. The set of rational numbers is countable. Counting follows the direction of the arrows, and you cover all real numbers

Countable sets Theorem. The set of real numbers is not countable. (See pp of your textbook) Proof by contradiction. Consider the set of real numbers between 0 and 1 and list them as (Here, r 1 is the first number, r 2 is the second number, and so on). But r is a new number different from the rest! So how can you assign a unique serial number to it? Create a new number r = 0.d 1.d 2.d 3.d 4 … where