Presentation is loading. Please wait.

Presentation is loading. Please wait.

Instructor: Hayk Melikya

Similar presentations


Presentation on theme: "Instructor: Hayk Melikya"— Presentation transcript:

1 Instructor: Hayk Melikya melikyan@nccu.edu
  Sets Section 6.1 Basic Definitions of Sets Theory Section 6.2 Properties of sets Section 6.3 Proofs and Boolean Algebras   The most fundamental notion in all of mathematics is that of a set. We say that a set is a specified collection of objects, called elements (or members) of the set. We denote sets by capital letters A, B, … and elements by lower case letters, like x, y , … and so on. If an element x belongs to a set A, we denote this by x  A, if not we write x A. The slides for this text are organized into chapters. This lecture covers Chapter 1. Chapter 1: Introduction to Database Systems Chapter 2: The Entity-Relationship Model Chapter 3: The Relational Model Chapter 4 (Part A): Relational Algebra Chapter 4 (Part B): Relational Calculus Chapter 5: SQL: Queries, Programming, Triggers Chapter 6: Query-by-Example (QBE) Chapter 7: Storing Data: Disks and Files Chapter 8: File Organizations and Indexing Chapter 9: Tree-Structured Indexing Chapter 10: Hash-Based Indexing Chapter 11: External Sorting Chapter 12 (Part A): Evaluation of Relational Operators Chapter 12 (Part B): Evaluation of Relational Operators: Other Techniques Chapter 13: Introduction to Query Optimization Chapter 14: A Typical Relational Optimizer Chapter 15: Schema Refinement and Normal Forms Chapter 16 (Part A): Physical Database Design Chapter 16 (Part B): Database Tuning Chapter 17: Security Chapter 18: Transaction Management Overview Chapter 19: Concurrency Control Chapter 20: Crash Recovery Chapter 21: Parallel and Distributed Databases Chapter 22: Internet Databases Chapter 23: Decision Support Chapter 24: Data Mining Chapter 25: Object-Database Systems Chapter 26: Spatial Data Management Chapter 27: Deductive Databases Chapter 28: Additional Topics Instructor: Hayk Melikya

2 Specifying set There are various ways to specify a set. For the set of natural numbers less than or equal to 5, you could write {1, 2, 3, 4, 5} . For sets that cannot be specified by a list, we describe the elements by some property common to the elements in the set but no others, such as in the description A = { x | P (x)} which reads “the set of all x such that the condition P(x) is true.”

3 Common Sets:

4 Subsets We say that a set A is a subset of a set B if every element of A is also an element of B. Symbolically, we write this as A  B and is read “A is contained in B.” Finally, the notation A  B means that A is not a subset of B. Sets are often illustrated by Venn diagrams, where sets are represented as circles and elements of the set are points inside the circle.

5 Equality of Sets: Two sets are equal (A = B) if they consist of exactly the same elements. In other words, they are equal if (A = B) if and only if (x) (( xA  x B) or (A = B) iff (x) (( xA  x B)  (xB  x A )) another way: (A = B) if and only if (A  B  B  A). Empty Set: The set with no elements is called the empty set (or null set) and denoted by the Greek letter  (or sometimes the empty bracket { } )

6 Theorem 1 (Guaranteed Subset) For any set A, we have   A.
Proof : Since the goal is to show x    x  A our job is done before we begin. The reason being that the hypothesis x   of the implication is false, being that  contains no elements, hence the proposition is true regardless of the set A. In other words  is a subset of any set. END

7 Theorem 2 (Transitive Subsets) Let A, B and C be sets
Theorem 2 (Transitive Subsets) Let A, B and C be sets If A  B and B  C then A  C . Proof: We will prove the conclusion A  C and use the hypothesis as needed. Letting x  A the goal is to show x  C . Since x  A and using the assumption A  B , we know x  B . But the second hypothesis says B  C , and so we know x  C . Hence, we have proved A  C , which proves the theorem. END

8 Subset and Membership:

9 Power Set P(A) An important set in mathematics is the power set. For every set A, we denote by P(A) the set of all subsets of A. Theorem 3 (Power Set) Let A and B be sets. Then A  B if and only if P (A)  P(B). Proof: (A  B)  (P(A)  P(B)): We start by letting X  P(A) and show X  P(B) (and use A  B as our “helper”). Letting X  P(A) we have X  A and hence X  B. But this means X  P(B) and so we have shown P(A)  P(B) . (P(A)  P(B)) (A  B) : We let x  A and show x  B . If x  A, then {x }  P(A) , and since P(A)  P(B) we know {x }  P(B) . But this means x  B and so A  B .

10 Sec 6.2 Operations on Sets Union, Intersection and Complement
In traditional arithmetic and algebra, we carry out the binary operations of + and × on numbers. In logic, we have the analogous binary operations of  and  on sentences. In set theory we have the binary operations of union  and intersection  of sets, which in a sense are analogous to the ones in arithmetic and sentential logic. Definition ( Union): The union of two sets A and B, denoted A  B , is the set of elements that belong to A or B or both. Symbolically A  B = {x | x  A  x  B }

11 Definition ( Intersection):
The intersection of two sets A and B, denoted A  B , is the set of elements that belong to A and B. Symbolically A  B = {x | x  A  x  B }

12 Definition( Complement):
The compliment of A, denoted Ac is the set of elements belonging to the universal set U but not A. Symbolically Ac = {x | x ÎU  x  A } .

13 Definition (Relative Complement or Difference):
The relative complement of A in B, denoted, B \ A, is the set of elements in B but not in A. Symbolically B \ A = {x | x  B  x  A } The concepts of union, intersection and relative complement of sets can be illustrated graphically by use of Venn diagrams. Each Venn diagram begins with an oval representing the universal set, a set that contains all elements of in discussion. Then, each set in the discussion is represented by a circle, where elements belonging to more than one set are placed in sections where circles overlap.

14 Venn diagrams for two overlapping sets.

15

16

17

18

19

20

21

22 Set Identities Commutative Laws: A  B = A  B and A  B = B  A
Associative Laws: (A  B)  C = A  (B  C) and (A  B)  C = A  (B  C) Distributive Laws: A  (B  C) = (A  B)  (A  C) and A  (B  C) = (A  B)  (A  C) Intersection and Union with universal set: A  U = A and A  U = U Double Complement Law: (Ac)c = A Idempotent Laws: A  A = A and A  A = A De Morgan’s Laws: (A  B)c = Ac  Bc and (A  B)c = Ac  Bc Absorption Laws: A  (A  B) = A and A  (A  B) = A Alternate Representation for Difference: A – B = A  Bc Intersection and Union with a subset: if A  B, then A  B = A and A  B = B

23 Exercises Is is true that (A – B)  (B – C) = A – C?
Show that (A  B) – C = (A – C)  (B – C) Is it true that A – (B – C) = (A – B) – C? Is it true that (A – B)  (A  B) = A?

24 Set Partitioning Two sets are called disjoint if they have no elements in common Theorem: A – B and B are disjoint A collection of sets A1, A2, …, An is called mutually disjoint when any pair of sets from this collection is disjoint A collection of non-empty sets {A1, A2, …, An} is called a partition of a set A when the union of these sets is A and this collection consists of mutually disjoint sets

25 Power Set Power set of A is the set of all subsets of A
Theorem: if A  B, then P(A)  P(B) Theorem: If set X has n elements, then P(X) has 2n elements. Proof. (By Induction)

26 Boolean Algebra Boolean Algebra is a set of elements together with two operations denoted as + and * and satisfying the following properties: a + b = b + a, a * b = b * a (a + b) + c = a + (b + c), (a * b) *c = a * (b * c) a + (b * c) = (a + b) * (a + c), a * (b + c) = (a * b) + (a * c) a + 0 = a, a * 1 = a for some distinct unique 0 and 1 a + ã = 1, a * ã = 0

27 Exercises Simplify: A  ((B  Ac)  Bc)
Symmetric Difference: A  B = (A – B)  (B – A) Show that symmetric difference is associative Are A – B and B – C necessarily disjoint? Are A – B and C – B necessarily disjoint?

28 Russell’s Paradox Set of all integers, set of all abstract ideas
Consider S = {A, A is a set and A  A} Is S an element of S? Barber puzzle: a male barber shaves all those men who do not shave themselves. Does the barber shave himself? Consider S = {A  U, A  A}. Is S  S?


Download ppt "Instructor: Hayk Melikya"

Similar presentations


Ads by Google