A B - Erwin Sitompul

Download Report

Transcript A B - Erwin Sitompul

Lecture 3
2. SETS
Discrete Mathematics
Dr.-Ing. Erwin Sitompul
http://zitompul.wordpress.com
Homework 2
No.1:
Given the statement “A valid password is necessary for you to
log on to the campus server.”
a) Express the statement above in the proposition form of
“if p then q.”
b) Determine also the negation, converse, inverse, and
contrapositive of the statement.
No.2:
Check the validity of the argument below:
“If 5 is less than 4, then 5 is not a prime number.”
“5 is not less than 4.”
“5 is a prime number.”
Erwin Sitompul
Discrete Mathematics
3/2
No.1:
Solution of Homework 2
“A valid password is necessary for you to log on to the campus
server.”
q is necessary for p
Solution:
a) “If you can log on to the campus server, then you have a
valid password.”
Negation: ~(p  q)  p  ~q
b) Negation:
“You can log on to the campus server even though you do
not have a valid password.”
Conversion:
Conversion: q  p
Inversion:
Inversion: ~p  ~q
“If you have a valid password, then you can log on to the
campus server.”
“If you cannot log on to the campus server, then you do not
have a valid password.”
Contrapositive:
Contrapositive: ~q  ~p
“If you do not have a valid password, then you cannot log on
to the campus server.”
Erwin Sitompul
Discrete Mathematics
3/3
No.2:
Solution of Homework 2
Check the validity of the argument below:
“If 5 is less then 4, than 5 is not a prime number.”
“5 is not less than 4.”
“5 is a prime number.”
Solution:
Define:
p : 5 is less than 4.
q : 5 is not a prime number.
Then, the above argument can be written as:
pq
~p
~q
 See line 3.
 Conclusion ~q is false, even when
all the hypotheses are right.
 Thus, the argument is
i n v a l i d.
Erwin Sitompul
Discrete Mathematics
3/4
Set Terminologies
A set is an unordered collection of different objects.
An object in a set is denoted as element or member.
A set is said to contain its elements.
Example:
 HIPMI, HKTI, Paguyuban
Pasunand, etc,
 PSMS, PSSI, AFC, FIFA.
 PUSU (PU Student Union),
PUSC (PU Student Council).
 A set of letters (capital letter
and lowercase).
Erwin Sitompul
Discrete Mathematics
3/5
Set Description
1. Enumeration
Each member of a set is mentioned in detail.
Example:
 The set of the first 4 natural numbers: A = { 1, 2, 3, 4 }.
 The set of the first 5 positive even integers:
B = { 2, 4, 6, 8, 10 }.
 C = { cat, a, Justin, 10, nail }.
 R = { a, b, {a, b, c}, {a, c} }.
 C = { a, {a}, {{a}} }.
 K = { {} }, where {} is a null set.
 The set of the first 100 natural numbers: { 1, 2, ..., 100 }.
 The set of integers: {…, –2, –1, 0, 1, 2, …}.
Erwin Sitompul
Discrete Mathematics
3/6
Set Description
Set membership
x  A : x is a member of set A.
x  A : x is not a member of set A.
Example:
Suppose A = { 1, 2, 3, 4 }, R = { a, b, {a, b, c}, {a, c} },
K ={ {} }, then:
 3A
 { a, b, c }  R
 {c}R
 {}K
 {}R
Erwin Sitompul
Discrete Mathematics
3/7
Set Description
Example:
If P1 = { a, b },
P2 = { { a, b } },
P3 = { { { a, b } } },
then
a  P1
a  P2
P1  P2
P1  P3
P2  P3
Erwin Sitompul
Discrete Mathematics
3/8
Set Description
2. Standard Symbols
P
N
Z
Q
R
C
= the set of positive integers = { 1, 2, 3, ... }.
= the set of natural numbers = { 1, 2, ... }.
= the set of integers = { ..., –2, –1, 0, 1, 2, ... }.
= the set of rational numbers.
= the set of real numbers.
= the set of complex numbers.
A set that contains all other sets is called: set universe, and is
denoted with U.
Example:
If U = { 1, 2, 3, 4, 5 }, then A is a member (subset) of U, where
A = { 1, 3, 5 }.
Erwin Sitompul
Discrete Mathematics
3/9
Set Description
3. Set Builder Notation
Notation: { x | properties of x }.
Example:
a) A is the a set of positive integer less than 5.
A = { x | x is a positive integer less than 5 }.
A = { x | x  P, x < 5 }.
A = { 1, 2, 3, 4 }.
b) M = { x | x is the student who attends the Discrete
Mathematics lecture today }.
Erwin Sitompul
Discrete Mathematics
3/10
Set Description
4. Venn Diagram
A method to graphically represent sets and the relation among
them.
Example:
Suppose U = { 1, 2, …, 7, 8 }, A = { 1, 2, 3, 5 }, and
B = { 2, 5, 6, 8 }.
Venn Diagram:
Erwin Sitompul
Discrete Mathematics
3/11
Cardinality
The cardinal of set A is defined as the number of the
members in A.
Notation: n(A) or A.
Example:
a) B = { x | x is a prime number less then 20 },
B = { 2, 3, 5, 7, 11, 13, 17, 19 },
thus B = 8.
b) T = { cat, a, Justin, 10, nail},
thus T = 5.
c) A = { a, {a}, {{a}} },
thus A = 3.
Erwin Sitompul
Discrete Mathematics
3/12
Null Set
A set with cardinal equals zero is called a null set.
Notation:  or { }.
Example:
a) E = { x | x < x },
thus n(E) = 0  E =  or E = { }.
b) P = { Indonesian people ever flied to the moon},
then n(P) = 0  P =  or P = { }.
c) A = { x | x is a real root of the quadratic equation
x2 + 1 = 0 }, then n(A) = 0  A =  or A = { }.
Erwin Sitompul
Discrete Mathematics
3/13
Subset
A set A is said to be the subset of B if and only if every
member of A is also a member of B. In this case, B is
called as superset of A.
Notation: A  B
Erwin Sitompul
Discrete Mathematics
3/14
Subset
Example:
a) { 1, 2, 3 }  { 1, 2, 3, 4, 5 }.
b) { 1, 2, 3 }  { 1, 2, 3 }.
c) N  Z  R  C.
A = { (x, y) | x + y < 4, x  0, y  0 } and
B = { (x, y) | 2x + y < 4, x  0 and y  0 },
then B  A.
d) If
Theorem 1.
For an arbitrary set A, the followings apply:
a) A is a subset of A itself (A  A).
b) The null set is a subset of A (  A).
c) If A  B and B  C, then A  C.
Erwin Sitompul
Discrete Mathematics
3/15
Proper and Improper Subset
In case of   A and A  A, then A is said to be improper
subset of A.
Example:
If A = { 1, 2, 3 }, then { 1, 2, 3 } and  are
improper subset of A.
 A  B is not the same as A  B.
 A  B : A is a subset of B, and A  B
A is a proper subset of B).
 A  B : A is a subset of B, but it is still allowed that A = B
(A is improper subset of B).
Erwin Sitompul
Discrete Mathematics
3/16
Proper and Improper Subset
Example:
Given A = { 1, 2, 3 } and B = { 1, 2, 3, 4, 5 }.
Determine all possibility for a set C so that A  C and C  B,
that is A is a proper subset of C and C is a proper subset of B.
Solution:
C must contain all members of set A = { 1, 2, 3 } and at least
one member of B which is not a member of A.
Therefore, C = { 1, 2, 3, 4 } or C = { 1, 2, 3, 5 }.
C may not contain 4 and 5 simultaneously, because C is a
proper subset of B.
Erwin Sitompul
Discrete Mathematics
3/17
Identical Sets
 A = B (A is identical to B) if and only if every member of A is a
member of B and conversely, every member of B is a
member of A.
 A = B if A is a subset of B and B is a subset of A. If it not the
case, then A  B.
 Notation: A = B  A  B and B  A
Example:
a) If A = { 0, 1 } and B = { x | x(x – 1) = 0 },
then A = B.
b) If A = { 3, 5, 8, 5 } and B = { 5, 3, 8 },
then A = B.
c) If A = { 3, 5, 8, 5 } and B = { 3, 8 },
then A  B.
Erwin Sitompul
Discrete Mathematics
3/18
Equivalent Sets
 A set A is said to be equivalent with set B if and only if the
cardinals of both sets are equal.
 Notation: A ~ B  A = B
Example:
If A = { 1, 3, 5, 7 } and B = { a, b, c, d },
then A ~ B, because A = B = 4.
Erwin Sitompul
Discrete Mathematics
3/19
Independent Sets
 Two sets A and B are said to be disjoint if both of them do not
have any common member.
 Notation: A // B
Example:
If A = { x | x  P, x < 8 } and B = { 10, 20, 30, ... },
then A // B.
Erwin Sitompul
Discrete Mathematics
3/20
Power Set
 The power set of A is a set whose members are all subset of
A, including the null set and set A itself.
 Notation : P(A) or 2A
 If A= m, then P(A)= 2m.
Example:
 If A = { 1, 2 },
then P(A) = { , { 1 }, { 2 }, { 1, 2 }}.
 If T = {cat, Justin, nail},
then P(T) = { , {cat}, {Justin}, {nail}, {cat, Justin}, {cat, nail},
{Justin, nail}, {cat, Justin, nail} }.
Erwin Sitompul
Discrete Mathematics
3/21
Set Operations
1. Intersection
Notation: A  B = { x | x  A and x  B }
Example:
 If A = { 2, 4, 6, 8, 10 } and B = { 4, 10, 14, 18 },
then A  B = { 4, 10 }.
 If A = { 3, 5, 9 } and B = { –2, 6 },
then A  B = , means A // B.
 A   = .
Erwin Sitompul
Discrete Mathematics
3/22
Set Operations
2. Union
Notation: A  B = { x | x  A or x  B }
Example:
 If A = { 2, 5, 8 } and B = { 7, 5, 22 },
then A  B = { 2, 5, 7, 8, 22 }.
 A   = A.
Erwin Sitompul
Discrete Mathematics
3/23
Set Operations
3. Complement
Notation: A = { x | x  U and x  A }
Example:
 Suppose U = { a, b, c, d, e, f, g, h, i, j }.
If A = { a, c, d, f, h, i },
then A = { b, e, g, j }.
 Suppose U = { x | x  P and x < 9 }.
If B = { x | x/2  P and x < 9 },
then B = { 1, 3, 5, 7 }.
Erwin Sitompul
Discrete Mathematics
3/24
Set Operations
Example:
Suppose:
A = set of all cars made in Indonesia.
B = set of all imported cars.
C = set of all cars produces before 2005.
D = set of all cars with market value less than Rp 150 millions.
E = set of all cars owned by PU students.
then:
(EA)(EB)  E(AB)
a) “All cars owned by PU students produced whether in
Indonesia or imported.”
ACD
b) “All cars made in Indonesia, produced before 2005, with
market value less than Rp.150 millions.”
c) “All imported cars, produced after 2005 which have market
value more than Rp.150 millions.”
BCD
Erwin Sitompul
Discrete Mathematics
3/25
Set Operations
4. Difference
Notation: A – B = { x | x  A and x  B } = A  B
Example:
 If A = { 1, 2, 3, ..., 10 } and B = { 2, 4, 6, 8, 10 },
then A – B = { 1, 3, 5, 7, 9 } and B – A = .
 { 1, 3, 5 } – { 1, 2, 3 } = { 5 },
but { 1, 2, 3 } – { 1, 3, 5 } = { 2 }.
Erwin Sitompul
Discrete Mathematics
3/26
Set Operations
5. Symmetric Difference
Notation: A  B = (A  B) – (A  B) = (A – B)  (B – A)
Example:
If A = { 2, 4, 6 } and B = { 2, 3, 5 },
then A  B = { 3, 4, 5, 6 }.
Erwin Sitompul
Discrete Mathematics
3/27
Set Operations
Example:
Suppose:
U = set of all students
P = set of students with mid exam grade > 80
Q = set of students with final exam grade > 80
A student gets an A if both his/her mid and final exam grades
are greater than 80, gets a B if one of the exams is greater than
80, and gets a C if both exams are less than 80. Then:
a)“All students who get A.”
PQ
b)“All students who get B.”
PQ
c) “All students who get C.”
Erwin Sitompul
U–(PQ)
PQ
Discrete Mathematics
3/28
Set Operations
5. Cartesian Product
Notation: A  B = { (a, b) | a  A or b  B }
Example:
 If C = { 1, 2, 3 } and D = { a, b },
then C  D = { (1, a), (1, b), (2, a), (2, b), (3, a), (3, b) }.
 Suppose
I = the set of all real numbers along x axis.
J = the set of all real numbers along y axis.
then I  J = the set of all points on xy plane.
Erwin Sitompul
Discrete Mathematics
3/29
Set Operations
Remarks:
1. If A and B are finite sets,
then A  B = A.B.
2. (a, b)  (b, a).
3. A  B  B  A, where A or B may not be a null set.
4. If A =  or B = , then A  B = B  A = .
Example:
 As given previously, C = { 1, 2, 3 } and D = { a, b },
C  D = { (1, a), (1, b), (2, a), (2, b), (3, a), (3, b) }.
D  C = { (a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3) }.
CDDC
Erwin Sitompul
Discrete Mathematics
3/30
Set Operations
Example:
Defining
A = set of food
= { s=soto, g=gado-gado, f=fried rice, n=instant noodle}
J = set of drinks
= { c=coca-cola, t=tea, m=mineral water }
How many combinations of food and drinks can be made out of
the two sets above?
Solution:
A  B = AB = 43 = 12 combination, which are:
{ (s, c), (s, t), (s, m), (g, c), (g, t), (g, m),
(f, c), (f, t), (f, m), (n, c), (n, t), (n, m) }.
Erwin Sitompul
Discrete Mathematics
3/31
Set Laws
Erwin Sitompul
Discrete Mathematics
3/32
Set Laws
Erwin Sitompul
Discrete Mathematics
3/33
Exercise
Example:
The next Venn diagram shows sets
A, B, and C in a set universe U.
Determine the regions
corresponding to the following
symbolic set notation:
3,4,6,7
h) A  B
a) A  B 1,2
i) (A – B) – C
b) B  C 1,3
c) A  C 1,2,3,4,5,7 j) A – (B – C)
k) (A  B)  C
d) B  A 4,7
l) A  (B  C)
e) A  B  C 1
m) (A  B) – C
f) (A  B)  C 2,6,7
n) (A  C) – B
g) (A  B) – C 2,6,7
Erwin Sitompul
7
1,4,7
1,5,6,7
1,5,6,7
3,4
4,8
Discrete Mathematics
3/34
Homework 3
Given U = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } as a set universe and the
sets :
A = { 1, 2, 3, 4, 5 },
B = { 4, 5, 6, 7 },
C = { 5, 6, 7, 8, 9 },
D = { 1, 3, 5, 7, 9 },
E = { 2, 4, 6, 8 },
F = { 1, 5, 9 }.
Determine:
a) A  C
b) A  B
c) A  F
d) (C  D)  E
e) (F – C) – A
Erwin Sitompul
Discrete Mathematics
3/35
Homework 3
New
No.1:
For the same problem as on the previous slide, determine:
f) (A  B)  (C  D)
i) (B –C)  F
g) (E  F) – A
j) (E – C)  A
h) B – (C  F)
No.2:
Out of 35 IE students from the same batch, 15 students are considering to
choose Management concentration, with 6 of them already give
confirmation. Meanwhile, 25 students are thinking to join Manufacturing
concentration and just 17 of them confirm already. Power Plant Management
concentration is considered by 4 students and only 1 student has not
confirmed yet.
If no students consider all 3 concentration simultaneously, sketch the Venn
diagram that can describe the situation above.
Erwin Sitompul
Discrete Mathematics
3/36