set theory 2014

Upload: rohil-singh

Post on 11-Oct-2015

67 views

Category:

Documents


0 download

DESCRIPTION

set theory

TRANSCRIPT

  • *Module 1:Set TheoryProf. Shiwani Gupta

  • History and ApplicationsThe editice of modern mathematics rests on the concept of sets.Georg Cantor got his pHd in number theory.Important language and tool for reasoning.General: Reasoning and programmingReal life: cellular phone, traffic lights, search box in eBay, stock market, to a satellite Computer Science: Halting problem, Turing Machine

    *

  • *Introduction to Set TheoryA set is a structure, representing a welldefined unordered collection (group, plurality) of zero or more distinct (different) objects called elements or member of a set.Set theory deals with operations on, relations among, and statements about sets.

  • *Basic notations for setsFor sets, well use variables S, T, U, Roster or Tabular Form orListing Method: We can denote a set S in writing by listing all of its elements in curly braces: {a, b, c} is the set of whatever 3 objects are denoted by a, b, c.Rule method or Set builder notation: For any proposition P(x) over any universe of discourse, {x|P(x)} is the set of all x such that P(x). e.g., {x | x is an integer where x>0 and x
  • *Basic properties of setsSets are inherently unordered:No matter what objects a, b, and c denote, {a, b, c} = {a, c, b} = {b, a, c} = {b, c, a} = {c, a, b} = {c, b, a}.All elements are distinct (unequal); multiple listings make no difference!{a, b, c} = {a, a, b, a, b, c, c, c, c}. This set contains at most 3 elements!

  • *Definition of Set EqualityTwo sets are declared to be equal if and only if they contain exactly the same elements.In particular, it does not matter how the set is defined or denoted.For example: The set {1, 2, 3, 4} = {x | x is an integer where x>0 and x0 and
  • *Infinite SetsConceptually, sets may be infinite (i.e., not finite, without end, unending).Symbols for some special infinite sets: N = {1, 2, } The natural numbers. Z = {, -2, -1, 0, 1, 2, } The integers. R = The real numbers, such as 374.1828471929498181917281943125Infinite sets come in different sizes!

  • *Cardinality and Finiteness|S| (read the cardinality of S) is a measure of how many different elements S has.E.g., ||=0, |{1,2,3}| = 3, |{a,b}| = 2, |{{1,2,3},{4,5}}| = ____We say S is infinite if it is not finite.What are some infinite sets weve seen?e.g. if S = {2, 3, 5, 7, 11, 13, 17, 19}, then |S|=8.if S={CSC1130, CSC2110, ERG2020, MAT2510},then |S|=4.if S = {{1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}}, then |S|=6.

  • Countably infinite and Uncountably Infinite SetsFinite sets are countable eg. Z.Uncountable sets are infinite as R.N, Z, R are infinite sets.|N| is denoted as 0. Any set which can be put into 1-1 correspondence with N,Z is also countably infinite or denumerable eg. AN, set of even Integers, set of ve Integers, set of prime nos.Thus every infinite set has countable infinite subset.*

  • *Venn Diagrams

  • *Basic Set Relations: Member ofxS (x is in S) is the proposition that object x is an element or member of set S.e.g. 3N, a{x | x is a letter of the alphabet}Can define set equality in terms of relation: S,T: S=T (x: xS xT) Two sets are equal iff they have all the same members.xS : (xS) x is not in S

  • *The Empty, Universal, Singleton Set (null, the empty set, void set) is the unique set that contains no elements whatsoever. = {} = {x|False}No matter the domain of discourse, we have the axiom x: x.In any application of theory of sets, the members of all sets under investigation usually belong to some fixed large set called Universal Set or Universe of Discourse.A set having only one element is Singleton set.

  • *Subset and Superset RelationsIf every element in set S is element in set T, then S is called subset of T.ST (S is a subset of T) We also say that S is contained in B or B contains AST (S is a superset of T) means TS.ST x (xS xT)S, SS.Note S=T ST ST. means (ST), i.e. x(xS xT)Eg. S={1,2,3}, B=(1,2,3,4,5}AB

  • *Sets and Subsetsset equalitysubsetsFact: If , then |A|
  • *Properties of Subsets If A={4, 8, 12, 16} and B={2, 4, 6, 8, 10, 12, 14, 16}, then but

    because every element in A is an element of A.

    for any A because the empty set has no elements.

    If A is the set of prime numbers and B is the set of odd numbers, then

  • *Proper (Strict) Subsets & SupersetsST (S is a proper subset of T) means that ST but . Similar for ST.STVenn Diagram equivalent of STExample: {1,2} {1,2,3}Fact: If A = B, then |A| = |B|. Fact: If , then |A| < |B|.

  • *Sets and Subsets (common notations)(a) Z=the set of integers={0,1,-1,2,-1,3,-3,...}(b) N=the set of nonnegative integers or natural numbers(c) Z+=the set of positive integers(d) Q=the set of rational numbers={a/b| a,b is integer, b not zero}(e) Q+=the set of positive rational numbers(f) Q*=the set of nonzero rational numbers(g) R=the set of real numbers(h) R+=the set of positive real numbers(i) R*=the set of nonzero real numbers(j) C=the set of complex numbers

  • *Examples of sets

    The set of all polynomials with degree at most three: {1, x, x2, x3, 2x+3x2,}.The set of all n-bit strings: {0000, 0001, , 1111}The set of all triangles without an obtuse angle: { , , }The set of all graphs with four nodes: { , , , ,}

  • *The Power Set OperationThe power set P(S) of a set S is the set of all subsets of S. P(S) = {x | xS}.E.g. P({a,b}) = {, {a}, {b}, {a,b}}.Sometimes P(S) is written 2S. Note that for finite S, |P(S)| = 2|S|.It turns out that |P(N)| > |N|. There are different sizes of infinite sets!

  • *Sets Are Objects, Too!The objects that are elements of a set may themselves be sets.E.g. let S={x | x {1,2,3}} then P(S)={, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}Note that 1 {1} {{1}} !!!!

  • *Ordered n-tuplesFor nN, an ordered n-tuple or a sequence of length n is written (a1, a2, , an). The first element is a1, etc.These are like sets, except that duplicates matter, and the order makes a difference.Note (1, 2) (2, 1) (2, 1, 1).Empty sequence, singlets, pairs, triples, quadruples, quintuples, , n-tuples.

  • *The Union OperatorFor sets A, B, their union AB is the set containing all elements that are either in A, or () in B (or, of course, in both).Formally, A,B: AB {x | xA xB}.Note that AB contains all the elements of A and it contains all the elements of B: A, B: (AB A) (AB B)

  • *{a,b,c}{2,3} = {a,b,c,2,3}{2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7} Union Examples

  • *The Intersection OperatorFor sets A, B, their intersection AB is the set containing all elements that are simultaneously in A and () in B.Formally, A,B: AB{x | xA xB}.Note that AB is a subset of A and it is a subset of B: A, B: (AB A) (AB B)

  • *{a,b,c}{2,3} = ___{2,4,6}{3,4,5} = ______Intersection Examples{4}

  • *DisjointednessTwo sets A, B are called disjoint (i.e., unjoined) iff their intersection is empty. (AB=)Example: the set of even integers is disjoint with the set of odd integers.

  • *Set DifferenceFor sets A, B, the difference of A and B, written AB, is the set of all elements that are in A but not B.A B : x xA xB x xA xB Also called: The complement of B with respect to A.

  • *Set Difference Examples{1,2,3,4,5,6} {2,3,5,7,9,11} = ___________Z N { , -1, 0, 1, 2, } {1, } = {x | x is an integer but not a nat. #} = {x | x is a negative integer} = { , -3, -2, -1,0}{1,4,6}

  • *Set Difference - Venn DiagramA-B is whats left after B takes a bite out of ASet ASet B

  • *Set ComplementsThe universe of discourse can itself be considered a set, call it U.The complement of A, written , is the complement of A w.r.t. U, i.e., it is UA.E.g., If U=N,

  • *More on Set ComplementsAn equivalent definition, when U is clear: AU

  • *Ring Sum (Symmetric Difference)Let A and B be two non empty sets then ring sum of A and B is set of all elements which are either in A or in B but not in both.Thus AB={x | x AB but AB} ={x|(xA and xB)or (xB and x A)}

  • *Cartesian Products of SetsFor sets A, B, their Cartesian product AB : {(a, b) | aA bB }.E.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)}Note that for finite A, B, |AB|=|A||B|.Note that the Cartesian product is not commutative: AB: AB =BA.Extends to A1 A2 An...

  • *Cartesian Product

    Let A be the set of letters, i.e. {a,b,c,,x,y,z}.Let B be the set of digits, i.e. {0,1,,9}.AxA is just the set of ordered pair of two letters.BxB is just the set of ordered pair of two digits.AxB is the set of ordered pair where the first character is a letter and the second character is a digit.

    Definition: Given two sets A and B, the Cartesian product A x B is the set of all ordered pairs (a,b), where a is in A and b is in B

    . (1,2) (2,1)

  • *Laws of set theoryIdentity: A=A AU=ADomination: AU=U A=Idempotent: AA = A = AAInvolution/Double complement: Commutative: AB=BA AB=BAAssociative: A(BC)=(AB)C A(BC)=(AB)C

  • *Laws of set theoryDistributive: A(BC)=(AB)(AC) A (BC)=(AB)(AC)Properties of complement /Inverse:AAc =UAAc = c =UUc= Absorption:A (AB)=A A(AB)=A

  • *DeMorgans Law for SetsExactly analogous to (and derivable from) DeMorgans Law for propositions.

  • *Dualitys dual of s (sd)Theorem (The Principle of Duality)

  • *Partition of setsA collection of nonempty sets {A1, A2, , An} is a partition of a set A if and only ifA1, A2, , An are mutually disjoint (or pairwise disjoint).e.g. Let A be the set of integers. A1 = {x A | x = 3k+1 for some integer k} A2 = {x A | x = 3k+2 for some integer k} A3 = {x A | x = 3k for some integer k} Then {A1, A2, A3} is a partition of A

  • Partition of setse.g. Let A be the set of integers divisible by 6. A1 be the set of integers divisible by 2. A2 be the set of integers divisible by 3. Then {A1, A2} is not a partition of A, because A1 and A2 are not disjoint, and also A A1 A2 (so both conditions are not satisfied).e.g. Let A be the set of integers. Let A1 be the set of negative integers. Let A2 be the set of positive integers. Then {A1, A2} is not a partition of A, because A A1 A2 as 0 is contained in A but not contained in A1 A2

  • *(Addition Principle / Sum Rule)If sets A and B are disjoint, then |A B| = |A| + |B|ABWhat if A and B are not disjoint?

  • *Inclusion-Exclusion PrincipleHow many elements are in AB? |AB| = |A| |B| |AB|

    Example: {2,3,5}{3,5,7} = {2,3,5,3,5,7} ={2,3,5,7}

  • *Inclusion Exclusion (2 sets)For two arbitrary sets A and B AB

  • *Inclusion Exclusion (3sets)ABC|A B C| = |A| + |B| + |C| |A B| |A C| |B C| + |A B C|

  • *Inclusion Exclusion (4 sets)ABC|A B C D| = |A| + |B| + |C| + |D| |A B| |A C| |A D| |B C| |B D| |C D| + |A B C| + |A B D| + |A C D| + |B C D| |A B C D |D

  • *Inclusion Exclusion (n sets)What is the inclusion-exclusion formula for the union of n sets?

  • *Counting and Venn DiagramsIn a class of 50 college freshmen, 30 are studying BASIC, 25 studying PASCAL, and 10 are studying both. How many freshmen are studying either computer language?

    AB101520

    ******Read {a, b, c} as the set whose elements are a, b, and c or just the set a, b, c.********N positive integers {1,2,3,}Z integers {,-3,-2,-1,0,1,2,3,}R real numbersDiscrete Mathematics and its Applications****With Venn diagrams, you can see that one set is a subset of another just by seeing that you can draw an enclosure around its members that fits completely inside an enclosure drawn around the larger sets members.********Note also that FORALL x P(x)->Q(x) can also be understood as meaning {x|P(x)} is a subset of {x|Q{x}}. This can help you understand the meaning of implication. For example, if I say, if a student has a drivers license, then he is over 16, this is the same as saying the set of students with drivers licenses is a subset of the set of students who are over 16, or every student with a drivers license is over 16. If no students in the universe of discourse have drivers licenses, then the antecedent is always false, or in other words the set of students with drivers licenses is just the empty set, which is of course a member of every set, and so the statement is vacuously true. Alternatively, if every student in the universe of discourse is over 16, then the consequent is always true, that is, the set of students who are over 16 is the entire universe of discourse, and so every set of students in the u.d. is necessarily a subset of the set of students who are over 16, and so the statement is trivially true. The statement is only false if there exists a student with a drivers license in the u.d. who is under 16 (perhaps the license is fake or from a foreign country), in which case, the set of students with drivers licenses is *not* a subset of the under-16 students.****We may also say, S is a strict subset of T, or S is strictly a subset of T to mean the same thing.******Well get to different sizes of infinite sets later, in the module on functions.**In general, any kind of object or structure, whether simple or complex, can be a member of a set. In particular, sets themselves (being structures) can be members of sets.

    If you dont understand the distinction between 1, {1}, {{1}}, youll make endless silly mistakes. 1 is a number, the number one. {1} is NOT A NUMBER AT ALL! It is a COMPLETELY DIFFERENT TYPE OF OBJECT! Namely, it is a set. What kind of set? It is a singleton set, by which we mean a set that contains exactly one element. In this case, its element happens to be the number 1. Now, what is {{1}}? It is also a set, and also a singleton set, but it is a COMPLETELY DIFFERENT TYPE of singleton set. To see this, notice that {1} is a set of numbers, whereas {{1}} is not a set of numbers at all! It is a SET OF SETS. Its single element is not a number at all, but is a SET. Namely, the set {1}. In other words, {{1}} is the singleton set whose member is the singleton set whose member is 1. Whereas, {1} is just the singleton set whose member is 1. And, 1 is just 1. All of these are distinct objects and youve got to learn to keep them separate! Otherwise, youll never have a chance of understanding data types in programming languages. For example, in most languages, we can have an array of numbers, or an array of arrays of numbers, etc. These are all completely different types of objects and can never be compatible with each other.**Sometimes people also define bags, which are unordered collections in which duplicates matter. If you have a bag of coins, they are in no particular order, but it matters how many coins of each type you have.************NOT (x in A -> x in B) = NOT (x not in A or x in B) (defn. of implies) = x in A AND x not in B (DeMorgans law).

    ********Note that set difference and complement do not relate to each other like arithmetic difference and negative. In arithmetic, we know that a-b = -(b-a). But in sets, A-B is not generally the same as the complement of B-A.****Usually AxBxC is defined as {(a,b,c) | a is in A and b is in B and c is in C}. ******************We will see this basic counting principle again when we talk about combinatories.**********