Set, Combinatorics, Probability &
                     Number Theory



           Mathematical Structures
            for Computer Science
                   Chapter 3	





Copyright © 2006 W.H. Freeman & Co.   MSCS Slides   Set, Combinatorics, Probability & Number Theory
Set theory
     ●        Sets: Powerful tool in computer science to solve real world
              problems.	

     ●        A set is a collection of distinct objects called elements.	

     ●        Traditionally, sets are represented by capital letters, and
              elements by lower case letters.	

     ●        The symbol ∈ means “belongs to” and is used to represent the
              fact that an element belongs to a particular set. Hence, a∈A
              means that element a belongs to set A.	

     ●        b∉A implies that b is not an element of A.	

     ●        Braces {} are used to indicate a set.	


     ●        A = {2, 4, 6, 8, 10} 	

       	

3∉A and 2∈A	





Section 3.1                                      Sets                         1
Set theory
     ●        Ordering is not imposed on the set elements and listing elements
              twice or more is redundant.	

     ●        Two sets are equal if and only if they contain the same elements.	

     ●        Hence, A = B means 	

          	

      	

(∀x)[(x ∈ A → x ∈ B) Λ (x ∈ B → x ∈ A)] 	

     ●        Finite and infinite set: described by number of elements in a set	

     ●        Members of infinite sets cannot be listed, but a pattern for listing
              elements could be indicated.	

     ●         e.g. S = {x | x is a positive even integer} or using predicate
              notation.	

          	

S = {x | P(x)} means (∀x)[(x ∈ S → P(x)) Λ (P(x)→ x ∈ S)]
              where P is the unary predicate.	

     ●        Hence, every element of S has the property P and everything
              that has a property P is an element of S.	


Section 3.1                                   Sets                                   2
Set Theory Examples

     ●        Describe each of the following sets by listing the
              elements:	

     ●        {x | x is a month with exactly thirty days}	

              ■    {April, June, September, November}	

     ●        {x | x is an integer and 4 < x < 9}	

              ■    {5, 6, 7, 8}	

     ●        What is the predicate for each of the following sets?	

     ●        {1, 4, 9, 16}	

              ■    {x | x is one of the first four perfect squares}	

     ●        {2, 3, 5, 7, 11, 13, 17, ….}	

              ■    {x | x is a prime number}	



Section 3.1                                       Sets                   3
Set Theory Basics
     ●        A set that has no members is called a null or empty set and is
              represented by ∅ or {}.	

               ■    Note that ∅ is different from {∅}. The latter is a set with 1
                    element, which is the empty set.	

     ●        Some notations used for convenience of defining sets	

               ■    N = set of all nonnegative integers (note that 0 ∈ N)	

               ■    Z = set of all integers	

               ■    Q = set of all rational numbers	

               ■    R = set of all real numbers	

               ■    C = set of all complex numbers	

     ●        Using the above notations and predicate symbols, one can
              describe sets quite easily	

     ●        A = {x | (∃y)[(y∈ {0,1,2}) and (x = y2)]}	

               ■    Hence, A = {0,1, 4}	

     ●        A = {x | x ∈ N and (∀y)(y ∈ {2, 3, 4, 5} → x ≥ y)}	

     ●        B = {x | (∃y)(∃z)(y ∈ {1,2} and z ∈ {2,3} and x = z – y) }	


Section 3.1                                           Sets                          4
Open and closed interval
          	

      	

     	

     	

{x ∈ R | -2 < x < 3}	

     ●        Denotes the set containing all real numbers between -2 and 3.
              This is an open interval, meaning that the endpoints -2 and 3 are
              not included. 	

                ■    By all real numbers, we mean everything such as 1.05, -3/4, and
                     every other real number within that interval.	


          	

     	

      	

      	

{x ∈ R | -2 ≤ x ≤ 3}	

     ●        Similar set but on a closed interval 	

                ■    It includes all the numbers in the open interval described above,
                     plus the endpoints.	





Section 3.1                                           Sets                               5
Relationship between Sets
     ●        Say S is the set of all people, M is the set of all male humans,
              and C is the set of all computer science students.	

     ●        M and C are both subsets of S, because all elements of M and C
              are also elements of S.	

     ●        M is not a subset of C, however, since there are elements of M
              that are not in C (specifically, all males who are not studying
              computer science). 	

     ●        For sets S and M, M is a subset of S if, and only if, every
              element in M is also an element of S.	

               ■    Symbolically:        M ⊆ S ⇔ (∀x), if x ∈ M, then x ∈ S.	

     ●        If M ⊆ S and M ≠ S, then there is at least one element of S that
              is not an element of M, then M is a proper subset of S.	

               ■    Symbolically, denoted by M ⊂ S 	





Section 3.1                                         Sets                          6
Relationship between Sets
     ●        A superset is the opposite of subset. If M is a subset of
              S, then S is a superset of M. 	

              ■    Symbolically, denoted S ⊆ M. 	

     ●        Likewise, if M is a proper subset of S, then S is a
              proper superset of M.	

              ■    Symbolically, denoted S ⊃ M.	

     ●        Cardinality of a set is simply the number of elements
              within the set.	

     ●        The cardinality of S is denoted by |S|. 	

     ●        By the above definition of subset, it is clear that set M
              must have fewer members than S, which yields the
              following symbolic representation:	

                                 S ⊃ M ⇒ |M| < |S|	


Section 3.1                                   Sets                        7
Exercise


     ●        A = {x | x ∈ N and x ≥ 5} ⇒ {5, 6, 7, 8, 9, …… }	

     ●        B = {10, 12, 16, 20}	

     ●        C = {x | (∃y)(y ∈ N and x = 2y)} ⇒ {0, 2, 4, 6, 8, 10, …….}	


      ●        What statements are true?	


      B⊆C √                	

      	

       	

            	

B ⊂ A 	

       	

 √	

      A ⊆ C 	

            	

      	

       	

            	

26 ∈ C 	

      	

 √	

      {11, 12, 13} ⊆ A              	

 √     	

            	

{11, 12, 13} ⊂ C	

      {12} ∈ B             	

      	

       	

            	

{12} ⊆ B        	

 √	

      {x | x ∈ N and x < 20}⊄ B               	

 √          	

5 ⊆ A	

      {∅} ⊆ B              	

      	

       	

            	

∅ ∈ A 	

       	

 √	


Section 3.1                                           Sets                                 8
Set of Sets
     ●        For the following sets, prove A ⊂ B.	

     ●        A = { x | x ∈ R such that x2 – 4x + 3 = 0}	

               ■    A = {1, 3}	

     ●        B = { x | x ∈ N and 1≤ x ≤ 4}	

               ■    B = {1, 2, 3, 4}	

     ●        All elements of A exist in B, hence A ⊂ B.	


     ●        From every set, many subsets can be generated. A set whose
              elements are all such subsets is called the power set.	


     ●        For a set S, ℘(S) is termed as the power set.	

     ●        For a set S = {1, 2, 3} ; ℘(S) = {∅ ,{1}, {2}, {3}, {1,2}, {1,3},
              {2,3}, {1,2,3}}	

     ●        For a set with n elements, the power set has 2n elements.	



Section 3.1                                      Sets                             9
Set operations
     ●        Binary and unary operators	

               ■    Binary acts on two elements, say x-y or y-x.	

               ■    Unary acts on a single element, say negation of an element x is –x.	

               ■    Example: +, - and * are all binary operators on Z.	

     ●        An ordered pair of elements is written as (x,y) and is different
              from (y,x).	

               ■       Two ordered pairs (a,b) and (c,d) are equal if and only if a = c and 	

                    	

b = d.	

               ■       If S = {2,3}, the ordered pairs of this set are (2,2), (2,3), (3,2), (3,3).	

     ●        Binary operation (represented by °) on a set defined as follows: 	

     ●        If for every ordered pair (x,y) of elements of S, x ° y exists, and is
              unique, and is a member of S. 	

               ■    The fact that x ° y exists, and is unique is the same as saying that the
                    binary operation ° is well-defined. 	

               ■    The fact that x ° y always belongs to S means that S is closed under
                    the operation °.	

               ■    The operator ° is just a placeholder for a real operator like +, -, * etc.	


Section 3.1                                               Sets                                      10
Binary or unary operations

     ●        Which of the following are neither binary nor unary
              operations on the given sets? Why?	


     ●        x ° y = x/y; 	

S = set of all positive integers	

               ■    S is not closed under division (x/0 does not exist).	

     ●        x ° y = x/y; 	

S = set of all positive rational numbers	

     ●        x ° y = xy; 	

S = R	

               ■    00 is not defined	

     ●        x ° y = maximum of x and y; 	

S = N	

     ●        x ° y = x + y;  	

S = set of Fibonacci numbers	

               ■    S is not closed under addition since, 1+3 = 4 and 4 is
                    not a Fibonacci number	


Section 3.1                                      Sets                         11
Operations on Sets
     ●        New sets can be formed in a variety of ways, and can be
              described using both set builder notation and Venn diagrams. 	

     ●        Let A, B ∈ ℘(S). The union of set A and B, denoted by A ∪ B
              is the set that contains all elements in either set A or set B, i.e.
              A ∪ B = {x | x ∈ A or x ∈ B}. The intersection of set A and B,
              denoted by A ∩ B contain all elements that are common to both
              sets i.e. A ∩ B = {x | x ∈ A and x ∈ B}	





     ●       If A = { 1,3,5,7,9} and B = {3,7,9,10,15} ; 	

          	

A ∪ B = {1, 3, 5, 7, 9, 10, 15} and A ∩ B = {3, 7, 9}.	


Section 3.1                                      Sets                                12
Disjoint, Universal and Difference Sets
     ●        Given set A and set B, if A ∪ B = ∅, then A and B are disjoint
              sets. In other words, there are no elements in A that are also in
              B.	




     ●        For a set A ∈ ℘(S), the complement of set A, denoted as ~A or
              Aʹ′, is the set of all elements that are not in A.	

                      Aʹ′ = {x | x ∈ S and x ∉ A }	


     ●       The difference of A-B is the set of elements in A that are not in
             B. This is also known as the complement of B relative to A.	

          	

A - B = {x | x ∈ A and x ∉ B }	

          	

Note A – B = A ∩ Bʹ′ ≠ B – A 	



Section 3.1                                     Sets                              13
Class Exercise
     ●        Let 	

A = {1, 2, 3, 5, 10}	

          	

     	

B = {2, 4, 7, 8, 9}	

          	

     	

C = {5, 8, 10}	

          	

be subsets of S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find	

     ●        A ∪ B	

                      {1, 2, 3, 4, 5, 7, 8, 9, 10}	

     ●        A – C	

                      {1, 2, 3}	

     ●         Bʹ′ ∩ (A ∪ C)	

                     {1, 3, 5, 10}	

     ●         A ∩ B ∩ C	

                     {∅}	

     ●        (A ∪ B) ∩ Cʹ′	

                    {1, 2, 3, 4, 7, 9}	



Section 3.1                                      Sets                     14
Cartesian Product
     ●        If A and B are subsets of S, then the cartesian product (cross
              product) of A and B denoted symbolically by A × B is defined by	

          	

       	

      	

A × B = {(x,y) | x ∈ A and y ∈ B }	

     ●        The Cartesian product of 2 sets is the set of all combinations of ordered
              pairs that can be produced from the elements of both sets. Example,
              given 2 sets A and B, where A = {a, b, c} and B = {1, 2, 3}, the
              Cartesian product of A and B can be represented as	

                 A × B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3), (c, 1), (c, 2), (c, 3)}	

     ●        Is A × B = B × A?	

     ●        Cross-product of a set with itself is represented as A × A or A2	

     ●        An ordered n-tuple is a set of elements that is defined by the order in
              that the elements appear, and by the number of times which distinct
              elements appear. 	

               ■    Example, the coordinates of points on a graph are ordered pairs, where the
                    first value must be the x coordinate, and the second value must be the y
                    coordinate.	

     ●        An represents the set of all n-tuples (x1, x2, …, xn) of elements of A.	



Section 3.1                                             Sets                                           15
Basic Set Identities
     ●        Given sets A, B, and C, and a universal set S and a null/empty
              set ∅, the following properties hold:	


     ●        Commutative property (cp)	

                 	

A ∪ B = B ∪ A     	

       	

          	

A ∩ B = B ∩ A 	

	

     ●        Associative property (ap)	

                 	

A ∪ (B ∪ C) = (A ∪ B) ∪ C                	

A ∩ (B ∩ C) = (A ∩ B) ∩ C 	

     ●        Distributive properties (dp)	

                 	

A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) 	

	

                 	

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) 	

	

     ●        Identity properties 	

(ip)	

                 	

∅ ∪ A = A ∪ ∅ = A           	

          	

S ∩ A = A ∩ S = A          	

	

     ●        Complement properties (comp)	

                 	

A ∪ Aʹ′ = S       	

       	

          	

A ∩ Aʹ′ = ∅       	

	


Section 3.1                                           Sets                                          16
More set identities
     ●        Double Complement Law	

                 	

(Aʹ′)ʹ′ = A 	

	

     ●        Idempotent Laws	

                 	

A ∪ A = A              	

   	

A ∩ A = A	

     ●        Absorption properties	

                 	

A ∪ (A ∩ B) = A 	

          	

A ∩ (A ∪ B) = A	

     ●        Alternate Set Difference Representation	

                 	

A - B = A ∩ Bʹ′	

     ●        Inclusion in Union	

                 	

A ⊆ A ∪ B              	

   	

B ⊆ A ∪ B 	

     ●        Inclusion in Intersection	

                 	

A ∩ B ⊆ A              	

   	

A ∩ B ⊆ B	

     ●        Transitive Property of Subsets 	

                 	

if A ⊆ B, and B ⊆ C, then A ⊆ C	


Section 3.1                                           Sets               17
Exercise
     ●        Use the set identities to prove	

          	

     	

[A ∪ (B ∩ C)] ∩ ([Aʹ′ ∪ (B ∩ C)] ∩ (B ∩ C)ʹ′) = ∅	


     ●        Proof:	

          	

[A ∪ (B ∩ C)] ∩ ([Aʹ′ ∪ (B ∩ C)] ∩ (B ∩ C)ʹ′) =	

          	

([A ∪ (B ∩ C)] ∩ [Aʹ′ ∪ (B ∩ C)]) ∩ (B ∩ C)ʹ′        	

using ap	

          	

 ([(B ∩ C) ∪ A] ∩ [(B ∩ C) ∪ Aʹ′]) ∩ (B ∩ C)ʹ′       	

using cp twice	

          	

 [(B ∩ C) ∪ (A ∩ Aʹ′)] ∩ (B ∩ C)ʹ′     	

           	

using dp	

          	

 [(B ∩ C) ∪ ∅] ∩ (B ∩ C)ʹ′    	

      	

           	

using comp	

          	

 (B ∩ C) ∩ (B ∩ C)ʹ′ 	

      	

      	

           	

using ip	

          	

 ∅ 	

       	

      	

     	

      	

           	

using comp	





Section 3.1                                      Sets                                    18

More Related Content

PDF
Cpsc125 Ch4 Sec4
PDF
tensor-decomposition
PDF
Optimization Approach to Nash Euilibria with Applications to Interchangeability
PDF
Introduction to Decision Making Theory
PDF
Advanced Microeconomics - Lecture Slides
PDF
Reformulation of Nash Equilibrium with an Application to Interchangeability
PDF
Equivalence relations
PDF
Polyadic integer numbers and finite (m,n) fields
Cpsc125 Ch4 Sec4
tensor-decomposition
Optimization Approach to Nash Euilibria with Applications to Interchangeability
Introduction to Decision Making Theory
Advanced Microeconomics - Lecture Slides
Reformulation of Nash Equilibrium with an Application to Interchangeability
Equivalence relations
Polyadic integer numbers and finite (m,n) fields

What's hot (20)

PPTX
Relations and functions
PPT
Xc ngwenya 201007180
PDF
Concepts of root locusplots by tarun gehlot
PDF
Matrix calculus
PPTX
Functions
PPTX
function
PPTX
CBSE Class 12 Mathematics formulas
PDF
Relations and functions
PPT
Blackbox task 2
PPTX
Unary and binary set operations
PPTX
senior seminar
PDF
Fourier series
PDF
Lattices and codes
PPSX
Types of functions 05272011
PDF
PDF
smtlecture.7
DOCX
Chapter 03-group-theory (1)
PDF
PDF
A Note on Hessen berg of Trapezoidal Fuzzy Number Matrices
PDF
The Mullineux Map and p-Regularization For Hook Partitions
Relations and functions
Xc ngwenya 201007180
Concepts of root locusplots by tarun gehlot
Matrix calculus
Functions
function
CBSE Class 12 Mathematics formulas
Relations and functions
Blackbox task 2
Unary and binary set operations
senior seminar
Fourier series
Lattices and codes
Types of functions 05272011
smtlecture.7
Chapter 03-group-theory (1)
A Note on Hessen berg of Trapezoidal Fuzzy Number Matrices
The Mullineux Map and p-Regularization For Hook Partitions
Ad

Viewers also liked (18)

PPT
Forecasting
PDF
CPSC 125 Ch 4 Sec 4
PPT
Statistics lesson 1
PDF
CPSC 125 Ch 3 Sec 2
PDF
CPSC 125 Ch 3 Sec 3
PPT
Introductory sessions
PPT
CPSC 125 Ch 1 sec 1
PPTX
Measures of central tendency
PPT
Probability+distribution
PPT
Probability distribution 2
PPT
Hypothesis
PDF
PROJECT REPORT 2(2014)TATA PROJECT
PPT
Measures of dispersion
PPT
Sampling distribution
PPTX
Binomial probability distributions ppt
PPT
Statistics lesson 1
PPT
Permutations & Combinations
PDF
So You Wanna be a Startup CTO 20170301
Forecasting
CPSC 125 Ch 4 Sec 4
Statistics lesson 1
CPSC 125 Ch 3 Sec 2
CPSC 125 Ch 3 Sec 3
Introductory sessions
CPSC 125 Ch 1 sec 1
Measures of central tendency
Probability+distribution
Probability distribution 2
Hypothesis
PROJECT REPORT 2(2014)TATA PROJECT
Measures of dispersion
Sampling distribution
Binomial probability distributions ppt
Statistics lesson 1
Permutations & Combinations
So You Wanna be a Startup CTO 20170301
Ad

Similar to CPSC 125 Ch 3 Sec 1 (20)

PDF
Digital text sets pdf
PDF
Set
 
PDF
Lecture 1 - Concept of Sets.pdf
PPTX
Discrete Structure Mathematics lecture 1
PDF
Appendix A(1).pdf
PPTX
Sets and its types-
PDF
Sets and Functions By Saleh ElShehabey
PPTX
PPTX
Explore the foundational concepts of sets in discrete mathematics
PPT
Set in discrete mathematics
PPTX
PDF
Digital text book sets
PDF
Sets functions-sequences-exercises
DOC
Veena vtext
DOC
Veena vtext
PPTX
INTRODUCTION TO SETS.pptx
PPTX
CLASS- 11 Mathematics PPT 2024-25 1 SETS.pptx
PDF
Discrete Structure Lecture #7 & 8.pdf
PPT
9108528.ppt
Digital text sets pdf
Set
 
Lecture 1 - Concept of Sets.pdf
Discrete Structure Mathematics lecture 1
Appendix A(1).pdf
Sets and its types-
Sets and Functions By Saleh ElShehabey
Explore the foundational concepts of sets in discrete mathematics
Set in discrete mathematics
Digital text book sets
Sets functions-sequences-exercises
Veena vtext
Veena vtext
INTRODUCTION TO SETS.pptx
CLASS- 11 Mathematics PPT 2024-25 1 SETS.pptx
Discrete Structure Lecture #7 & 8.pdf
9108528.ppt

More from David Wood (20)

PPTX
Internet of Things (IoT) two-factor authentication using blockchain
PPTX
Returning to Online Privacy?
PPTX
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
PPTX
BlockSW 2019 Keynote
PDF
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
PDF
Privacy in the Smart City
PDF
Controlling Complexities in Software Development
PDF
Privacy Concerns related to Verifiable Claims
PDF
Implementing the Verifiable Claims data model
PDF
Functional manipulations of large data graphs 20160601
PDF
When Metaphors Kill
PDF
Secularism in Australia
PDF
Meditations on Writing in Paradoxes, Oxymorons, and Pleonasms
PDF
Building a writer's platform with social media
PDF
Summary of the Hero's Journey
PDF
Open by Default
PDF
Lod Then, Now and Next 20110926
PDF
Linked Data ROI 20110426
PDF
Introduction to Linked Data: RDF Vocabularies
PDF
Introduction to Linked Data: RDF Vocabularies
Internet of Things (IoT) two-factor authentication using blockchain
Returning to Online Privacy?
Methods for Securing Spacecraft Tasking and Control via an Enterprise Ethereu...
BlockSW 2019 Keynote
Returning to Online Privacy - W3C/ANU Future of the Web Roadshow 20190221
Privacy in the Smart City
Controlling Complexities in Software Development
Privacy Concerns related to Verifiable Claims
Implementing the Verifiable Claims data model
Functional manipulations of large data graphs 20160601
When Metaphors Kill
Secularism in Australia
Meditations on Writing in Paradoxes, Oxymorons, and Pleonasms
Building a writer's platform with social media
Summary of the Hero's Journey
Open by Default
Lod Then, Now and Next 20110926
Linked Data ROI 20110426
Introduction to Linked Data: RDF Vocabularies
Introduction to Linked Data: RDF Vocabularies

CPSC 125 Ch 3 Sec 1

  • 1. Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co. MSCS Slides Set, Combinatorics, Probability & Number Theory
  • 2. Set theory ●  Sets: Powerful tool in computer science to solve real world problems. ●  A set is a collection of distinct objects called elements. ●  Traditionally, sets are represented by capital letters, and elements by lower case letters. ●  The symbol ∈ means “belongs to” and is used to represent the fact that an element belongs to a particular set. Hence, a∈A means that element a belongs to set A. ●  b∉A implies that b is not an element of A. ●  Braces {} are used to indicate a set. ●  A = {2, 4, 6, 8, 10} 3∉A and 2∈A Section 3.1 Sets 1
  • 3. Set theory ●  Ordering is not imposed on the set elements and listing elements twice or more is redundant. ●  Two sets are equal if and only if they contain the same elements. ●  Hence, A = B means (∀x)[(x ∈ A → x ∈ B) Λ (x ∈ B → x ∈ A)] ●  Finite and infinite set: described by number of elements in a set ●  Members of infinite sets cannot be listed, but a pattern for listing elements could be indicated. ●  e.g. S = {x | x is a positive even integer} or using predicate notation. S = {x | P(x)} means (∀x)[(x ∈ S → P(x)) Λ (P(x)→ x ∈ S)] where P is the unary predicate. ●  Hence, every element of S has the property P and everything that has a property P is an element of S. Section 3.1 Sets 2
  • 4. Set Theory Examples ●  Describe each of the following sets by listing the elements: ●  {x | x is a month with exactly thirty days} ■  {April, June, September, November} ●  {x | x is an integer and 4 < x < 9} ■  {5, 6, 7, 8} ●  What is the predicate for each of the following sets? ●  {1, 4, 9, 16} ■  {x | x is one of the first four perfect squares} ●  {2, 3, 5, 7, 11, 13, 17, ….} ■  {x | x is a prime number} Section 3.1 Sets 3
  • 5. Set Theory Basics ●  A set that has no members is called a null or empty set and is represented by ∅ or {}. ■  Note that ∅ is different from {∅}. The latter is a set with 1 element, which is the empty set. ●  Some notations used for convenience of defining sets ■  N = set of all nonnegative integers (note that 0 ∈ N) ■  Z = set of all integers ■  Q = set of all rational numbers ■  R = set of all real numbers ■  C = set of all complex numbers ●  Using the above notations and predicate symbols, one can describe sets quite easily ●  A = {x | (∃y)[(y∈ {0,1,2}) and (x = y2)]} ■  Hence, A = {0,1, 4} ●  A = {x | x ∈ N and (∀y)(y ∈ {2, 3, 4, 5} → x ≥ y)} ●  B = {x | (∃y)(∃z)(y ∈ {1,2} and z ∈ {2,3} and x = z – y) } Section 3.1 Sets 4
  • 6. Open and closed interval {x ∈ R | -2 < x < 3} ●  Denotes the set containing all real numbers between -2 and 3. This is an open interval, meaning that the endpoints -2 and 3 are not included. ■  By all real numbers, we mean everything such as 1.05, -3/4, and every other real number within that interval. {x ∈ R | -2 ≤ x ≤ 3} ●  Similar set but on a closed interval ■  It includes all the numbers in the open interval described above, plus the endpoints. Section 3.1 Sets 5
  • 7. Relationship between Sets ●  Say S is the set of all people, M is the set of all male humans, and C is the set of all computer science students. ●  M and C are both subsets of S, because all elements of M and C are also elements of S. ●  M is not a subset of C, however, since there are elements of M that are not in C (specifically, all males who are not studying computer science). ●  For sets S and M, M is a subset of S if, and only if, every element in M is also an element of S. ■  Symbolically: M ⊆ S ⇔ (∀x), if x ∈ M, then x ∈ S. ●  If M ⊆ S and M ≠ S, then there is at least one element of S that is not an element of M, then M is a proper subset of S. ■  Symbolically, denoted by M ⊂ S Section 3.1 Sets 6
  • 8. Relationship between Sets ●  A superset is the opposite of subset. If M is a subset of S, then S is a superset of M. ■  Symbolically, denoted S ⊆ M. ●  Likewise, if M is a proper subset of S, then S is a proper superset of M. ■  Symbolically, denoted S ⊃ M. ●  Cardinality of a set is simply the number of elements within the set. ●  The cardinality of S is denoted by |S|. ●  By the above definition of subset, it is clear that set M must have fewer members than S, which yields the following symbolic representation: S ⊃ M ⇒ |M| < |S| Section 3.1 Sets 7
  • 9. Exercise ●  A = {x | x ∈ N and x ≥ 5} ⇒ {5, 6, 7, 8, 9, …… } ●  B = {10, 12, 16, 20} ●  C = {x | (∃y)(y ∈ N and x = 2y)} ⇒ {0, 2, 4, 6, 8, 10, …….} ●  What statements are true? B⊆C √ B ⊂ A √ A ⊆ C 26 ∈ C √ {11, 12, 13} ⊆ A √ {11, 12, 13} ⊂ C {12} ∈ B {12} ⊆ B √ {x | x ∈ N and x < 20}⊄ B √ 5 ⊆ A {∅} ⊆ B ∅ ∈ A √ Section 3.1 Sets 8
  • 10. Set of Sets ●  For the following sets, prove A ⊂ B. ●  A = { x | x ∈ R such that x2 – 4x + 3 = 0} ■  A = {1, 3} ●  B = { x | x ∈ N and 1≤ x ≤ 4} ■  B = {1, 2, 3, 4} ●  All elements of A exist in B, hence A ⊂ B. ●  From every set, many subsets can be generated. A set whose elements are all such subsets is called the power set. ●  For a set S, ℘(S) is termed as the power set. ●  For a set S = {1, 2, 3} ; ℘(S) = {∅ ,{1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}} ●  For a set with n elements, the power set has 2n elements. Section 3.1 Sets 9
  • 11. Set operations ●  Binary and unary operators ■  Binary acts on two elements, say x-y or y-x. ■  Unary acts on a single element, say negation of an element x is –x. ■  Example: +, - and * are all binary operators on Z. ●  An ordered pair of elements is written as (x,y) and is different from (y,x). ■  Two ordered pairs (a,b) and (c,d) are equal if and only if a = c and b = d. ■  If S = {2,3}, the ordered pairs of this set are (2,2), (2,3), (3,2), (3,3). ●  Binary operation (represented by °) on a set defined as follows: ●  If for every ordered pair (x,y) of elements of S, x ° y exists, and is unique, and is a member of S. ■  The fact that x ° y exists, and is unique is the same as saying that the binary operation ° is well-defined. ■  The fact that x ° y always belongs to S means that S is closed under the operation °. ■  The operator ° is just a placeholder for a real operator like +, -, * etc. Section 3.1 Sets 10
  • 12. Binary or unary operations ●  Which of the following are neither binary nor unary operations on the given sets? Why? ●  x ° y = x/y; S = set of all positive integers ■  S is not closed under division (x/0 does not exist). ●  x ° y = x/y; S = set of all positive rational numbers ●  x ° y = xy; S = R ■  00 is not defined ●  x ° y = maximum of x and y; S = N ●  x ° y = x + y; S = set of Fibonacci numbers ■  S is not closed under addition since, 1+3 = 4 and 4 is not a Fibonacci number Section 3.1 Sets 11
  • 13. Operations on Sets ●  New sets can be formed in a variety of ways, and can be described using both set builder notation and Venn diagrams. ●  Let A, B ∈ ℘(S). The union of set A and B, denoted by A ∪ B is the set that contains all elements in either set A or set B, i.e. A ∪ B = {x | x ∈ A or x ∈ B}. The intersection of set A and B, denoted by A ∩ B contain all elements that are common to both sets i.e. A ∩ B = {x | x ∈ A and x ∈ B} ●  If A = { 1,3,5,7,9} and B = {3,7,9,10,15} ; A ∪ B = {1, 3, 5, 7, 9, 10, 15} and A ∩ B = {3, 7, 9}. Section 3.1 Sets 12
  • 14. Disjoint, Universal and Difference Sets ●  Given set A and set B, if A ∪ B = ∅, then A and B are disjoint sets. In other words, there are no elements in A that are also in B. ●  For a set A ∈ ℘(S), the complement of set A, denoted as ~A or Aʹ′, is the set of all elements that are not in A. Aʹ′ = {x | x ∈ S and x ∉ A } ●  The difference of A-B is the set of elements in A that are not in B. This is also known as the complement of B relative to A. A - B = {x | x ∈ A and x ∉ B } Note A – B = A ∩ Bʹ′ ≠ B – A Section 3.1 Sets 13
  • 15. Class Exercise ●  Let A = {1, 2, 3, 5, 10} B = {2, 4, 7, 8, 9} C = {5, 8, 10} be subsets of S = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Find ●  A ∪ B {1, 2, 3, 4, 5, 7, 8, 9, 10} ●  A – C {1, 2, 3} ●  Bʹ′ ∩ (A ∪ C) {1, 3, 5, 10} ●  A ∩ B ∩ C {∅} ●  (A ∪ B) ∩ Cʹ′ {1, 2, 3, 4, 7, 9} Section 3.1 Sets 14
  • 16. Cartesian Product ●  If A and B are subsets of S, then the cartesian product (cross product) of A and B denoted symbolically by A × B is defined by A × B = {(x,y) | x ∈ A and y ∈ B } ●  The Cartesian product of 2 sets is the set of all combinations of ordered pairs that can be produced from the elements of both sets. Example, given 2 sets A and B, where A = {a, b, c} and B = {1, 2, 3}, the Cartesian product of A and B can be represented as A × B = {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3), (c, 1), (c, 2), (c, 3)} ●  Is A × B = B × A? ●  Cross-product of a set with itself is represented as A × A or A2 ●  An ordered n-tuple is a set of elements that is defined by the order in that the elements appear, and by the number of times which distinct elements appear. ■  Example, the coordinates of points on a graph are ordered pairs, where the first value must be the x coordinate, and the second value must be the y coordinate. ●  An represents the set of all n-tuples (x1, x2, …, xn) of elements of A. Section 3.1 Sets 15
  • 17. Basic Set Identities ●  Given sets A, B, and C, and a universal set S and a null/empty set ∅, the following properties hold: ●  Commutative property (cp) A ∪ B = B ∪ A A ∩ B = B ∩ A ●  Associative property (ap) A ∪ (B ∪ C) = (A ∪ B) ∪ C A ∩ (B ∩ C) = (A ∩ B) ∩ C ●  Distributive properties (dp) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) ●  Identity properties (ip) ∅ ∪ A = A ∪ ∅ = A S ∩ A = A ∩ S = A ●  Complement properties (comp) A ∪ Aʹ′ = S A ∩ Aʹ′ = ∅ Section 3.1 Sets 16
  • 18. More set identities ●  Double Complement Law (Aʹ′)ʹ′ = A ●  Idempotent Laws A ∪ A = A A ∩ A = A ●  Absorption properties A ∪ (A ∩ B) = A A ∩ (A ∪ B) = A ●  Alternate Set Difference Representation A - B = A ∩ Bʹ′ ●  Inclusion in Union A ⊆ A ∪ B B ⊆ A ∪ B ●  Inclusion in Intersection A ∩ B ⊆ A A ∩ B ⊆ B ●  Transitive Property of Subsets if A ⊆ B, and B ⊆ C, then A ⊆ C Section 3.1 Sets 17
  • 19. Exercise ●  Use the set identities to prove [A ∪ (B ∩ C)] ∩ ([Aʹ′ ∪ (B ∩ C)] ∩ (B ∩ C)ʹ′) = ∅ ●  Proof: [A ∪ (B ∩ C)] ∩ ([Aʹ′ ∪ (B ∩ C)] ∩ (B ∩ C)ʹ′) = ([A ∪ (B ∩ C)] ∩ [Aʹ′ ∪ (B ∩ C)]) ∩ (B ∩ C)ʹ′ using ap ([(B ∩ C) ∪ A] ∩ [(B ∩ C) ∪ Aʹ′]) ∩ (B ∩ C)ʹ′ using cp twice [(B ∩ C) ∪ (A ∩ Aʹ′)] ∩ (B ∩ C)ʹ′ using dp [(B ∩ C) ∪ ∅] ∩ (B ∩ C)ʹ′ using comp (B ∩ C) ∩ (B ∩ C)ʹ′ using ip ∅ using comp Section 3.1 Sets 18