CS 3630 Database Design and Implementation

Slides:



Advertisements
Similar presentations
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Advertisements

Analytical Methods in CS (CIS 505)
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
February 5, 2015Applied Discrete Mathematics Week 1: Logic and Sets 1 Homework Solution PQ  (P  Q) (  P)  (  Q)  (P  Q)  (  P)  (  Q) truetruefalsefalsetrue.
Survey of Mathematical Ideas Math 100 Chapter 2
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
Subsets. Subsets are sort of like nested Russian dolls: the subset “fits inside” the set.
Discrete Mathematics Unit - I. Set Theory Sets and Subsets A well-defined collection of objects (the set of outstanding people, outstanding is very subjective)
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Sets --- A set is a collection of objects. Sets are denoted by A, B, C, … --- The objects in the set are called the elements of the set. The elements are.
SET THEORY. BASIC CONCEPTS IN SET THEORY Definition: A set is a collection of well-defined objects, called elements Examples: The following are examples.
1 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} R  A1  A2.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
1 Set Theory Foundation of Relational Database Systems E.F. Codd.
Mathematical Proofs. Chapter 1 Sets 1.1 Describing a Set 1.2 Subsets 1.3 Set Operations 1.4 Indexed Collections of Sets 1.5 Partitions of Sets.
1. Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element of A” A = {a 1, a 2,
Thinking Mathematically Chapter 2 Set Theory 2.1 Basic Set Concepts.
Sets 2/10/121. What is a Set? Informally, a collection of objects, determined by its members, treated as a single mathematical object Not a real definition:
9.1 Sets, Intersections, and Unions  Standard 1.0  8 Key Terms.
Lecture 2.1: Sets and Set Operations CS 250, Discrete Structures, Fall 2014 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Sets.
12/19/20151 … and now for something completely different… Set Theory Actually, you will see that logic and set theory are very closely related.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Wed, Mar 8, 2006.
Basic Definitions of Set Theory Lecture 24 Section 5.1 Fri, Mar 2, 2007.
Lecture 3 Fuzzy sets. 1.1 Sets Elements of sets An universal set X is defined in the universe of discourse and it includes all possible elements.
Discrete Mathematics Set.
Material Taken From: Mathematics for the international student Mathematical Studies SL Mal Coad, Glen Whiffen, John Owen, Robert Haese, Sandra Haese.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Mon, Feb 21, 2005.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Fr: Discrete Mathematics by Washburn, Marlowe, and Ryan.
Introduction to Graph Theory & its Applications
CS 3630 Database Design and Implementation. 2 Set Theory Foundation of Relational Database Systems E.F. Codd.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
2004/10/5fuzzy set theory chap03.ppt1 Classical Set Theory.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
C Sc 132 Computing Theory Professor Meiliu Lu Computer Science Department.
The Basic Concepts of Set Theory. Chapter 1 Set Operations and Cartesian Products.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
“It is impossible to define every concept.” For example a “set” can not be defined. But Here are a list of things we shall simply assume about sets. A.
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Applied Discrete Mathematics Week 1: Logic and Sets
CHAPTER 2 Set Theory A B C.
Discrete Mathematical The Set Theory
Set, Combinatorics, Probability & Number Theory
CS1022 Computer Programming & Principles
CS 3630 Database Design and Implementation
… and now for something completely different…
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Algebra 1 Section 1.1.
Textbook Handout We will go up by sections to get the Finite Book
Set-Builder Notation.
CS 3630 Database Design and Implementation
2.1 Sets Dr. Halimah Alshehri.
Applied Discrete Mathematics Week 2: Proofs
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Discrete Mathematics CS 2610
CSE 321 Discrete Structures
Applied Discrete Mathematics Week 3: Sets
CSE 321 Discrete Structures
… and now for something completely different…
2.1 – Symbols and Terminology
Basic Definitions of Set Theory
CSE 321 Discrete Structures
Sets CS3240, L. grewe.
Terminology and Symbols
Presentation transcript:

CS 3630 Database Design and Implementation

Foundation of Relational Database Systems Set Theory Foundation of Relational Database Systems E.F. Codd 40 minutes for S1 50 minutes for S2

Basic Concepts A set is a collection of elements From a known background “Universe” A definition we are satisfied with Everything is in the “Universe” An element could be any thing

Examples All UWP students in CS363 this semester A = {UWP students in CS363 this semester} B = {All UWP students who play Bridge} Specifying the conditions of the elements in the set C = {1, 2, 3, 4} Listing all elements I = {i: i is an integer}

Number of Elements of a Set A = {UWP students in CS363 this semester} 56 B = {All UWP students who play Bridge} ? C = {1, 2, 3, 4} 4 I = {i: i is an integer}

Cardinality C = {1, 2, 3, 4} |C| = 4 A = {UWP students in CS363 this semester} |A| = 56 I = {i: i is an integer} |I| =  (Number of elements of finite sets)

No repeating elements {1, 2, 3, 4, 2} Not a set in classic set theory Elements are not ordered {1, 2, 3, 4} {2, 4, 1, 3} The same set

Empty Set A = {UWP students in CS363 this semester} D = {s | s in A and has attended Turing Award ceremony} D = {} =  This is not empty set: {} It’s a set with one element and the only element is an empty set

Sets and Elements S is a set X is an element in the “Universe” Two possibilities: x is in S (x  S) or x is not in S (x  S)

Subsets For two sets A and B and any element x, if x  A then x  B Then A is a subset of B A  B or B  A (similar to A < B or B > A) A could be the same as B A  B or B  A (similar to A <= B or B >= A) They are the same:  and 

Subsets For two sets A and B and any element x, if x  A then x  B Then A is a subset of B A is not a subset of B There is an element x such that x  A and x  B

Subsets For any set X,   X No element e such that e   and e  X

Proper Subsets For any set X,   X X  X A is a proper subset of B, if all the three conditions are true: A  B (A  B) A  B A  

Power Set For any set X, P(X) = {S | S is a subset of X} = {S | S  X} C = {1, 2, 3, 4} P(C) = {{1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4}, {}}

Power Set C = {1, 2, 3, 4} P(C) = {{1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4}, {}} }

The cardinality of the power set X is a set and its cardinality is |X| The power set of X is P(X) and its cardinality is |P(X)| = 2|X|

Example I C = {1, 2, 3, 4} |C| = 4 P(C) = {{1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4}, {2, 3, 4}, {1, 2, 3, 4}, } |P(C)| = 24 = 16

Example II X = {x0, x1, x2, x3, x4, x5, x6, x7} |X| = 8 |P(X)| = 28 1 0 0 1 1 0 0 0 The same as a byte with 8 bits.

Set Operations Set Union A  B = {x: x  A or x  B} A = {1, 2, 3, 4} = {1, 2, 3, 4, 5} = B  A Range of |A  B|? Max (|A|, |B|) <= |A  B| <= |A| + |B|

Set Intersection A  B = {x: x  A and x  B} A = {1, 2, 3, 4} = {2} = B  A Range of |A  B| ? 0 <= |A  B| <= Min(|A|, |B|)

Set Difference A – B = {x: x  A but x  B} A = {1, 2, 3, 4} = {1, 3, 4}  B - A B – A = {5} Range of |A – B|?

A  B = {(a, b): a  A and b  B} Cartesian Product A  B = {(a, b): a  A and b  B} A = {1, 2, 3, 4} B = {2, 5} = {(1, 2), (1, 5), (2, 2), (2, 5), (3, 2), (3, 5), (4, 2), (4, 5)} A  B  B  A |A  B| = |A|  |B|

Cartesian Product (II) Multiple sets A1, A2, A3, …, An A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} It is possible for some i and j, Ai = Aj. A = {1, 2, 3, 4} B = {2, 5} A  B  B = {(a, b, c): a  A and b  B and c  B} = {(1, 2, 2), (1, 5, 2), (2, 2, 2), (2, 5, 2), (3, 2, 2), (3, 5, 2), (4, 2, 2), (4, 5, 2), (1, 2, 5), (1, 5, 5), (2, 2, 5), (2, 5, 5), (3, 2, 5), (3, 5, 5), (4, 2, 5), (4, 5, 5)}

Assignment 1 Due Wednesday (week 2), February 1 at noon Download a copy of the assignment and re-name it as UserName_A1.doc(x) For example, YangQ_A1.doc Complete the assignment and drop it to K:\Courses\CSSE\yangq\CS3630\1DropBox