discrete mathematics
DESCRIPTION
Discrete Mathematics. 2. SETS. Lecture 3. 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. ” - PowerPoint PPT PresentationTRANSCRIPT
Discrete Mathematics
2. SETS
Lecture 3
Dr.-Ing. Erwin Sitompulhttp://zitompul.wordpress.com
3/2Erwin Sitompul Discrete Mathematics
Homework 2
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.
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.”
No.1:
No.2:
3/3Erwin Sitompul Discrete Mathematics
“A valid password is necessary for you to log on to the campus server.”
Solution of Homework 2
a) “If you can log on to the campus server, then you have a valid password.”b) Negation:
“You can log on to the campus server even though you do not have a valid password.”Conversion:“If you have a valid password, then you can log on to the
campus server.”Inversion:“If you cannot log on to the campus server, then you do not have a valid password.”Contrapositive:“If you do not have a valid password, then you cannot log on to the campus server.”
Solution: q is necessary for p
Negation: ~(p q) p ~q
Conversion: q p
Inversion: ~p ~q
Contrapositive: ~q ~p
No.1:
3/4Erwin Sitompul Discrete Mathematics
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:
Solution of Homework 2No.2:
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.
3/5Erwin Sitompul Discrete Mathematics
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).
3/6Erwin Sitompul Discrete Mathematics
Set Description
1. EnumerationEach 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, …}.
3/7Erwin Sitompul Discrete Mathematics
Set Description
Set membershipx 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
3/8Erwin Sitompul Discrete Mathematics
Example:If P1 = { a, b },
P2 = { { a, b } },P3 = { { { a, b } } },
thena P1
a P2
P1 P2
P1 P3
P2 P3
Set Description
3/9Erwin Sitompul Discrete Mathematics
Set Description
2. Standard SymbolsP = the set of positive integers = { 1, 2, 3, ... }.N = the set of natural numbers = { 1, 2, ... }.Z = the set of integers = { ..., –2, –1, 0, 1, 2, ... }.Q = the set of rational numbers.R = the set of real numbers.C = 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 }.
3/10Erwin Sitompul Discrete Mathematics
Set Description
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 }.
3. Set Builder NotationNotation: { x | properties of x }.
3/11Erwin Sitompul Discrete Mathematics
4. Venn Diagram
Set Description
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:
3/12Erwin Sitompul Discrete Mathematics
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.
3/13Erwin Sitompul Discrete Mathematics
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 = { }.
3/14Erwin Sitompul Discrete Mathematics
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
3/15Erwin Sitompul Discrete Mathematics
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.
Example:a) { 1, 2, 3 } { 1, 2, 3, 4, 5 }.
b) { 1, 2, 3 } { 1, 2, 3 }.
c) N Z R C.
d) If 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.
Subset
3/16Erwin Sitompul Discrete Mathematics
In case of A and A A, then A is said to be improper subset of A.
Proper and Improper Subset
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 BA 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).
3/17Erwin Sitompul Discrete Mathematics
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.
Proper and Improper Subset
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.
3/18Erwin Sitompul Discrete Mathematics
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.
3/19Erwin Sitompul Discrete Mathematics
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.
3/20Erwin Sitompul Discrete Mathematics
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.
3/21Erwin Sitompul Discrete Mathematics
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} }.
3/22Erwin Sitompul Discrete Mathematics
1. IntersectionNotation: A B = { x | x A and x B }
Set Operations
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 = .
3/23Erwin Sitompul Discrete Mathematics
2. UnionNotation: A B = { x | x A or x B }
Set Operations
Example: If A = { 2, 5, 8 } and B = { 7, 5, 22 },
then A B = { 2, 5, 7, 8, 22 }. A = A.
3/24Erwin Sitompul Discrete Mathematics
3. ComplementNotation: A = { x | x U and x A }
Set Operations
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 }.
3/25Erwin Sitompul Discrete Mathematics
Set OperationsExample: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:a) “All cars owned by PU students produced whether in
Indonesia or imported.”
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.”
(EA)(EB) E(AB)
ACD
BCD
3/26Erwin Sitompul Discrete Mathematics
4. DifferenceNotation: A – B = { x | x A and x B } = A B
Set Operations
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 }.
3/27Erwin Sitompul Discrete Mathematics
5. Symmetric DifferenceNotation: A B = (A B) – (A B) = (A – B) (B – A)
Set Operations
Example:If A = { 2, 4, 6 } and B = { 2, 3, 5 }, then A B = { 3, 4, 5, 6 }.
3/28Erwin Sitompul Discrete Mathematics
U–(PQ)
Example:Suppose:U = set of all studentsP = set of students with mid exam grade > 80Q= set of students with final exam grade > 80A 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.”
b) “All students who get B.”
c) “All students who get C.”
Set Operations
PQ
PQ
PQ
3/29Erwin Sitompul Discrete Mathematics
5. Cartesian ProductNotation: A B = { (a, b) | a A or b B }
Set Operations
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.
3/30Erwin Sitompul Discrete Mathematics
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 = .
Set Operations
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
3/31Erwin Sitompul Discrete Mathematics
Set Operations
Example:DefiningA = 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 = AB = 43 = 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) }.
3/32Erwin Sitompul Discrete Mathematics
Set Laws
3/33Erwin Sitompul Discrete Mathematics
Set Laws
3/34Erwin Sitompul Discrete Mathematics
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:
a) A B
b) B C
c) A C
d) B A
e) A B C
f) (A B) C
g) (A B) – C
h) A B
i) (A – B) – C
j) A – (B – C)
k) (A B) C
l) A (B C)
m) (A B) – C
n) (A C) – B
1,2 1,3
1,2,3,4,5,7
4,7 1
2,6,7
2,6,7
3,4,6,7
1,4,7
7
1,5,6,7 1,5,6,7
3,4
4,8
3/35Erwin Sitompul Discrete Mathematics
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 Cb) A Bc) A Fd) (C D) E e) (F – C) – A
3/36Erwin Sitompul Discrete Mathematics
Homework 3
For the same problem as on the previous slide, determine:f) (A B) (C D) i) (B –C) Fg) (E F) – A j) (E – C) Ah) B – (C F)
NewNo.1:
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.