Sets: basic definition and operationsWe will cover the topics:
Defining SetsFor now, it is convenient to assume that there is a universe Set
A set is any collection of elements from a universe The concept of a set is so basic in mathematics that it defies an easy definition. Most definitions just devolve to a set is a set :-). Elements of a Set
The contents of a set are called its elements. For an element There are two ways to define a set:
For now, whenever we are discussing sets, the universe Naive Set TheoryThe notion of set theory that we are studying in this lecture is called naive set theory. The reason, we call it naive is the assumption of the universal set
Nonexistence of the Universal Set
The universal set Therefore, we will continue to describe a version in this notes that we will call informally ‘‘semi-naive’’ (Note that this is our own invention and not a standard term in mathematics). Wherever possible, we will note the changes needed due to the non-existence of an universal set. Example 1: IntegersWe assume that the universe is restricted the set of all integers What do the following sets define:
Note that restricting our universe to the set of integers, poses no contradiction or paradox in the definitions above. Example 2: AnimalsLet the universe
Note that restricting the universe to that of all animal species on the planet earth makes the sets above well defined and free of contradictions. Empty/Universal SetsEmpty Set
The set with no elements is called the empty set. It is written Naive set theory often adds a special universal set However, in many contexts, we will specifically name a set such as
Union, Intersection, Difference and Complement.Let
The operation of complementation is defined in naive set theory.
If we operate inside a restricted universe Otherwise, Example 1Let Let What are the sets?
Example-2Is
Is
Finite Vs. Infinite SetsFinite sets are those that have finitely many elements. Infinite sets, on the other hand, have infinitely many elements. We will define infinite sets and deal with infinite sets in a lot of detail soon. Venn DiagramsVenn Diagrams are easy diagrammatic ways of visualizing sets and operations between them. We assume that you already know a lot about these (this is high school material, really). We will do some quick recap in class. On the other hand, Venn diagrams are nothing to sneeze at. The wikipedia article on Venn diagrams or this site has a lot of interesting information. We can use Venn diagrams to prove certain properties of sets.
CardinalityThe cardinality of a set is the number of elements in it. For now, it makes sense to talk of cardinality just for finite sets. We will discuss the issue of infinite sets and cardinality after we have covered relations and functions. The cardinality of the empty set is, of course, zero. The cardinality of a set can never be negative. What is the cardinality of the following sets:
The cardinality of a set Notice the following interesting fact: Using a Venn diagram, we can derive that The relation above is called the inclusion exclusion principle. We can extend it to three sets Notice the curious sign change!! Example-1Let Verify the inclusion-exclusion principle for We see that We can also see this using the inclusion exclusion principle: Example-2If we look at all numbers from Off the top of our head, this kind of calculation is tricky. We have Using inclusion-exclusion: Let Example -3How many numbers between Let us fix the universe to be Let We seek We have
Overall (I could be off in my calculations, please check). General Inclusion Exclusion PrincipleWe have seen inclusion exclusion for cardinality of Puzzle (Counting Prime Numbers)Given a list of prime numbers from Let us try a simpler case of counting primes from The universal set is We take our seed set of prime numbers to be Theorem Every composite number from Proof
Proof is by contradiction. Let In other words, we will first count We write We note that Therefore, The number of composites is therefore The same calculation can be carried out for all primes upto Using this, number of composites is There is a very close connection between this way of counting and Eratosthenes Sieve for enumerating all primes. Therefore, inclusion-exclusion principle is often called the sieve principle. As a fun exercise: implement a counter to solve the puzzle. You will definitely need to write a program rather than attempt this by hand. Cartesian Products and Power SetsWe will now look at two other operations over sets:
Cartesian ProductTake sets In other words, we build the set of all 2-tuples We can extend Cartesian product to more than Here we take Cartesian product of Example-1If Answer: For simplicity, the product of a set with itself What is Example-2: Empty SetWhat is the Cartesian product of the empty set Answer: The empty set. Cardinality of Cartesian ProductsThe rule for Cartesian product is that We can convince ourselves by drawing a table of all entries. Let us assume
Order of Cartesian Product MattersIf If ExampleWhat is the size of cartesian product SubsetSet Examples
Answers: yes, no, yes, no, yes! |