Outline. CISC 1100/1400 Structures of Comp. Sci./Discrete Structures Chapter 1 Sets. Sets. Enumerating the elements of a set

Similar documents
Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

Sets. X. Zhang Dept. of Computer & Information Sciences Fordham University

2.1 Sets 2.2 Set Operations

CSC Discrete Math I, Spring Sets

11 Sets II Operations

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

What is Set? Set Theory. Notation. Venn Diagram

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

1.1 - Introduction to Sets

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

Discrete Mathematics

Set and Set Operations

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

Section Sets and Set Operations

COMP Logic for Computer Scientists. Lecture 17

CS100: DISCRETE STRUCTURES

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

SET DEFINITION 1 elements members

2.1 Symbols and Terminology

Introduction. Sets and the Real Number System

Chapter 3. Set Theory. 3.1 What is a Set?

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.


Today s Topics. What is a set?

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets.

Sets and set operations

Definition. A set is a collection of objects. The objects in a set are elements.

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

2 Review of Set Theory

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Sets. {1, 2, 3, Calvin}.

COUNTING AND PROBABILITY

Math 202 Test Problem Solving, Sets, and Whole Numbers 19 September, 2008

Chapter 2: Sets. Diana Pell. In the roster method: elements are listed between braces, with commas between the elements

1.2 Venn Diagrams and Partitions

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

9.5 Equivalence Relations

Set theory is a branch of mathematics that studies sets. Sets are a collection of objects.

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

Math Week in Review #5

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics

Algorithm. Algorithm Analysis. Algorithm. Algorithm. Analyzing Sorting Algorithms (Insertion Sort) Analyzing Algorithms 8/31/2017

Problem One: A Quick Algebra Review

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

Figure 1: From Left to Right, General Venn Diagrams for One, Two, and Three Sets

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

COLLEGE ALGEBRA. Intro, Sets of Real Numbers, & Set Theory

Sets. Margaret M. Fleck. 15 September 2010

A.1 Numbers, Sets and Arithmetic

MAT 090 Brian Killough s Instructor Notes Strayer University

LECTURE NOTES ON SETS

SEVENTH EDITION and EXPANDED SEVENTH EDITION

c) the set of students at your school who either are sophomores or are taking discrete mathematics

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

Slides for Faculty Oxford University Press All rights reserved.

Math Week in Review #5. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

1 Sets, Fields, and Events

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Solution: It may be helpful to list out exactly what is in each of these events:

Question7.How many proper subsets in all are there if a set contains (a) 7 elements (b) 4 elements

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

Algebraic Expressions

Fault Tree Analysis (Minimal Cutset)

The Intersection of Two Sets

2 Sets. 2.1 Notation. last edited January 26, 2016

Discrete Mathematics Lecture 4. Harper Langston New York University

Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets

Intersection of sets *

Infinity and Uncountability. Countable Countably infinite. Enumeration

4 Mathematical Data Types

Dr. Relja Vulanovic Professor of Mathematics Kent State University at Stark c 2008

The Further Mathematics Support Programme

Relational Database: The Relational Data Model; Operations on Database Relations

The University of British Columbia

Cardinality of Sets. Washington University Math Circle 10/30/2016

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

Theory Bridge Exam Example Questions Version of June 6, 2008

Counting. Rosen, Chapter 6 Walls and Mirrors, Chapter 3

following determine whether it is an element, subset or neither of A and

The Language of Sets and Functions

Counting: Basics. Rosen, Chapter 6.1

Figure 1.1: This is an illustration of a generic set and its elements.

Binary Relations McGraw-Hill Education

Fundamental Mathematical Concepts Math 107A. Professor T. D. Hamilton

What is a Set? Set Theory. Set Notation. Standard Sets. Standard Sets. Part 1.1. Organizing Information

Section 6.3: Further Rules for Counting Sets

Pre-Calc Unit 1 Lesson 1

4.4 Problems and Solutions (last update 12 February 2018)

Summary. Boolean Addition

Objectives/Outcomes. Introduction: If we have a set "collection" of fruits : Banana, Apple and Grapes.

11,23,35,47 B) 1 is a multiple of 12

Power Set of a set and Relations

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Sets and set operations. Lecture 5 ICOM 4075

Relational terminology. Databases - Sets & Relations. Sets. Membership

Transcription:

Outline CISC 1100/1400 Structures of Comp. Sci./Discrete Structures Chapter 1 Sets rthur G. Werschulz Fordham University Department of Computer and Information Sciences Copyright rthur G. Werschulz, 2017. ll rights reserved. asic definitions Naming and describing sets Comparison relations on sets Set operations Principle of Inclusion/Exclusion Summer, 2017 1 / 31 2 / 31 Sets Set: a collection of objects (the members or elements of the set) Set-lister notation: curly braces around a list of the elements {a,b,c,d,e,f} {rizona,california,massachusetts,42,47} set may contain other sets as elements: { } 1,2,{1,2} Enumerating the elements of a set Order doesn t matter {1,2,3} = {3,1,2} Repetitions don t count The empty set = {} contains no elements Can use variables (usually upper case letters) to denote sets C = {b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z} {a,b,b} = {a,b} (better yet: don t repeat items in a listing of elements) Universal set (generally denoted U): contains all elements we might ever consider (only consider what matters) 3 / 31 4 / 31

Element notation Some well-known sets If is a set, then x means x is an element of x means x is not an element of So e {a,e,i,o,u} f {a,e,i,o,u} Pretty much standard notations: = {0,1,2,3,4,5,...}: the set of natural numbers (non-negative integers). = {... 3, 2, 1,0,1,2,...}: the set of all integers. : the set of all rational numbers (fractions). : the set of all real numbers. Less standard (but useful) notations: + is the set of positive integers. is the set of negative integers. 0 is the same as. >7 is the set of all real numbers greater than seven. 5 / 31 6 / 31 Set builder notation Set builder notation (cont d) Rather than listing all the elements = {0,1,2,3,4,5,...} (inconvenient or essentially impossible), describe sets via a property = {x : p(x) is true} Examples: = {x x and x 0} = {x : x and x 0} = {x x 0} = {x : x 0} More examples: {x : 2x = 7} = {3.5} {x : 2x = 7} = {2x x } = {..., 4, 2,0,2,4,...} {x : 1 3x } = {0,3,6,9,...} {x 0 : x 2 = 2} = { 2} {x 0 : x 2 = 2} = 7 / 31 8 / 31

Comparison relations on sets is a subset of (written ) if each element of is also an element of. {1,3,5} {1,2,3,4,5} {1,2,3,4,5} {1,2,3,4,5} {1,3,6} {1,2,3,4,5} for any set for any set is a proper subset of (written ) if and. {1,3,5} {1,2,3,4,5} {1,2,3,4,5} {1,2,3,4,5} vs. is somewhat like < vs. Element vs. subset means is an element of means is a subset of Examples: means if x then x = {purple, blue, orange, red} and = {blue}. Fill in the missing symbol from the set {,,,,,=, } to correctly complete each of the following statements:,,, blue,, green,,,,= {blue,purple},,,, 9 / 31 10 / 31 Venn Diagram Venn Diagram (cont d) Diagram for visualizing sets and set operations C C For example, might have When necessary, indicate universal set via rectangle surrounding the set circles. = {Fordham students who ve taken CISC 1100} = {Fordham students who ve taken CISC 1600} C = {Fordham students who ve taken ECON 1100} 11 / 31 12 / 31

Set operations: Cardinality Set operations: Union Set of all elements belonging to either of two given sets: The number of elements in a set is called its cardinality. We denote the cardinality of S by S. = {a,b,c,d,e,z}. = 6. {a,e,i,o,u} = 5. = 0. {a,{b,c},d,{e,f,g},h} = 5. = {x : x or x } 13 / 31 14 / 31 Set operations: Union (examples) = {1,2,3,4,5} = {0,2,4,6,8} C = {0,5,10,15} = {0,1,2,3,4,5,6,8} = {0,1,2,3,4,5,6,8} C = {0,2,4,5,6,8,10,15} ( ) C = {0,1,2,3,4,5,6,8,10,15} L = {e,g,b,d,f} S = {f,a,c,e} L S = {a,b,c,d,e,f,g} Set operations: Intersection Set of all elements belonging to both of two given sets: = {x : x and x } Note: We say that two sets are disjoint if their intersection is empty. 15 / 31 16 / 31

Set operations: Intersection (examples) = {1,2,3,4,5} = {0,2,4,6,8} C = {0,5,10,15} = {2,4} = {2,4} C = {0} ( ) C = L = {e,g,b,d,f} S = {f,a,c,e} L S = {e,f} Set operations: Difference Set of all elements belonging to one set, but not another: = {x : x and x } Note that = 17 / 31 18 / 31 Set operations: Difference (examples) = {1,2,3,4,5} = {0,2,4,6,8} C = {0,5,10,15} = {1,3,5} = {0,6,8} C = {2,4,6,8} C = {5,10,15} ( ) ( ) = (re you surprised by this?) Set operations: Complement Set of all elements (of the universal set) that do not belong to a given set: = U. Venn diagrams dealing with complements generally use a surrounding rectangle to indicate the universal set U: If U and are finite sets, then = U = U. 19 / 31 20 / 31

Set operations: Complement (examples) U = {red, orange, yellow, green, blue, indigo, violet} P = {red,green,blue} P = {orange,yellow,indigo,violet} E and O respectively denote the sets of even and odd integers. Suppose that our universal set is. E = O O = E Set operations: Power Set Set of all subsets of a given set P() if and only if P( ) = { } P({a}) = {,{a} } P({a,b}) = {,{a},{b},{a,b} } P({a,b,c}) = {,{a},{b},{c},{a,b},{a,c},{b,c},{a,b,c} } How many elements does P() have? i.e., P() = 2, if = n, then P() = 2 n. 21 / 31 22 / 31 Some basic laws of set theory Some basic laws of set theory (cont d) Here, U is a universal set, with,,c,s U. Name Law Identity S U = S Identity S = S Complement S S = Complement S S = U Double Complement (S ) = S Idempotent S S = S Idempotent S S = S Commutative = Commutative = Once again, U is a universal set, with,,c,s U. Name Law ssociative ( ) C = ( C) ssociative ( ) C = ( C) Distributive ( C) = ( ) ( C) Distributive ( C) = ( ) ( C) DeMorgan ( ) = DeMorgan ( ) = Equality = if and only if and Transitive if and C, then C 23 / 31 24 / 31

Set operations: Cartesian Product Ordered pair: Pair of items, in which order matters. (1,2)... not the same thing as (2,1) (red, blue) (1, green) Cartesian product (also known as set product): Set of all ordered pairs from two given sets, i.e., = {(x,y) x and y } Set operations: Cartesian Product (examples) = {1,2,3} = {a,b,c} C = { 1,5},... = {(1,a),(1,b),(1,c),(2,a),(2,b),(2,c),(3,a),(3,b),(3,c)} = {(a,1),(a,2),(a,3),(b,1),(b,2),(b,3),(c,1),(c,2),(c,3)} C = {( 1,1),( 1,2),( 1,3),(5,1),(5,2),(5,3)} C = {(a, 1),(a,5),(b, 1),(b,5),(c, 1),(c,5)} Note the following: (unless = ) = (that s why it s called product ). 25 / 31 26 / 31 Principle of Inclusion/Exclusion Principle of Inclusion/Exclusion Suppose you run a fast-food restaurant. fter doing a survey, you find that 25 people like ketchup on their hamburgers, 35 people like pickles on their hamburgers, 15 people like both ketchup and pickles on their hamburgers. How many people like either ketchup or pickles (maybe both) on their hamburgers? K = {people who like ketchup} and P = {people who like pickles}. K = 25 P = 35 K P = 15. K P Since we don t want to count K P twice, we have K P = K + P K P = 25 + 35 15 = 45. 27 / 31 28 / 31

Set operations: cardinalities of union and intersection Principle of Inclusion/Exclusion For three sets: Inclusion/exclusion principle: = + C If and are disjoint, then = + See the example that animates this concept. What about three sets (hamburger eaters who like ketchup, pickles, and tomatoes)? 29 / 31 C = + + C C C + C. 30 / 31 Principle of Inclusion/Exclusion K, P, T represent the sets of people who like ketchup, pickles, and tomatoes on their hamburgers. Suppose that K = 20 P = 30 T = 45 K P = 10 K T = 12 P T = 13 K P T = 8. K P T = K + P + T K P K T P T + K P T = 20 + 30 + 45 10 12 13 + 8 = 68 31 / 31