Sets 1.

Slides:



Advertisements
Similar presentations
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,
Advertisements

Prof. Johnnie Baker Module Basic Structures: Sets
Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Instructor: Hayk Melikya
2.1 Sets ‒Sets ‒Common Universal Sets ‒Subsets 2.2 Set Operations 2.3 Functions 2.4 Sequences and Summations 1.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Section 1.6: Sets Sets are the most basic of discrete structures and also the most general. Several of the discrete structures we will study are built.
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.
Sets DISCRETE STRUCTURE ABDUL BASIT TAHIR, KAMRAN ALI, FAIZAN ILLAHI, NOMAN AHMAD, ARSALAN MUBASHIR.
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.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Chapter 2 The Basic Concepts of Set Theory
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/10/11 Ming-Hsuan Yang UC Merced 1.
Mathematics.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Set Theory A B C.
Sets.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
ICS 253: Discrete Structures I
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Copyright  The McGraw-Hill Companies, Inc. Permission required for reproduction.
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.
CS201: Data Structures and Discrete Mathematics I
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
1. Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element of A” A = {a 1, a 2,
CompSci 102 Discrete Math for Computer Science
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
ELEMENTARY SET THEORY.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
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.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Discrete Mathematics Lecture # 10. Set Theory  A well defined collection of {distinct} objects is called a set.  The objects are called the elements.
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.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Wed, Mar 8, 2006.
ITD1111 Discrete Mathematics & Statistics STDTLP
Discrete Mathematics Set.
Chapter 2 With Question/Answer Animations. Section 2.1.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Mon, Feb 21, 2005.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Section 2.1. Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the.
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.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
CPCS 222 Discrete Structures I
Set. Outline Universal Set Venn Diagram Operations on Sets.
CSE15 Discrete Mathematics 02/13/17
Set Definition: A set is unordered collection of objects.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Sets Section 2.1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CS100: Discrete structures
Set Theory A B C.
2.1 Sets Dr. Halimah Alshehri.
Sets. EXAMPLE 1 The set O of odd positive integers less than 10 can be expressed by O = { l, 3, 5, 7, 9}. * This way of describing a set is known as.
Sets, Sequences, and Summations
Discrete Mathematics CS 2610
The aim of education is to teach students how to think rather than what to think. Sets The set is the fundamental discrete structure on which all other.
2.1 – Symbols and Terminology
Lecture Sets 2.2 Set Operations.
Presentation transcript:

Sets 1

Sets Informally: A set is a collection of (mathematical) objects, with the collection treated as a single mathematical object. Examples: real numbers,  complex numbers, C integers,  All students in our class

Defining Sets Sets can be defined directly: e.g. {1,2,4,8,16,32,…}, {CSC1130,CSC2110,…} Order, number of occurence are not important. e.g. {A,B,C} = {C,B,A} = {A,A,B,C,B} A set can be an element of another set. {1,{2},{3,{4}}}

Defining Sets by Predicates The set of elements, x, in A such that P(x) is true. The set of prime numbers:

Commonly Used 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 Q = {p/q | p Z, q Z, and q ≠ 0}, the set of rational numbers R, the set of real numbers

Special Sets Empty Set (null set): a set that has no elements, denoted by ф or {}. Example: The set of all positive integers that are greater than their squares is an empty set. Singleton set: a set with one element Compare: ф and {ф} Ф: an empty set. Think of this as an empty folder {ф}: a set with one element. The element is an empty set. Think of this as an folder with an empty folder in it.

Venn Diagrams Represent sets graphically The universal set U, which contains all the objects under consideration, is represented by a rectangle. The set varies depending on which objects are of interest. Inside the rectangle, circles or other geometrical figures are used to represent sets. Sometimes points are used to represent the particular elements of the set. U a u V e o i 7

Membership {7, “Albert”, /2, T} x is an element of A x is in A Examples: /2  {7, “Albert”,/2, T} /3  {7, “Albert”,/2, T} 14/2  {7, “Albert”,/2, T} 7  2/3  

Containment A is a subset of B A is contained in B Every element of A is also an element of B. Examples: R, {3}{5,7,3}   every set, A  A A is a proper subset of B

Set Equivalence Example: Are sets {1, 3, 5} and {3, 5,1} equal? Two sets are equal if and only if they have the same elements. That is, if A and B are sets, then A and B are equal if and only if We write A = B if A and B are equal sets. Example: Are sets {1, 3, 5} and {3, 5,1} equal? Are sets {1, 3, 3, 3, 5, 5, 5, 5} and {1, 3, 5} equal?

Basic Operations on Sets union:

Basic Operations on Sets intersection:

Basic Operations on Sets difference:

Basic Operations on Sets complement:

Cardinality Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer, we say that S is a finite set and that n is the cardinality of S. The cardinality of S is denoted by |S|. Example: Let A be the set of odd positive integers less than 10. Then |A| = 5. Let S be the set of letters in the English alphabet. Then |A| = 26. Null set has no elements, | ф | = 0. 15

Example: The set of positive integers is infinite. Infinite Sets A set is said to be infinite if it is not finite. Example: The set of positive integers is infinite. 16

Cardinality Finding the cardinality of |A U B|: |A U B| = |A| + |B| - |A ∩ B | Example: A = {1,3,5,7,9}, B = {5,7,9,11} = 5 + 4 – 3 = 6 17

Partitions of Sets Two sets are disjoint if their intersection is empty. A collection of nonempty sets {A1, A2, …, An} is a partition of a set A if and only if A1, A2, …, An are mutually disjoint.

Power Sets power set:

Cartesian Products Sets are unordered, a different structure is needed to represent an ordered collections – ordered n-tuples. Two ordered n-tuples are equal if and only if each corresponding pair of their elements is equal. (a1, a2,…, an) = (b1, b2,…, bn) if and only if ai = bi for i = 1, 2, …, n The ordered n-tuple (a1, a2,…, an) is the ordered collection that has a1 as its first element, a2 as its second element, …, and an as its nth element. 20

Cartesian Products Let A and B be sets. The Cartesian product of A and B, denoted by A × B, is the set of all ordered pairs (a, b), where a A and b B. Hence, A × B = {(a,b)| a A Λ b B}. Example: What is the Cartesian product of A = {1,2} and B = {a,b,c}? Solution: A × B = {(1,a), (1,b), (1,c), (2,a), (2,b), (2,c)} Cartesian product of A × B and B × A are not equal, unless A = ф or B = ф (so that A × B = ф ) or A = B. B × A = {(a,1),(a,2),(b,1),(b,2),(c,1),(c,2)} 21

Cartesian products The Cartesian product of sets A1, A2, …, An, denoted by A1 × A2 × … × An is the set of ordered n-tuples (a1, a2, …, an), where ai belongs to Ai for i = 1,2, …, n. In other words, A1 × A2 × … × An = {(a1, a2, …, an) | ai Ai for i = 1,2, …, n}. Example: What is the Cartesian product of A × B × C where A= {0,1}, B = {1,2}, and C = {0,1,2}? Solution: A × B × C= {(0,1,0), (0,1,1), (0,1,2), (0,2,0), (0,2,1), (0,2,2), (1,1,0), (1,1,1), (1,1,2), (1,2,0), (1,2,1), (1,2,2)} 22

Set Identities Distributive Law:

Set Identities De Morgan’s Law:

Proving Set Identities

Proving Set Identities

Computer Representation of Sets Represent a subset A of U with the bit string of length n, where the ith bit in the string is 1 if ai belongs to A and is 0 if ai does not belong to A. Example: Let U = {1,2,3,4,5,6,7,8,9,10}, and the ordering of elements of U has the elements in increasing order; that is ai = i. What bit string represents the subset of all odd integers in U? Solution: 10 1010 1010 What bit string represents the subset of all even integers in U? Solution: 01 010 10101 What bit string represents the subset of all integers not exceeding 5 in U? Solution: 11 1110 0000 What bit string represents the complement of the set {1,3,5,7,9}? Solution: 01 0101 0101 27

Logic and Bit Operations Computers represent information using bits. A bit is a symbol with two possible values, 0 and 1. By convention, 1 represents T (true) and 0 represents F (false). A variable is called a Boolean variable if its value is either true or false. Bit operation – replace true by 1 and false by 0 in logical operations. Table for the Bit Operators OR, AND, and XOR. x y x ν y x Λ y x y 1 28

Logic and Bit Operations DEFINITION 7 A bit string is a sequence of zero or more bits. The length of this string is the number of bits in the string. Example: Find the bitwise OR, bitwise AND, and bitwise XOR of the bit string 01 1011 0110 and 11 0001 1101. Solution: 01 1011 0110 11 0001 1101 ------------------- 11 1011 1111 bitwise OR 01 0001 0100 bitwise AND 10 1010 1011 bitwise XOR 29

Set Operations The bit string for the union is the bitwise OR of the bit string for the two sets. The bit string for the intersection is the bitwise AND of the bit strings for the two sets. Example: The bit strings for the sets {1,2,3,4,5} and {1,3,5,7,9} are 11 1110 0000 and 10 1010 1010, respectively. Use bit strings to find the union and intersection of these sets. Solution: Union: 11 1110 0000 V 10 1010 1010 = 11 1110 1010, {1,2,3,4,5,7,9} Intersection: 11 1110 0000 Λ 10 1010 1010 = 10 1010 0000, {1,3,5} 30

Russell’s Paradox so There is a male barber who shaves all those men, and only those men, who do not shave themselves. Does the barber shave himself?