Upload
edwina-baldwin
View
216
Download
0
Embed Size (px)
Citation preview
1
Introduction (Pengenalan) About the Lecturer:– Nama lengkap: Heru Suhartanto, Ph.D– Kantor: Ruang 1214, Gedung A, Fakultas Ilmu Komputer UI, Depok– E-mail: [email protected]– Pendidikan formal:
– Sarjana Matematika UI, 1986– Master of Science, Computer Science, University of Toronto, Canada, 1990.– Philosiphy Doctor (Ph.D), Parallel Computing, University of Queensland,
Australia, 1998. Other lecturers
– Achmad Nizar Hidayanto– Ade Azurat– Kasiyah M. Yunus– Dina Cahyati– Siti Aminah
Materi Matrikulasi Matematika – pengenalan (lihat Outline), sebagian diberikan dalam text bahasa Inggris.
Materi: http://telaga.cs.ui.ac.id/WebKuliah/Matrikulasi/math/
2
Lecture 1
Set Theory
Reading: Chp 5
Susanna S. Epp, Discrete Mathematics with Application 2-nd Ed, Brooks/Cole, 1995
3
1. Sets
1.1 (Definition: Set)
A SET is an unordered collection of unique elements.
Notation: It is written as:
{x1,…,xn}
where n 0 and x1,…,xn are the elements of the set.
4
1. Sets
1.2 Examples of sets– {1, 24, 32}– {apple, car, pencil}– {,,,}– {1, apple, }– {{1,2}, apple, { {},{,3}}}– {} is a set with no elements. It is known as
the empty set and is also denoted as ‘’
5
1. Sets
1.3 Remarksa. Ordering does not matter.
{1,2,3} = {1,3,2} = {2,1,3}
b. Repetitions are ignored.
{1,1,2,3} = {1,2,3}
c. Elements in the set need not be of the ‘same type’.
{1, apple, } is a set
6
1. Sets
1.3 Remarks (cont’d)d. A set can contain other sets as
elements
{{1,2}, apple, {{},{,3}}}
is a set with 3 elements:• {1,2}• apple• {{},{,3}}
e. A set can be finite or infinite.
7
1. Sets
1.4 Predefined Sets– The set of Natural numbers
N = {0, 1, 2, 3,…}– The set of Integers
Z = {…,-2,-1,0,1,2,…}– The set of Rational numbers
Q = {a/b | aZ bZ b0}– The set of Real numbers: R
Real numbers comprise all rational (eg. 1/2) and all irrational numbers (eg. 2).
(Note: There are numbers which are not real numbers, these are not covered in this course).
8
1. Sets
1.4 Predefined Sets (cont’d)– The superscript ‘+’ to Z, Q or R indicates
positive numbers (> 0)– The superscript ‘–’ to Z, Q or R indicates
negative numbers (< 0)– The superscript ‘nonneg’ to Z, Q or R
indicates positive numbers including 0.– Therefore, given that Z = {…,-2,-1,0,1,2,…},
Z+ = {1,2,3,…}
Z- = {-1,-2,-3,…}
Znonneg = {0,1,2,3,…}
9
1. Sets
1.5 Defining a Set– A set may be defined directly by listing every
element:
S = {2, 4, 6, 8, 10}– Or it may be defined indirectly by defining it in
terms of other sets:
S = {x | x Z, 1 x 10}
S = {x Z | 1 x 10}
Note: Read the symbol ‘|’ as ‘such that’– In general,
S = {element | element Another set, list of conditions}
S = {element Another set | list of conditions}
10
2. Visualization tool: Venn Diagram
A Venn Diagram is used to visualize relationships between sets.
1. Draw Sets as Circles. – Spatial relationship between circles is used to
depict set relationships
2. Draw Elements as Dots.
11
Outline
Sets– Defn & Notation– Examples– Remarks– Predefined Sets– Defining a set
Venn Diagrams Predicates
– Membership ()– Subset ()– Equality ()– Proper Subset ()
Functors– Union ()– Intersection ()– Difference ()– Complement (c)
Proofs Special sets
– Empty Set– Universal Set– Proofs
Set Equivalences More operations on sets
– Power Set– Cartesian product– Disjoint Unions
12
3. Predicates: 3.1 Definition: Set Membership ()
– If x is an element of a set A, we write
x AWe say “x is in A”, “x is a member of A”, or “x is an element of A”
– If x is NOT an element of a set A, we write x A
which is actually an abbreviation of(x A)
A2 1
1 A, 2 A
Venn Diagram:
13
3. Predicates:
3.1.1 Examples of ‘’:
• 1 {1, 2, 3}
• 1 {{1,2}, {4}, 5}
• {1} {{1,2}, {4}, 5}
• {1,2} {{1,2}, {4}, 5}
• {1,2} {1, 2, 3, 4, 5}
14
3. Predicates:
3.2 Definition: Subset (). Given 2 sets A and B,
A B iff x, xA xB
A
A B
B
15
3. Predicates:
Examples
3.2 Definition: Subset (). Given 2 sets A and B,
A B iff x, xA xB
• {1,2} {{1,2}}• {1,2} not {1,{2}}
• {1,2} {1,2,3}
• {1,2} Z
• {} {1,2}
• Is 2 {1,2,3} ?• Is {2} {1,2,3} ?
• Is {2} {2,{2}} ?
• Is 2 {1,2,3} ?• Is {2} {1,2,3} ?
• Is {2} {2,{2}} ?
Note the difference between ‘’ and ‘’. No.
Yes.
Yes.
Yes.
No.
Yes.
16
3. Predicates:
3.3 Definition: Set Equality (). Given 2 sets A, B,
A B iff A B B A
17
3. Predicates:
3.4 Definition: Proper Subset (). Given 2 sets A and B,
A B iff A B A B
A
A B
B
18
3. Predicates:
3.4 Definition: Proper Subset (). Given 2 sets A and B,
A B iff A B A B
Example:– {1,2} {1,2}– {1,2} {1,2,3}– Z+ Z– Z Q– Q R
19
Outline
Sets– Defn & Notation– Examples– Remarks– Predefined Sets– Defining a set
Venn Diagrams Predicates
– Membership ()– Subset ()– Equality ()– Proper Subset ()
Functors (Operation)– Union ()– Intersection ()– Difference ()– Complement (c)
Proofs Special sets
– Empty Set– Universal Set– Proofs
Set Equivalences More operations on sets
– Power Set– Cartesian product– Disjoint Unions
20
4. Operations (Functors) on sets
If A and B are sets, then
(a) A B (set union)
(b) A B (set intersection)
(c) A B (set difference)
(d) Ac (set complement)
are sets that obey the following axiomatic definitions:
– x, x (A B) iff xA xB– x, x (A B) iff xA xB– x, x (A B) iff xA xB– x, x Ac iff xA
Daffy-nitions
Don’t leave home without them!!!
21
4. Operations (Functors) on sets
A B
A B
BA
A B
BA
A B
A
Ac
22
5. Proofs
5.2 Prove that A (B C) (A B) (A C)
Proof:
Assume e A (B C) e A e (B C) e A (e B e C)
A (B C) (A B) (A C)
(e A e B) (e A e C) (e A B) (e A C)
e (A B) (A C)
(A B) (A C) A (B C)
Therefore A (B C) (A B) (A C)
23
5. Proofs
5.3 Prove that (A B)c Ac Bc
Proof:
Assume e (A B)c
e (A B)
(A B)c Ac Bc
~(e (A B)) ~(e A e B) e A e B
Ac Bc (A B)c
Therefore (A B)c Ac Bc
e Ac e Bc
e Ac Bc
24
5. Proofs
5.4 Prove that if A B then A B B
Proof:
e A e B
Case 1: e A
e B (Since A B)
Case 2: e B
e A e BAssume e A B
Therefore, if A B then A B B
e B
Assume e B
e A B
25
Outline
Sets– Defn & Notation– Examples– Remarks– Predefined Sets– Defining a set
Venn Diagrams Predicates
– Membership ()– Subset ()– Equality ()– Proper Subset ()
Functors– Union ()– Intersection ()– Difference ()– Complement (c)
Proofs Special sets
– Empty Set– Universal Set– Proofs
Set Equivalences More operations on sets
– Power Set– Cartesian product– Disjoint Unions
26
6.1 The Empty Set
Definition: The Empty Set ()– {} is a set with NO elements. – It is known as the empty set and is also denoted
as – It obeys the following axiom:
x, x {}or, worded in another way:
(x, x A) A = {} Misconceptions About the Empty Set:
– {} is an empty set– {{}} is NOT an empty set.
• {{}} has one element: {}• Always look at the outer brackets
– {{},{{}}} is NOT an empty set.
27
6.2 The Universal Set
Definition: The Universal Set (U)– U is a set with ALL elements. – It is known as the universal set– It obeys the following axiom:
x, x U
or, worded in another way:
(x, x A) A = U
28
6.3 Proofs involving and U
6.3.1 Theorem: For any set A, A.
29
6.3 Proofs involving and U
6.3.2 Show that there is only one empty set.
Q: How do we express the idea of ‘only one’?
A: Express it indirectly: ‘there cannot be two’
x, y, If P(x) and P(y), then x = y
Proof: if 1 and 2 be 2 empty sets, then 1 2 .
– Let 1 and 2 be 2 empty sets.
– By previous theorem, 1 2
(Since the empty set 1 must be the subset of any set)
– Also by previous theorem, 2 1
(Since the empty set 2 must be the subset of any set)
– Therefore 1 2, (by definition of set equality).
30
6.3 Proofs involving and U
6.3.3 Show that A A (Identity Law)
Proof:
Assume e A e A e e (since axiom of empty set: x, x )
e A
Assume e A e A e e A
Note that you can’t go backwards. As long as there is one reason used in the forward direction which is not an IFF reason, the way back is broken.
31
6.3 Proofs involving and U
6.3.4 Show that A (Universal Bound Law)
Proof:
e A e A e
BUT e (Since x, x )
We just need to show that A has no elements.
Remember the axiom: (x, x ???) ??? = {}
e
(By contradiction): Assume A has some element e.
Contradiction!Therefore e A .
Therefore A has no elements.
32
6.3 Proofs involving and U
6.3.5 Show that A Ac U (Complementation Law)
Proof:
e U
e A e A
e A e Ac
e A Ac
33
7. Set Equivalences
Set Equivalences are very similar to Logical Equivalences
– Intersection similar to – Union similar to – Complement similar to ~– Universal set similar to T– Empty set () similar to
List of identities in p247 and p260 of textbook
34
Outline
Sets– Defn & Notation– Examples– Remarks– Predefined Sets– Defining a set
Venn Diagrams Predicates
– Membership ()– Subset ()– Equality ()– Proper Subset ()
Functors– Union ()– Intersection ()– Difference ()– Complement (c)
Proofs Special sets
– Empty Set– Universal Set– Proofs
Set Equivalences More operations on sets
– Power Set– Cartesian product– Disjoint Unions
35
8 Power Set
8.1 Definition (Power Set): – Given a set A, the power set of A, denoted as P(A)
is the set of all subsets of A.– It obeys the following axiom:
S, (S A) (S P(A))
Examples:– A = {1,2}, P(A) = {{},{1},{2},{1,2}}– A = {1,2,3}, P(A)={{},{1},{2},{3},{1,2},{1,3},{2,3},
{1,2,3}}– A = {{1},{{2}}}
P(A)={{},{{1}},{{{2}}},{{1},{{2}}}}
36
8 Power Set , exercises
8.2 Show that for all sets: if A B, then P(A) P(B)
37
8 Power Set
Theorem: If A has n elements,
then P(A) has 2n elements.
Proof in recommended text (p264,p265)
38
9 Ordered n-tuple
9.1 Definition: (Ordered n-tuple)
Let n be a positive integer and x1,…,xn be (not necessarily unique) elements. An ordered n-tuple is a collection of n objects denoted as:
(x1,…,xn)
with x1 as the first element, x2 as the second element…xn as the nth element.
NOTE: Ordering of elements is important!
39
9 Ordered n-tuple
9.2 Examples:– (1,4,2,5,2) is an ordered 5-tuple– (4,3,3,4) is an ordered 4-tuple– (1,3,1) is an ordered 3-tuple, also known as
an ordered triplet.– (5,3) is an ordered 2-tuple, also known as
an ordered pair.– (3) is an ordered 1-tuple, also known as an
singleton.
40
9 Ordered tuples
9.3 Definition (Equality of ordered tuples) (x1,…,xn) = (y1,…,ym) iff
n=m and x1 = y1 and x2=y2 and … and xn=yn
9.4 Examples:– (1,a) (1,a,c)– (1,a,c) (1,c,a)– (1,a,c) (1,a,c)– (2,4,3) (1+1,22,5-2)
41
10. Cartesian Product
10.1 Definition (Cartesian Product)– Given 2 Sets A and B, the cartesian
product of A and B is denoted as A x B.
– It obeys the following axiom:(x,y) A B iff xA yB
– We can also write:A B = { (x,y) | xA yB}
Examples:– {1,2} x {2,3} = {(1,2),(1,3),(2,2),(2,3)}
42
10. Cartesian Product
10.1 Definition (Cartesian Product)– Given 2 Sets A and B, the cartesian
product of A and B is denoted as A x B.
– It obeys the following axiom:(x,y) A B iff xA yB
– We can also write:A B = { (x,y) | xA yB}
Examples:– {1,2,3} x {a,b}
= {(1,a),(2,a),(3,a), (1,b),(2,b),(3,b)}
43
10. Cartesian Product
10.1 Definition (Cartesian Product)– Given 2 Sets A and B, the cartesian
product of A and B is denoted as A x B.
– It obeys the following axiom:(x,y) A B iff xA yB
– We can also write:A B = { (x,y) | xA yB}
Examples:– {{1},2,{3,4}} x {a,b}
= { ({1},a), (2,a), ({3,4},a),
({1},b), (2,b), ({3,4},b)}
44
10. Cartesian Product
10.1 Definition (Cartesian Product)– Given 2 Sets A and B, the cartesian
product of A and B is denoted as A x B.
– It obeys the following axiom:(x,y) A B iff xA yB
– We can also write:A B = { (x,y) | xA yB}
Q: {1,2} x {} = ? A: {}
45
10. Cartesian Product
10.2 Definition (Generalised definition of cartesian product):
Given sets A1,…,An, A1 A2 … An is the set of all ordered n-tuples (x1,…,xn) where x1A1 x2A2 … xnAn
Examples:{1,2} x {2,3} x {a,b}
= {(1,2,a), (1,2,b), (1,3,a), (1,3,b), (2,2,a),
(2,2,b), (2,3,a), (2,3,b)}
46
10. Cartesian Product (Proofs)
10.3 Show that A x (B C) (A x B) (A x C)
Proof:
Assume (m,n) A x (B C) m A n (B C) m A (n B n C) (m A n B) (m A n C) ((m,n) A x B) ((m,n) A x C)
(m,n) (A x B) (A x C)
Therefore A x (B C) (A x B) (A x C)
47
11. Disjoint Unions
11.1 Definition:a. Two sets A and B are disjoint iff they
have no elements in common. In other words, A and B are disjoint A B =
b. A1,A2,…,An are mutually disjoint iff
i,j, Ai Aj =
c. {A1,A2,…,An } is a partition of A iff
i. A = A1 A2 … An
ii. A1,A2,…,An are mutually disjoint
48
11. Disjoint Unions
Partitioning a set
49
11. Disjoint Unions
11.2 Example: Let Z be the set of all integers.– Let A = {n Z | n = 3k for some integer k}– Let B = {n Z | n = 3k+1 for some integer k}– Let C = {n Z | n = 3k+2 for some integer k}
A = {…,-6,-3,0,3,6,…} B = {…,-5,-2,1,4,7,…} C = {…,-4,-1,2,5,8,…} A B = A C = B C = Z = A B C Therefore {A, B, C} form a partition of Z.
50
12. Summary: Axiomatic Definitions Subset: A B iff x, xA xB Set Equality: A B iff A B B A Strict Subset: A B iff A B A B Union: x, x (A B) iff xA xB Intersection: x, x (A B) iff xA xB Difference: x, x (A B) iff xA xB Complement: x, x Ac iff xA Empty Set: (x, x {}) …or…(x, x A) A = {} Universal Set: (x, x U) …or …(x, x A) A = U Power Set: S, (S A) (S P(A)) Tuple Equality: (x1,…,xn) = (y1,…,ym) iff
n=m x1 = y1 x2=y2 … xn=yn
Cartesian Prod:(x,y) A B iff xA yB Disjoint Union: …
51
Power sets, disjoint unions, ordered pairs and Cartesian Products are used in the lectures on Relations.
End of lecture