121 Week 2 - Relations Flashcards
Relation
How elements from different (or sometimes the same) set relate to one another.
Each relation R is essentially a collection of pairs (a, b) with a specific rule or condition that dictates which pairs are included in R.
Binary relation
A relation specifically between 2 different sets.
n-ary relations
A relation between n amount of different sets where n is a specified number.
Ordered pair
A pair of objects that has a specific order. It is denoted by <a,b>
Ordered n-tuples
A set of n amount of objects that has a specific order where n is a specified number. Denoted by <x1,x2, …, xn>.
It has n objects from n sets in the n-tuple.
How can relations be represented?
Tables and Diagraphs (directed graphs)
Union of relations
Denoted R1 ∪ R2
Selects all ordered pairs that are in either R1, R2 or in both R1 and R2
Intersect of relations
Denoted R1 ∩ R2
Selects all ordered pairs that are only in both R1 and R2
Difference of relations
Denoted R1 - R2
Selects all ordered pairs that are in only R1
Product of relations
Denoted R1 x R2
Selects all possible combinations of tuples from 2 relations
Sub-relations
A relation where every ordered tuple in the new relation is also in another relation.
R1 is a sub-relation of R2 if every ordered tuple in R1 is also in R2.
Empty relation
A relation that has no elements.
Denoted by ∅
Symmetry
For every <a,b> in a relation, there must also a <b,a>
Transitivity
For any <a,b> and <b,c> in a relation, there must also be a <a,c>
Reflexivity
For any element a in a set, there must be an <a,a> in the relation