CS 3630 Database Design and Implementation

Slides:



Advertisements
Similar presentations
Countability. The cardinality of the set A is equal to the cardinality of a set B if there exists a bijection from A to B cardinality? bijection? injection.
Advertisements

Basic Structures: Functions and Sequences
Chapter 2 The Basic Concepts of Set Theory
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday February 1, 2007.
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Sequence A list of objects arranged in a particular order.
Lecture ,3.3 Sequences & Summations Proof by Induction.
Cardinality of a Set “The number of elements in a set.” Let A be a set. a.If A =  (the empty set), then the cardinality of A is 0. b. If A has exactly.
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
ORDINAL NUMBERS VINAY SINGH MARCH 20, 2012 MAT 7670.
THE NATURE OF SETS Copyright © Cengage Learning. All rights reserved. 2.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Sequences & Summations CS 1050 Rosen 3.2. Sequence A sequence is a discrete structure used to represent an ordered list. A sequence is a function from.
Sequences and Summations
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
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.
Mathematical Induction
1 Set Theory Foundation of Relational Database Systems E.F. Codd.
Relations, Functions, and Countability
Lecture V Probability theory. Lecture questions Classical definition of probability Frequency probability Discrete variable and probability distribution.
Entity-Relationship Model Chapter 3 II COSC 457 Sungchul Hong.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 09: SEQUENCES Section 3.2 Jarek Rossignac CS1050: Understanding.
INFIINITE SETS CSC 172 SPRING 2002 LECTURE 23. Cardinality and Counting The cardinality of a set is the number of elements in the set Two sets are equipotent.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Discrete Mathematics Set.
Math 51/COEN 19. Sequences and Summations - vocab An arithmetic progression is a sequence of the form a, a+d, a+2d, …, a+nd, … with fixed a, d in R and.
CS 285- Discrete Mathematics
CS 3630 Database Design and Implementation. 2 Set Theory Foundation of Relational Database Systems E.F. Codd.
CS 3630 Database Design and Implementation. 2 Mathematical Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
Department of Mathematics
CS336 F07 Counting 2. Example Consider integers in the set {1, 2, 3, …, 1000}. How many are divisible by either 4 or 10?
Set Builder Notation. If you recall, a set is a collection of objects which we write using brackets and name using a capital letter. Remember also that:
DBM 384 Week 1 Assignment Database Matrix Check this A+ tutorial guideline at 384/DBM-384-Week-1-Assignment-Database-
ESE 697 Week 4 Assignment Lesson Plan 4 Mathematics Check this A+ tutorial guideline at ASH/ESE-697-Week-4-Assignment-Lesson-Plan-
BIS 320 Week 3 Individual Assignment- Determining Databases and Data Communications Check this A+ tutorial guideline at
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
Discrete Mathematics CS 2610
Department of Mathematics
CS 3630 Database Design and Implementation
CS 2210:0001 Discrete Structures Sets and Functions
Applied Discrete Mathematics Week 10: Relations
What is Probability? Quantification of uncertainty.
Cartesian product Given two sets A, B we define their Cartesian product is the set of all the pairs whose first element is in A and second in B. Note that.
Function Hubert Chan (Chapter 2.1, 2.2) [O1 Abstract Concepts]
2.4 Sequences and Summations
Young man, in mathematics you don't understand things
CS723 - Probability and Stochastic Processes Lecture 01
Counting Sets.
Cardinality of Sets Section 2.5.
Finite and Infinite Sets
Countable or Uncountable…That is the question!
Discrete Math (2) Haiming Chen Associate Professor, PhD
Introduction to Measure Theory
Discrete Structures for Computer Science
CS 3630 Database Design and Implementation
CS 3630 Database Design and Implementation
Countable and Countably Infinite Sets
Lesson 5 Relations, mappings, countable and uncountable sets
CHAPTER 2 Set Theory.
DAY 30 AGENDA: Quiz Tues.
Lesson 5 Relations, mappings, countable and uncountable sets
Mathematical Background 1
Discrete Mathematics CS 2610
Discrete Mathematics CS 2610
Chapter 2 The Basic Concepts of Set Theory
Section 2.6 Infinite Sets.
CS723 - Probability and Stochastic Processes Lecture 02
ICOM 5016 – Introduction to Database Systems
Presentation transcript:

CS 3630 Database Design and Implementation

Mapping Relationships between sets 1 X 2 Y 3 Z 5 W 9 A B 41 mins for S1 A B

How to Represent a Mapping? (Y, 2) (W, 9) R = {(Y, 2), (W, 9)} R  A  B X Y Z W 1 2 3 5 9 A B

Relation A mathematical relation is a subset of a Cartesian Product. A1  A2  A3  …  An = {(x1, x2, x3, …, xn): xi  Ai} R  A1  A2  A3  …  An

Example A = {2, 3, 4} B = {1, 2, 5} A  B = {(2, 1), (2, 2), (2, 5), (3, 1), (3, 2), (3, 5), (4, 1), (4, 2), (4, 5)} R1 = {(2, 2), (2, 5) , (3, 5)} = {(x, y) | x is in A, y is in B, x <= y and x < 4}

A relationship between A and B = {(x, y) | x is in A, y is in B, x <= y and x <= 3} A relationship between A and B 2 3 4 1 2 5

Example A = {1, 2, 3, 4} B = {2, 5} A  B = {(1, 2), (1, 5), (2, 2), (2, 5), (3, 2), (3, 5), (4, 2), (4, 5)} 1 2 3 4 5

Relations on Three Sets A3 = {x, y} R2 = {(a1, a2, a3): (a1, a2, a3)  A1  A2  A3, a1 + a2 = 6, and a3 = x} = {(1, 5, x), (4, 2, x)}

Example A = {1, 2, 3, 4} B = {2, 5} R1 = {(a, b, c): (a, b, c)  A  B  A and a + b + c < 8} = {(1, 2, 1), (1, 2, 2), (1, 2, 3), (1, 2, 4), (1, 5, 1), (2, 2, 1), (2,2, 2), (2,2,3), (3, 2, 1), (3,2,2), (4,2,1)} R2 = {(a, b, c): (a, b, c)  A  B  A and a + c = 5} = {(1, 2, 4), (1, 5,4), (2, 2, 3), (2, 5, 3), (3, 2, 2), (3, 5, 2), (4, 2, 1), (4, 5, 1)} R3 = {(a, b, c): (a, b, c)  B  A  B and b % 2 = 0} = {(2, 2, 2), (2, 2, 5), (5, 2, 2), (5, 2, 5), (2, 4, 2), (2, 4, 5), (5, 4, 2), (5, 4, 5)}

Total / Partial Total: Each element in the set is related to an element in the other set Partial: Not total 1 2 3 5 9 X Y Z w Total Partial

One-to-Many One element could be mapped to many elements 1 X 2 Y 3 Z 5 w 1 2 3 5 9

Many-to-One Many elements could be mapped to one element 1 X 2 Y 3 Z 5 w 1 2 3 5 9

Many-to-Many Both one-to-many and many-to-one X Y Z w 1 2 3 5 9

One-to-One X Y Z w 1 3 5 9

Infinite Sets I = {i: i is an integer} N = {n: n  I and n >= 0} = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9…} |N| =  M = {m: m  N and m % 2 = 0} = {0, 2, 4, 6, 8, …} |M| =  M  N |M| = |N| ?

One-to-one Mapping From N to M n 1 2 3 . . m 2 4 6 . . 1 2 3 . . m 2 4 6 . . m = 2 * n for all n  N

One-to-one Mapping From M to N n = m / 2 for all m  M The formula Not just the examples

One-to-One Mapping I = {i: i is an integer} N = {n: n  I and n >=0} Y = {y | y = 3 * n, where n  N} Z = {z | z = 5 * n + 2, where n  N} Find a one-to-one mapping between Y and Z.

One-to-One Mapping N = {0, 1, 2, 3, 4, 5 …} Y = {y | y = 3 * n, where n  N} Z = {z | z = 5 * n + 2, where n  N} Show some elements in order: N Y Z 0 0 2 1 3 7 2 6 12 3 9 17 . . .

A Mapping between Y and Z From Y to Z y = 3 * n ==> n = y / 3 z = 5 * n + 2 ==> z = 5 * (y / 3) + 2 From Z to Y y = (z – 2) * 3 / 5 Need Formula, not just examples. Does not contain n any more! Double checking!

Countable Sets I = {i: i is an integer} N = {n: n  I and n >= 0} M = {m: m  N and m % 2 = 0} M  N |M| = |N| =  M  N  I |I| = |M| = |N|

Countable Sets I = {i: i is an integer} N = {n: n  I and n >= 0} X = N  N = {(0, 0), (0, 1), (0, 2), … (1, 0), (1, 1), (1, 2), … (2, 0), (2, 1), (2, 2), … . . .} |X| = |N|?

Uncountable Sets Any example? Sets of Higher Cardinality Any way to construct a set with a higher cardinality?

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