Relations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Properties of Relations Reading: Kolman, Section 4.1-4.2.

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Matrix.
Vector Spaces A set V is called a vector space over a set K denoted V(K) if is an Abelian group, is a field, and For every element vV and K there exists.
Section 13-4: Matrix Multiplication
Representing Relations Rosen 7.3. Using Matrices For finite sets we can use zero-one matrices. Elements of each set A and B must be listed in some particular.
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
8.3 Representing Relations Connection Matrices Let R be a relation from A = {a 1, a 2,..., a m } to B = {b 1, b 2,..., b n }. Definition: A n m  n connection.
Chapter 3 : Relational Model
5/16/20151 You Never Escape Your… Relations. 5/16/20152Relations If we want to describe a relationship between elements of two sets A and B, we can use.
Maths for Computer Graphics
Denoting the beginning
Introduction to Graphs
Discrete Mathematics Lecture#11.
Survey of Mathematical Ideas Math 100 Chapter 2
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Applied Discrete Mathematics Week 10: Equivalence Relations
CSCI 1900 Discrete Structures
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
CSCI 1900 Discrete Structures
Finite State Machines – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Graphs and Finite State Machines Reading: Kolman, Sections.
Section 4.1 Vectors in ℝ n. ℝ n Vectors Vector addition Scalar multiplication.
Relations (1) Rosen 6 th ed., ch. 8. Binary Relations Let A, B be any two sets. A binary relation R from A to B, written (with signature) R:A↔B, is a.
Chapter 4 Relations and Digraphs
April 10, 2002Applied Discrete Mathematics Week 10: Relations 1 Counting Relations Example: How many different reflexive relations can be defined on a.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Lecture 14 Relations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
Discrete Structures1 You Never Escape Your… Relations.
Discrete Mathematics Relation.
Relations and their Properties
§ 每周五交作业,作业成绩占总成绩的 10% ; § 平时不定期的进行小测验,占总成绩的 20% ; § 期中考试成绩占总成绩的 20% ;期终考 试成绩占总成绩的 50% § 每周五下午 1 ; 00—3 : 00 ,答疑 § 地点:软件楼 301.
Fall 2002CMSC Discrete Structures1 You Never Escape Your… Relations.
Sets Goal: Introduce the basic terminology of set theory.
Meeting 18 Matrix Operations. Matrix If A is an m x n matrix - that is, a matrix with m rows and n columns – then the scalar entry in the i th row and.
CSCI 171 Presentation 9 Matrix Theory. Matrix – Rectangular array –i th row, j th column, i,j element –Square matrix, diagonal –Diagonal matrix –Equality.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
Lecture on Relations 1Developed by CSE Dept., CIST Bhopal.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
4. Relations and Digraphs Binary Relation Geometric and Algebraic Representation Method Properties Equivalence Relations Operations.
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
Graphs Basic properties.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Relations. L222 Agenda –Relations 7.3 Representing Relations As subsets of Cartesian products Column/line diagrams Boolean matrix Digraph Operations on.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
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.
Section 7.3: Representing Relations In this section, we will cover two ways to represent a relation over a finite set other than simply listing the relation.
Functions – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Functions Reading: Kolman, Section 5.1.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 1 The Foundations: Logic, Sets,
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Introduction Types of Matrices Operations
A very brief introduction to Matrix (Section 2.7) Definitions Some properties Basic matrix operations Zero-One (Boolean) matrices.
Math 3121 Abstract Algebra I Lecture 6 Midterm back over+Section 7.
Module Code MA1032N: Logic Lecture for Week Autumn.
Relations and Their Properties
13.4 Product of Two Matrices
Relations Chapter 9.
Relations and Digraphs
CSNB 143 Discrete Mathematical Structures
MA5242 Wavelets Lecture 1 Numbers and Vector Spaces
Matrix A matrix is a rectangular arrangement of numbers in rows and columns Each number in a matrix is called an Element. The dimensions of a matrix are.
REVISION Relation. REVISION Relation Introduction to Relations and Functions.
Introduction to Graphs
Terminology and Symbols
Presentation transcript:

Relations – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Properties of Relations Reading: Kolman, Section

Relations – Page 2CSCI 1900 – Discrete Structures Cartesian Product If A 1, A 2, …, A m are nonempty sets, then the Cartesian Product of them is the set of all ordered m-tuples (a 1, a 2, …, a m ), where a i  A i, i = 1, 2, … m. Denoted A 1  A 2  …  A m = {(a 1, a 2, …, a m ) | a i  A i, i = 1, 2, … m}

Relations – Page 3CSCI 1900 – Discrete Structures Cartesian Product Example If A = {1, 2, 3} and B = {a, b, c}, find A  B A  B = {(1,a), (1,b), (1,c), (2,a), (2,b), (2,c), (3,a), (3,b), (3,c)}

Relations – Page 4CSCI 1900 – Discrete Structures Using Matrices to Denote Cartesian Product For Cartesian Product of two sets, you can use a matrix to find the sets. Example: Assume A = {1, 2, 3} and B = {a, b, c}. The table below represents A × B. abc 1(1, a)(1, b)(1, c) 2(2, a)(2, b)(2, c) 3(3, a)(3, b)(3, c)

Relations – Page 5CSCI 1900 – Discrete Structures Cardinality of Cartesian Product The cardinality of the Cartesian Product equals the product of the cardinality of all of the sets: | A 1  A 2  …  A m | = | A 1 |  | A 2 |  …  | A m |

Relations – Page 6CSCI 1900 – Discrete Structures Subsets of the Cartesian Product Many of the results of operations on sets produce subsets of the Cartesian Product set Relational database –Each column in a database table can be considered a set –Each row is an m-tuple of the elements from each column or set –No two rows should be alike

Relations – Page 7CSCI 1900 – Discrete Structures Relations A relation, R, is a subset of a Cartesian Product that uses a definition to state whether an m-tuple is a member of the subset or not Terminology: Relation R from A to B R  A  B Denoted “x R y” where x  A and y  B and x has a relation with y If x does not have a relation with y, denoted x R y

Relations – Page 8CSCI 1900 – Discrete Structures Relation Example A is the set of all students and B is the set of all courses A relation R may be defined as the course is required Paul Giblock R CSCI 2710 Danny Camper R CSCI 2710

Relations – Page 9CSCI 1900 – Discrete Structures Relations Across Same Set Relations may be from one set to the same set, i.e., A = B Terminology: Relation R on A R  A  A

Relations – Page 10CSCI 1900 – Discrete Structures Relation on a Single Set Example A is the set of all courses A relation R may be defined as the course is a prerequisite CSCI 2150 R CSCI 3400 R = {(CSCI 2150, CSCI 3400), (CSCI 1710, CSCI 2910), (CSCI 2800, CSCI 2910), …}

Relations – Page 11CSCI 1900 – Discrete Structures Example: Features of Digital Cameras Megapixels = { 5} battery life = { 400 shots} optical zoom = {none, 2X to 3X, 4X or better} storage capacity = { 128MB} price = Z+

Relations – Page 12CSCI 1900 – Discrete Structures Digital Camera Example (continued) Possible relations might be: Priced below $X above a certain megapixels a combination of price below $X and optical zoom of 4X or better

Relations – Page 13CSCI 1900 – Discrete Structures Theorems of Relations Let R be a relation from A to B, and let A 1 and A 2 be subsets of A –If A 1  A 2, then R(A 1 )  R(A 2 ) –R(A 1  A 2 ) = R(A 1 )  R(A 2 ) –R(A 1  A 2 )  R(A 1 )  R(A 2 ) Let R and S be relations from A to B. If R(a) = S(a) for all a in A, then R = S.

Relations – Page 14CSCI 1900 – Discrete Structures Matrix of a Relation We can represent a relation between two finite sets with a matrix M R = [m ij ], where 1 if (a i, b j )  R 0 if (a i, b j )  R m ij =

Relations – Page 15CSCI 1900 – Discrete Structures Example of Using a Matrix to Denote a Relation Using the previous example where A = {1, 2, 3} and B = {a, b, c}. The matrix below represents the relation R = {(1, a), (1, c), (2, c), (3, a), (3, b)}. abc

Relations – Page 16CSCI 1900 – Discrete Structures Digraph of a Relation Let R be a relation on A We can represent R pictorially as follows –Each element of A is a circle called a vertex –If a i is related to a j, then draw an arrow from the vertex a i to the vertex a j In degree = number of arrows coming into a vertex Out degree = number of arrows coming out of a vertex

Relations – Page 17CSCI 1900 – Discrete Structures Representing a Relation The following three representations depict the same relation on A = {1, 2, 3}. R = {(1, 1), (1, 3), (2, 3), (3, 2), (3, 3)}