CSE15 Discrete Mathematics 02/15/17

Slides:



Advertisements
Similar presentations
Union Definition: The union of sets A and B, denoted by A B, contains those elements that are in A or B or both: Example: { 1, 2, 3} {3, 4, 5} = { 1,
Advertisements

More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1 Section 1.7 Set Operations. 2 Union The union of 2 sets A and B is the set containing elements found either in A, or in B, or in both The denotation.
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
CSE115/ENGR160 Discrete Mathematics 02/22/11 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/21/12
Sets 1.
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/14/12 Ming-Hsuan Yang UC Merced 1.
modified from UCI ICS/Math 6D, Fall Sets+Functions-1 Sets “Set”=Unordered collection of Objects “Set Elements”
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,
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
CS 2210 (22C:019) Discrete Structures Sets and Functions Spring 2015 Sukumar Ghosh.
Functions, Sequences, and Sums
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.
ICS 253: Discrete Structures I
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.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
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.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
2. 1 Basic structures Sets Set Operations Functions Sequences & Sums
Basic Structures: Functions Muhammad Arief download dari
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.
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.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
Chapter 2 With Question/Answer Animations. Section 2.1.
Basic Structures: Sets, Functions, Sequences, and Sums.
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.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
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.
Set Operations Section 2.2.
Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science.
Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science.
August 2003 CIS102/LECTURE 9/FKS 1 Mathematics for Computing Lecture 9 LOGIC Chapter 3.
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.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
CPCS 222 Discrete Structures I
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Set Operators Goals Show how set identities are established
ICS 253: Discrete Structures I
CSE15 Discrete Mathematics 02/13/17
Functions Section 2.3.
Discrete Structures – CNS 2300
CSE15 Discrete Mathematics 01/23/17
Sets Section 2.1.
CS 2210:0001 Discrete Structures Sets and Functions
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Exercises Show that (P  Q)  (P)  (Q)
Review 2.
Discrete Math (2) Haiming Chen Associate Professor, PhD
CS100: Discrete structures
CSE15 Discrete Mathematics 02/27/17
Set Operations Section 2.2.
CS100: Discrete structures
Functions.
Discrete Mathematics CS 2610
ICS 253: Discrete Structures I
Applied Discrete Mathematics Week 3: Sets
Functions Rosen 2.3, 2.5 f( ) = A B Lecture 5: Oct 1, 2.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

CSE15 Discrete Mathematics 02/15/17 Ming-Hsuan Yang UC Merced

2.2 Set operations Union: the set that contains those elements that are either in A or in B, or in both A={1,3,5}, B={1,2,3}, A⋃B={1,2,3,5}

Intersection Intersection: the set containing the elements in both A and B A={1,3,5}, B={1,2,3}, A⋂B={1,3}

Disjoint set Two sets are disjoint if their intersection is ∅ A={1,3}, B={2,4}, A and B are disjoint Cardinality:

Difference and complement A-B: the set containing those elements in A but not in B A={1,3,5},B={1,2,3}, A-B={5}

Complement Once the universal set U is specified, the complement of a set can be defined Complement of A: A-B is also called the complement of B with respect to A

Example A is the set of positive integers > 10 and the universal set is the set of all positive integers, then A-B is also called the complement of B with respect to A

Set identities

Set identities Identity laws Domination laws Idempotent laws Complementation law Continued on next slide 

Set identities Commutative laws Associative laws Distributive laws Continued on next slide 

Set identities De Morgan’s laws Absorption laws Complement laws

Example Prove Will show that (→): Suppose that , by definition of complement and use De Morgan’s law By definition of complement By definition of union

Example (←): Suppose that By definition of union By definition of complement Thus By De Morgan’s law: By definition of complement,

Builder notation Prove it with builder notation

Example Prove (→): Suppose that then and . By definition of union, it follows that , and or . Consequently, and or and By definition of intersection, it follows or By definition of union,

Example (←): Suppose that By definition of union, or By definition of intersection, and , or and From this, we see , and or By definition of union, and By definition of intersection,

Membership table Use a membership table to show A∩(B∪C)=(A∩B)∪(A∩C)

Example Show that

Generalized union and intersection A={0,2,4,6,8}, B={0,1,2,3,4}, C={0,3,6,9} A⋃B⋃C={0,1,2,3,4,6,8,9} A⋂B⋂C={0}

General case Union: Intersection Intersection: Suppose Ai={1, 2, 3,…, i} for i=1,2,3,…

Computer representation of sets A={1,3,5,7,9} (odd integer ≤10),B={1,2,3,4,5} (integer ≤5) Represent A and B as 1010101010, and 1111100000 Complement of A: 0101010101 A⋂B: 1010101010˄1111100000=1010100000 which corresponds to {1,3,5}

2.3 Functions Assign each element of a set to a particular element of a second set

Function A function f from A to B, f:A→B, is an assignment of exactly one element of B to each element of A f(a)=b if b is the unique element of B assigned by the function f to the element a Sometimes also called mapping or transformation

Function and relation f:A→B can be defined in terms of a relation from A to B Recall a relation from A to B is just a subset of A x B A relation from A to B that contains one, and only one, ordered pair (a,b) for every element a ∈ A, defines a function f from A to B f(a)=b where (a,b) is the unique ordered pair in the relation

Domain and range If f is a function from A to B A is the domain of f B is the codomain of f f(a)=b, b is the image of a and a is preimage of b Range of f: set of all images of element of A f maps A to B

Function Specify a function by Two functions are equal if they have Domain Codomain Mapping of elements Two functions are equal if they have Same domain, codomain, mapping of elements

Example G: function that assigns a grade to a student, e.g., G(Adams)=A Domain of G: {Adams, Chou, Goodfriend, Rodriguez, Stevens} Codomain of G: {A, B, C, D, F} Range of G is: {A, B, C, F}

Example Let R be the relation consisting of (Abdul, 22), (Brenda, 24), (Carla, 21), (Desire, 22), (Eddie, 24) and (Felicia, 22) f: f(Abdul)=22, f(Brenda)=24, f(Carla)=21, f(Desire)=22, f(Eddie)=24, and f(Felicia)=22 Domain: {Abdul, Brenda, Carla, Desire, Eddie, Felicia} Codomain: set of positive integers Range: {21, 22, 24}

Example f: assigns the last two bits of a bit string of length 2 or greater to that string, e.g., f(11010)=10 Domain: all bit strings of length 2 or greater Codomain: {00, 01, 10, 11} Range: {00, 01, 10, 11}

Example f: Z → Z, assigns the square of an integer to its integer, f(x)=x2 Domain: the set of all integers Codomain: set of all integers Range: all integers that are perfect squares, i.e., {0, 1, 4, 9, …}

Functions Two real-valued functions with the same domain can be added and multiplied Let f1 and f2 be functions from A to R, then f1+f2, and f1f2 are also functions from A to R defined by (f1+f2)(x)= f1(x)+f2(x) (f1f2)(x)= f1(x) f2(x) Note that the functions f1+f2 and f1f2 at x are defined in terms f1 and f2 at x

Example f1(x) =x2 and f2(x)= x-x2 (f1+f2)(x)= f1(x) +f2(x)= x2 + x-x2 =x (f1f2)(x)= f1(x) f2(x)= x2 (x-x2)=x3-x4

Function and subset When f is a function from A to B (f:A→B), the image of a subset of A can also be defined Let S be a subset of A, the image of S under function f is the subset of B that consists of the images of the elements of S Denote the image of S by f(S) f(S) denotes a set, not the value of function f