Domain Restriction on Relation domain restriction operator,, restricts a relation to only those members whose domain is in a specified set. domain restriction.

Slides:



Advertisements
Similar presentations
Math 3121 Abstract Algebra I
Advertisements

5.1 Real Vector Spaces.
Section 7.5: Equivalence Relations Def: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Ex: Let.
DEFINITION Let f : A  B and let X  A and Y  B. The image (set) of X is f(X) = {y  B : y = f(x) for some x  X} and the inverse image of Y is f –1 (Y)
Equivalence Relations
Ch 7.7: Fundamental Matrices
Copyright © C. J. Date 2005page 97 S#Y S1DURINGS3DURING [d04:d10][d08:d10] S2DURINGS4DURING [d02:d04][d04:d10] [d08:d10] WITH ( EXTEND T2 ADD ( COLLAPSE.
Nondeterministic Finite Automata CS 130: Theory of Computation HMU textbook, Chapter 2 (Sec 2.3 & 2.5)
Functions A function, f, is a mechanism that relates (or maps) one set of elements to another set. –More specifically, f, is a special type of relation.
Section 7.4: Closures of Relations Let R be a relation on a set A. We have talked about 6 properties that a relation on a set may or may not possess: reflexive,
The Engineering Design of Systems: Models and Methods
C.1 Appendix C: Advanced Relational Database Design Reasoning with MVDs Higher normal forms Join dependencies and PJNF DKNF.
Representing Relations Using Matrices
Applied Discrete Mathematics Week 11: Graphs
Exam 2 Material Rational Expressions
1 Long Run Cost Here we study the long run.. 2 Long Run Costs Remember the long run is when all inputs are variable. I think it is useful to think of.
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
Chapter 2 Access Control Fundamentals. Chapter Overview Protection Systems Mandatory Protection Systems Reference Monitors Definition of a Secure Operating.
Theory and Applications
Dr. Alexandra I. Cristea CS 319: Theory of Databases: C3.
Copyright © Cengage Learning. All rights reserved.
Equivalence Class Testing
Relations Chapter 9.
Database Systems Normal Forms. Decomposition Suppose we have a relation R[U] with a schema U={A 1,…,A n } – A decomposition of U is a set of schemas.
1 Relational Algebra and Calculus Chapter 4. 2 Relational Query Languages  Query languages: Allow manipulation and retrieval of data from a database.
Functions Review.
Lecture 6 Normalization: Advanced forms. Objectives How inference rules can identify a set of all functional dependencies for a relation. How Inference.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
MA/CSSE 474 Theory of Computation DFSM Canonical Form Proof of NDFSM  DFSM ALGORITHM (as much as we have time for) This version includes the "answers"
INM175 Topic 7 1 Module INM175 Discrete Mathematics Topic 7 Set Theoretic Models.
MIS 3053 Database Design & Applications The University of Tulsa Professor: Akhilesh Bajaj RM/SQL Lecture 1 ©Akhilesh Bajaj, 2000, 2002, 2003, All.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
ECSE Software Engineering 1I HO 5 © HY 2012 Lecture 5 Formal Methods Isn’t this really getting old?
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
Agenda Week 10 Lecture coverage: –Functions –Types of Function –Composite function –Inverse of a function.
Sequences and Summations Section 2.4. Section Summary Sequences. – Examples: Geometric Progression, Arithmetic Progression Recurrence Relations – Example:
1 Example 2 (a) Find the range of f(x) = x 2 +1 with domain [0,2]. Solution The function f is increasing on the interval [0,2] from its smallest value.
Domain and Range Restriction Pt What are the different symbols that you use when writing domain and range restrictions? Write your answer in a.
Chapter 8 Equivalence Relations Let A and B be two sets. A relation R from A to B is a subset of AXB. That is, R is a set of ordered pairs, where the first.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Equivalence Class Testing In chapter 5, we saw that all four variations of boundary value testing are vulnerable to –gaps of untested functionality, and.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
HKOI 2012 (Senior) Q4 - Gene Mutation Gary Wong For any question, please ask via MSN:
Equivalence Relations Lecture 45 Section 10.3 Fri, Apr 8, 2005.
MAT 2720 Discrete Mathematics Section 3.3 Relations
Equivalence Class Testing Use the mathematical concept of partitioning into equivalence classes to generate test cases for Functional (Black-box) testing.
Warm Up. Objective: To find the inverse of a function, if the inverse exists.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. SELECTED.
Inverse Functions Objective: To find and identify inverse 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.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
The Relation Induced by a Partition
Representing Relations Using Digraphs
Chapter 3 The Real Numbers.
Set Operations CS 202, Spring 2008 Epp, chapter 5.
Learn about relations and their basic properties
Module 2: Intro to Relational Model
Chapter 2 Sets and Functions.
ECE 638: Principles of Digital Color Imaging Systems
Equivalence Class Testing
Model the non-negative even integers
Appendix C: Advanced Normalization Theory
Introduction to Relations and Functions
Functions.
Appendix C: Advanced Relational Database Design
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Chapter 28: Advanced Relational Database Design
Presentation transcript:

Domain Restriction on Relation domain restriction operator,, restricts a relation to only those members whose domain is in a specified set. domain restriction operator,, restricts a relation to only those members whose domain is in a specified set. Let R: M x P be { (m1, p1), (m2, p2), (m3, p1), (m3, p3), (m4, p3) } and S = { m1,m3}, then : – S R = { (m1, p1), (m3,p1), (m3, p3) } – this can be an example of restricting to only those packages that contain module 1 and module 3. Note that S must be a subset of M in order for this to be sensible.

Domain Restriction Given a set S and a relation R, domain restriction operation may also be expressed as id(S) ; R – S R = id(S) ; R Consider the previous example of S and R in matrix form: id (S) : M x MR: M x P S R : M x P = ; Note that id(S) is a bit of a stretch here ; it is really - - id(DOM R)\id(DOM R - S) ?? this is still not quite right ?!

Range Restriction on Relation range restriction operator,, restricts a relation to only those members whose range is in a specified set. range restriction operator,, restricts a relation to only those members whose range is in a specified set. Let R: M x P be { (m1, p1), (m2, p3), (m3, p2), (m3, p3), (m4, p3) } and S = { p1,p2}, then : – R S = { (m1, p1), (m3,p2) } – this can be an example of restricting to only those modules that are packaged in package 1 and package 2. This time, S needs to be a subset of P to make sense.

Range Restriction Given a set S and a relation R, range restriction operation may also be expressed as R ; id(S) – R S = R ; id(S) Consider the previous example of S and R in matrix form: id (S) : P x P R: M x P R S : M x P = ; Note that id(S) is a stretch; it is really id(RAN R)\ id (RAN R- S)?

Additional Domain and Range restrictions Domain restriction may be modified to restrict the relation, R, to only those members whose domain is NOT in the specified set S. – S R Similarly, range restriction may be modified to restrict the relation, R, to only those members whose range is NOT in the specified set S. – R S

NOT restrictions on domain and range Let R: A x B, S be a proper subset of A, and T be a proper subset of B. Then Let R: A x B, S be a proper subset of A, and T be a proper subset of B. Then – S R = ( A \ S ) R – R T = R (B \ T )

Override Operator The override operator over two relations R and S, where both relations are defined over the same sets A x B, is defined as follows: R S = (domS R) U S R S = (domS R) U S

Override Operator Example Let R = { (J, m1), (T,m3), (K, m4), (S,m5) } and S = { (T,m2), (K,m3), (Q,m3) } defined over the same sets A x B where A = {J,T,K,S,Q} and B = { m1,m2,m3,m4,m5} – then R S = { (J,m1), (T,m2), (K,m3), (Q,m3), (S,m5) } Note that the original relation R is “modified” with the members in S via: –Looking at the domain of S = T, K, Q –Consider only those members in R whose domain is NOT T,K, or Q –That leaves (J,m1) and (S,m5) in R. –Union of { (j,m1), (S,m5) } and S gives us the above result. The override operator is very much like the file update capability that is often encountered in a software File System.

Relational IMAGE operator Image operator applied to a relation, R, is the same as asking for the range of R. If the Image operator is further restricted to a set S to be applied to the domain of R, then we have the Relational Image Operator, R( S ) If the Image operator is further restricted to a set S to be applied to the domain of R, then we have the Relational Image Operator, R( S ) –Relational Image Operator applied to a relation R as restricted by a set S returns the range of those members of R whose domain is in the set S. –Let R = {(a,2), (b,23), (c,11), (d,45)}, S= {b,c} Then R (|S |) = { 23, 11 } Imagine the above R was a “table” of name and address. Then R( S ) would be the equivalent to a “query” look-up for the addresses of people specified in S.

Transitive Closure Recall that earlier we defined an n-fold relation to be R n. –Let R be a Homogeneous relation R: A x A, and A is some set. –R 0 = id (A) –R n = R ; R n-1 Consider an example : A= {m1, m2, m3} and R is defined : AxA as R = {(m1,m2), (m1,m3), (m3, m2)}, then: –R 0 = {(m1,m1), (m2,m2), (m3,m3)} –R 1 = R; R 0 = {(m1,m2), (m1,m3), (m3,m2)} –R 2 = R ; R 1 = { (m1,m2) } –R 3 = R ; R 2 = { } Transitive Closure may be defined as: – Reflexive Transitive Closure of R, R* = R 0 U R 1 U R 2 U U R n – Non-Reflexive Transitive Closure of R, R + = R 1 U R 2 U U R n –Non-Reflexive Transitive Closure of R = Reflexive Transitive Closure of R \ R 0 or R + = R*\R 0 Check the definition on page 132 – is it correct?

Non-Reflexive Transitive Closure From the example on previous slide, –Non-Reflexive Transitive Closure = R 1 U R 2 –Since R 2 is a subset of R 1 in this case R 1 becomes the non-reflexive transitive closure. Depending on the interpretation one puts on the relation, different answers may be obtained. –If R, in this case, means module calling other modules, then the “max levels of calls” is the same as the largest n where R n is non-empty.

A Theorem Involving Relation Let: R1 be T1 x T2 and R2 be T2 x T3 ├ (R1;R2) -1 = R2 -1 ; R1 -1 –(R1;R2) -1 means x (R1; R2) -1 y –x (R1; R2) -1 y implies that y (R1; R2) x –y (R1; R2) x means there is a z in T2 such that y R1 z and z R2 x –y R1 z implies z R1 -1 y and –z R2 x implies x R2 -1 z –z R1 -1 y “and” x R2 -1 z is the same as x R2 -1 z “and” z R1 -1 y x R2 -1 z and z R1 -1 y means R2 -1 ; R1 -1

Theorems involving Relations See page 134 of your text. See page 134 of your text. You will not be held accountable of these theorems, but at least read them. They will be given to you if ever needed.