1.42k likes | 1.65k Views
Foundations of Discrete Mathematics. Chapter 2. By Dr. Dalia M. Gil, Ph.D. Sets. Set: A collection of things called elements or members. The set of natural numbers N consists of the numbers 1, 2,... Their members are all positive. Sets.
E N D
Foundations of Discrete Mathematics Chapter 2 By Dr. Dalia M. Gil, Ph.D.
Sets • Set: A collection of things called elements or members. • The set of natural numbers N consists of the numbers 1, 2,... Their members are all positive.
Sets • The set of integers Z consists of the natural numbers (1, 2, …), their negatives (…, -3, -2, …, 2, 3, …, and 0. • Zero (0) is an integer, but not a natural number.
Ways to Describe Sets • {egg1, egg2} • {x} • N = {1, 2, 3, …} • Z = {…, -3, -2, -1, 0, 1, 2, 3, …} This set has two elements This set has one element The set of natural numbers The set of integer numbers
Describing a Set with a Builder Notation { x|x has certain properties } such that We read: “The set of x such that x has certain properties.”
Describing a Set with a Builder Notation { some expression | the expression has certain properties } Example: the set of odd natural numbers. {n | n is an odd integer, n > 0} such that
Describing a Set with a Builder Notation Example: the set of odd natural numbers. {2k – 1 | k = 1, 2, 3, …} or {2k – 1 | k N} K belongs to N
Describing a Set with a Builder Notation • The symboldenoting set membership m Z m is an integer • negates the meaning of 0 N
Describing a Set with a Builder Notation • The set of rational numbers Q Q = {m/n| m, n Z, n ≠ 0} • The members of Q are fractions, which are ratios of integers with nonzero denominators. • Examples ¾, -2/17, 5(=5/1)
Describing a Set with a Builder Notation • The set of irrational numbers. • The members of irrational set cannot be written in the form m/n with m and n both integers. • The decimal expansions of the irrational numbers neither terminate or repeat. • Examples √2, 3√17, e, , ln 5
Describing a Set with a Builder Notation • The set of complex numbers C. • The members of complex set have the form a + bi where a and b are real numbers, i2 = -1 C = {a + bi | a, b R, i2 = -1}
Describing a Set with a Builder Notation • A set can be an element of another set {{a, b}, c} is a set with two elements, {a, b} and c.
Equality of Set • Sets A and B are equal, and we write A = B, if and only if A and B contain the same elements or neither set contains any element. • {1, 2, 1} = {1, 2} = {2, 1} • {1/2, 2/4, -3/-6}, /2} = {1/2} • {t|t = r – s, r, s {0, 1, 2}} = {-2, -1, 0, 1, 2}
The Empty Set • The empty set is a set that contains no elements. • P = {n N | 5n = 2} • S = {n N | n2 + 1 = 0} • The set small of people less than 1 millimeter. These sets are all equal since none of them contains any elements.
Subsets • A set A is a subset of a set B (A B), if and only if every element of A is an element of B. • If A B but A ≠ B, then A is called a proper subset of B and we write A B ≠
Subsets • A B A is contained in B A is a subset of B • B A B is superset of A
Examples of Subsets • {a, b} {a, b, c} {a,b} is a subset of {a,b,c} • {a, b} {a, b, c} ≠ {a,b} is a proper subset of {a,b,c}
Examples of Subsets • {a, b} {a, b, {a, b}} {a,b} is a subset of {a,b,{a,b}} {a,b} is an element of {a,b,{a,b}} • {a, b} {a, b, {a, b}} {a,b} belongs to {a,b,{a,b}}
Examples of Subsets N Z Q R C ≠ ≠ ≠ ≠ • The set of natural numbers is a proper subset of the set of integer numbers. • The set of integer numbers is a proper subset of the set of rational numbers.
Examples of Subsets N Z Q R C ≠ ≠ ≠ ≠ • The set of rational numbers is a proper subset of the set of real numbers. • The set of real numbers is a proper subset of the set of complex numbers.
Subsets. Proposition 1 • For any set A, A A and A Proof • If a A, then a A, so A A • If A is false, then there must exist some x such that x A. This an absurdity since there is no x
Subsets. Proposition 2 • If A and B are sets, then A = B if and only if A B and B A Proof () If A = B, then A is a subset of B and B is a subset of A. () If A is a subset of B and B is a subset of A, then A = B.
Subsets. Proposition 2 • a b membership a b, a is an element of the set b. • a b subset a b, a is a set each of whose elements is also in the set b.
The Power Set • The power set of a set A, denoted P(A), is the set of all subsets of A: P(A) = {B | B A}
Examples of The Power Set • If A = {a}, then P(A) = {, {a}} • If A = {a, b}, then P(A) = {, {a}, {b}, {a, b}} • P ({a, b, c}) = {, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}
Union and Intersection • The union of sets A and B, A B, is the set of elements in A or in B (or in both). • The intersection of sets A and B, A B, is the set of elements that belongs to both A and B.
Examples: Union and Intersection • If A = {a, b, c} and b = {a, x, y, b} • A B = { a, b, c, x, y} • A B = {a, b} • A {} = {a, b, c, } • B {} =
Examples: Union and Intersection • For any set A, A = A and A =
Union and Intersection • The union and intersection of sets are associative operations. • (A1 A2) A3 = A1 (A2 A3) • For any three sets A1, A2, A3 , the expression A1 A2 A3 is unambiguous.
Union and Intersection • The union of n sets A1 A2 A3 … An is written n Ai i=1 • Represents the set of elements that belong to one or more of the sets Ai
Union and Intersection • The intersection the sets A1, A2, … An is written n Ai i=1 • Represents the set of elements which belong to all of the sets Ai
Union and Intersection • A = {1, 2, 3, 4} • B = {3, 4, 5, 6} • C = {2, 3, 5, 7} • B C= {2, 3, 4, 5, 6, 7} • A (B C)= {2, 3, 4}
Union and Intersection • A = {1, 2, 3, 4} • B = {3, 4, 5, 6} • C = {2, 3, 5, 7} • A B = {3, 4} • (A B) C= {2, 3, 4, 5, 7}
Union and Intersection A (B C)= {2, 3, 4} (A B) C= {2, 3, 4, 5, 7} A (B C) ≠ (A B) C
Union and Intersection A (B C)= {2, 3, 4} (A B) = {3, 4} (A C)= {2, 3} (A B) (A C)= {2, 3, 4} A (B C) = (A B) (A C)
Union and Intersection Let A, B, and C be sets. Verify A (B C) = (A B) (A C) Solution using proposition 2: If A and B are sets, then A = B if and only if A B and B A
Union and Intersection To show A, B, and C be sets. Verify A (B C) (A B) (A C) Let x A (B C) Then x is in A and also in B C, Since x B C, either x B or x C. This suggests two cases
Union and Intersection Case 1: x B In this case, is in A as well as in B, so it’s in A B Case 2: x C In this case, is in A as well as in B, so it’s in A C
Union and Intersection We have shown that either x A Borx A C By definition of union, x (A B) (A C)
Union and Intersection We must show thatA (B C) (A B) (A C) Let x (A B) (A C) Then either x (A B) or x (A C) Thus, x is in both A and B or in both A and C. In either case x A. Also x is in either B or C; thusx B C
Union and Intersection We must show thatA (B C) (A B) (A C) Let x (A B) (A C) Then either x (A B) or x (A C) So x is in both A and in B C ; that is x A ( B C).
Set Difference • The set difference of sets A and B (A\ B), is the set of those elements of A that are not in B. • The complement of a set A is the set Ac = U \ A, where U is some universal set made clear by the context.
Examples: Set Difference • {a, b, c} \ {a, b} = {c} • {a, b, c} \ {a, x} = {b, c} • {a, b, } \ = {a, b}
Examples: Set Difference • {a, b, } \ {} = {a, b, } • If A is the set {Monday, Tuesday, Wednesday, Thursday, Friday}, so • Ac = {Saturday, Sunday}
Examples: Set Difference • A \ B = A Bc and (Ac)c= A Example (suppose U = Z): If A = {x Z | x2 > 0}, then Ac ={0} (Ac)c = {0}c = {x Z | x ≠ 0} = A
Interval Notation • If a and b are real numbers with a < b, then • [a, b] = {x R | a ≤ x ≤ b} closed • (a, b) = {x R | a < x < b} open
Interval Notation • If a and b are real numbers with a < b, then • (a, b] = {x R | a < x ≤ b} half open • [a, b) = {x R | a ≤ x < b} half open
The Laws of De Morgan • (A B)c = Ac Bc • (A B)c = Ac Bc
Prove that (A B)c = Ac Bcfor any set A, B, and C. • Let A be the statement “x A” and B be the statement “x B” x (A B)c ¬(x A B)
Prove that (A B)c = Ac Bc for any set A, B, and C. x (A B)c ¬(x A B) ¬(A or B) Definition of union ¬A and ¬B Rule for negating “or” x Ac and x Bc x Ac Bc Definition of intersection