Class2 Sets
Transcript of Class2 Sets
-
7/27/2019 Class2 Sets
1/19
Instructor:Instructor: NirmalNirmal GuptaGupta
Instructor InInstructor In--Charge: Dr.Charge: Dr. MukeshMukesh RohilRohil
-
7/27/2019 Class2 Sets
2/19
TEXT BOOK:TEXT BOOK:
T1: Mott ,T1: Mott , KandelKandel, & Baker : Discrete Mathematics for Computer, & Baker : Discrete Mathematics for Computer, , , ., , , .
REFERENCE BOOKS:REFERENCE BOOKS:
: u: emen s o scre e a ema cs, c raw , e,: u: emen s o scre e a ema cs, c raw , e,19851985
R2: K H Rosen: Discrete Mathematics & its Applications, TMH, 6e,R2: K H Rosen: Discrete Mathematics & its Applications, TMH, 6e,..
CMT forCMT for all kinds of course information and alsoall kinds of course information and also lecturelecture slides inslides inorma sorma s, up a e, up a e a era er eaceac sess on.sess on.
-
7/27/2019 Class2 Sets
3/19
Test 1 (25Feb)Test 1 (25Feb) 40 Marks40 Marks
Quiz (4Feb)Quiz (4Feb) 40 Marks40 Marks
Project/AssignmentsProject/Assignments 40 Marks40 Marks
ComprehensiveComprehensive 80 Marks80 Marks
-
7/27/2019 Class2 Sets
4/19
(bits).(bits).
Therefore both a com uter sTherefore both a com uter s
structure (circuits)structure (circuits) andand
can be described by discrete math.can be described by discrete math.
-
7/27/2019 Class2 Sets
5/19
Introduction & OverviewIntroduction & Overview
MathematicalMathematical InductionInduction
GraphsGraphs
Boolean AlgebraBoolean Algebra
rouproup
-
7/27/2019 Class2 Sets
6/19
Set: Collection of objects ( elements )Set: Collection of objects ( elements )
aa AA a is an element of Aa is an element of Aa is a member of Aa is a member of A
aa AA a is not an element of Aa is not an element of A
= a= a11, a, a22, , a, , ann con a nscon a ns
Order of elements is meaninglessOrder of elements is meaningless
It does not matter how often the same elementIt does not matter how often the same elementis listed.is listed.
-
7/27/2019 Class2 Sets
7/19
Sets A and B are equal if and only if they containSets A and B are equal if and only if they contain..
Examples:Examples:
A = {9, 2, 7,A = {9, 2, 7, --3}, B = {7, 9,3}, B = {7, 9, --3, 2} :3, 2} : A = BA = B
= , , ,= , , ,B = {cat, horse, squirrel, dog} :B = {cat, horse, squirrel, dog} : AA BB
= og, ca , orse ,= og, ca , orse ,B = {cat, horse, dog, dog} :B = {cat, horse, dog, dog} : A = BA = B
-
7/27/2019 Class2 Sets
8/19
Standard Sets:Standard Sets:
Natural numbersNatural numbers NN = {0, 1, 2, 3, }= {0, 1, 2, 3, }
-- --,, ,, , , , ,, , , ,Positive IntegersPositive Integers ZZ++ = {1, 2, 3, 4, }= {1, 2, 3, 4, }
Real NumbersReal Numbers RR = {47.3,= {47.3, --12,12, , }, }
Rational NumbersRational Numbers QQ = {1.5, 2.6,= {1.5, 2.6, --3.8, 15, }3.8, 15, }(correct definition will follow)(correct definition will follow)
-
7/27/2019 Class2 Sets
9/19
A =A = empty set/null setempty set/null set
== ,,
A = {{b, c}, {c, x, d}}A = {{b, c}, {c, x, d}}
A = {{x, y}}A = {{x, y}}Note: {x, y}Note: {x, y} A, but {x, y}A, but {x, y} {{x, y}}{{x, y}}
A = {x | P(x)}A = {x | P(x)}set of all x such that P(x)set of all x such that P(x)
A = {x | xA = {x | x NN x > 7} = {8, 9, 10, }x > 7} = {8, 9, 10, }
set builder notationset builder notation
-
7/27/2019 Class2 Sets
10/19
We are now able to define the set of rationalWe are now able to define the set of rationalnumbers Q:numbers Q:
QQ = {a/b | a= {a/b | a ZZ bb ZZ++}}
ororQQ = {a/b | a= {a/b | a ZZ bb ZZ bb 0}0}
And how about the set of real numbers R?And how about the set of real numbers R?
RR = {r | r is a real number}= {r | r is a real number}
That is the best we can do.That is the best we can do.
-
7/27/2019 Class2 Sets
11/19
AA BB A is a subset of BA is a subset of BAA B if and only if every element of A is alsoB if and only if every element of A is also
an e ement o .an e ement o .
We can completely formalize this:We can completely formalize this:
x xx x xx
Exam les:Exam les:
A = {3, 9}, B = {5, 9, 1, 3}, AA = {3, 9}, B = {5, 9, 1, 3}, A B ?B ? truetrue
A = {3, 3, 3, 9}, B = {5, 9, 1, 3}, AA = {3, 3, 3, 9}, B = {5, 9, 1, 3}, A B ?B ?
falsefalse
truetrue
A = 1 2 3 B = 2 3 4 AA = 1 2 3 B = 2 3 4 A B ?B ?
-
7/27/2019 Class2 Sets
12/19
Useful rules:Useful rules:A = BA = B (A(A B)B) (B(B A)A)
(A(A B)B) (B(B C)C) AA CC (see Venn Diagram)(see Venn Diagram)
AABB
CC
-
7/27/2019 Class2 Sets
13/19
Useful rules:Useful rules:
AA A for any set AA for any set A
Proper subsets:Proper subsets:
AA BB x (x (xx AA xx BB)) x (x (xx BB xx AA))
oror
AA BB x (x (xx AA xx BB)) x (x (xx BB xx AA))
-
7/27/2019 Class2 Sets
14/19
If a set S contains n distinct elements, nIf a set S contains n distinct elements, n NN,,we call S awe call S a finite setfinite set withwith cardinalit ncardinalit n..
Examples:Examples:
A = {Mercedes, BMW, Porsche}, |A| = 3A = {Mercedes, BMW, Porsche}, |A| = 3
B = 1, 2, 3 , 4, 5 , 6B = 1, 2, 3 , 4, 5 , 6 B = 4B = 4
C =C = | C| = 0| C| = 0
== ==
E = { xE = { x NN | x| x 7000 }7000 } E is inf init e!E is inf init e!
-
7/27/2019 Class2 Sets
15/19
P(A)P(A) power set of Apower set of AP A = B BP A = B B AA contains all subsets of Acontains all subsets of A
Examples:Examples:
A = {x, y, z}A = {x, y, z}
==
A =A =
P(A) = {P(A) = { }}
Note: |A| = 0, |P(A)| = 1Note: |A| = 0, |P(A)| = 1
-
7/27/2019 Class2 Sets
16/19
Cardinality of power sets:Cardinality of power sets:
| P(A) | = 2| P(A) | = 2|A||A|
Imagine each element in A has anImagine each element in A has an onon//offoff
switch
switch
Each possible switch configuration in A correspondsEach possible switch configuration in A corresponds
to one element in 2to one element in 28877665544332211AA
yyyyyyyyyyyyyyyyyy
xxxxxxxxxxxxxxxxxx
zzzzzzzzzzzzzzzzzz
For 3 element s in A, t her e ar eFor 3 element s in A, t her e ar e= e emen s n= e emen s n
-
7/27/2019 Class2 Sets
17/19
TheThe ordered nordered n--tupletuple (a(a11, a, a
22, a, a
33, , a, , a
nn) is an) is an orderedordered
collectioncollection of objects.of objects.
Two ordered nTwo ordered n--tuples (atuples (a11, a, a22, a, a33, , a, , ann) and) and
(b(b11, b, b22, b, b33, , b, , bnn) are equal if and only if they) are equal if and only if they
contain exactly the same elementscontain exactly the same elements in the samein the sameorderorder, i.e. a, i.e. aii = b= bii for 1for 1 ii n.n.
TheThe Cartesian productCartesian product of two sets is defined as:of two sets is defined as:
== ,,Example:Example: A = {x, y}, B = {a, b, c}A = {x, y}, B = {a, b, c}
, , , , , , , , , , ,, , , , , , , , , , ,
-
7/27/2019 Class2 Sets
18/19
TheThe Cartesian productCartesian product of two sets is defined as:of two sets is defined as:AA B = {(a, b) | aB = {(a, b) | a AA bb B}B}
Example:Example:
= == =, , ,, , ,
== (good, student),(good, student), (good, prof),(good, prof), (bad, student),(bad, student), (bad, prof)(bad, prof)
, ,, , , ,, , , ,, , ,,==
-
7/27/2019 Class2 Sets
19/19
Note that:Note that:AA ==
A =A =
--|A|A B| = |A|B| = |A| |B||B|
The Cartesian product ofThe Cartesian product of two or more setstwo or more sets isis
defined as:defined as:
AA11 AA22 AAnn = {(a= {(a11, a, a22, , a, , ann) | a) | aii A for 1A for 1 ii n}n}