Download presentation
Presentation is loading. Please wait.
Published byAlberta Walters Modified over 9 years ago
1
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 8.1 Relations
2
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Relation (from Chap 1.3) Let A and B be sets. A relation R from A to B is a subset. Given an ordered pair, x is related to y by R, written if and only if. The set A is called the domain of R and the set B is called its co- domain. Ex. 2
3
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Less-than Relation for Real Numbers Define a relation L from R to R as follows: For all real numbers x and y, a.Is b.Is c.Is d.Is 3
4
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Less-than Relation for Real Numbers Define a relation L from R to R as follows: For all real numbers x and y, a.Is No, since 57 > 53. b.Is Yes, since -17 < -14. c.Is No, since 143 = 143. d.Is Yes, since -35 < 1. 4
5
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Less-than Relation for Real Numbers Define a relation L from R to R as follows: For all real numbers x and y, e.Draw the graph of L as a subset of the Cartesian plane 5
6
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Less-than Relation for Real Numbers Define a relation L from R to R as follows: For all real numbers x and y, e.Draw the graph of L as a subset of the Cartesian plane A: For each value of x, all the points ( x, y ) with y>x are on the graph. So the graph consists of all the points above the line x = y. 6
7
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University A Relation on a Power Set Let X ={ a, b, c }. Then, Define a relation S from P(X) to Z as follows: For all sets A and B in P(X) (i.e., for all subsets A and B of X ), a.Is b.Is c.Is d.Is 7
8
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University A Relation on a Power Set Let X ={ a, b, c }. Then, Define a relation S from P(X) to Z as follows: For all sets A and B in P(X) (i.e., for all subsets A and B of X ), a.Is Yes, both sets have two elements. b.Is Yes, has one element and has zero elements, and c.Is No, { b, c } has two elements and { a, b, c } has three elements and 2 < 3. d.Is Yes, both sets have one element. 8
9
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University The Inverse of a Relation Let R be a relation from A to B. Define the inverse relation from B to A as follows: The definition can be written operationally as follows: 9
10
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University The Inverse of a Finite Relation Let A = {2, 3, 4} and B = {2, 6, 8} and let R be the “divides” relation from A to B : For all a.State explicitly which ordered pairs are in and, and draw arrow diagrams for and. b.Describe in words. 10
11
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University The Inverse of a Finite Relation Let A = {2, 3, 4} and B = {2, 6, 8} and let R be the “divides” relation from A to B : For all a.State explicitly which ordered pairs are in and, and draw arrow diagrams for and. 11 2 3 4 2 3 4 2 3 4 2 6 8 2 6 8 2 6 8
12
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University The Inverse of a Finite Relation Let A = {2, 3, 4} and B = {2, 6, 8} and let R be the “divides” relation from A to B : For all b.Describe in words. For all, 12
13
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University The Inverse of an Infinite Relation Define a relation R from R to R as follows: For all Draw the graphs of and in the Cartesian plane. Is a function? 13
14
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University Directed Graph of Relation A relation on a set A is a relation from A to A. Let A = {3, 4, 5, 6, 7, 8} and define a relation R on A as follows: For all 14
15
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University n -ary Relation A more formal way to refer to the kind of relation defined in Section 1.3 is to call it a binary relation because it is a subset of a Cartesian product of two sets. An n -ary relation to be a subset of a Cartesian product of n sets, where n is any integer grater than or equal to two. 15
16
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University n -ary Relation A more formal way to refer to the kind of relation defined in Section 1.3 is to call it a binary relation because it is a subset of a Cartesian product of two sets. Roughly, an n -ary relation to be a subset of a Cartesian product of n sets, where n is any integer greater than or equal to two. 16
17
Fall 2015 COMP 2300 Department of Mathematics and Physics Donghyun (David) Kim North Carolina Central University n -ary Relations and Relational Databases Given sets, an n -ary relation R on is a subset of. The special cases of 2-ary, 3-ary, and 4-ary relations are called binary, ternary, and quaternary relations, respectively. Example: Patient Database at a Hospital (Patient_ID, Patient_Name, Admission_Date, Diagnosis) (011985, John Schmidt, 020710, asthema) (574329, Tak Kurosawa, 0114910, penumonia) 17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.