Lecture 5 - Relations Flashcards
What is a relation?
A relation R from X to Y is a subset of X x Y. If (x,y) is an element of R, then we write x R y. The inverse of R is denoted by R^-1
What does it mean if a relation is reflexive?
It means (x,x) is an element of the relation. In other words, you put in x, you get back x.
What does it mean if a relation is symmetric?
It means that for all (x,y) in R where x =/= y, (y,x) is in R. In other words, if you put in 3 and get back 4, you can put in 4 and get back 3.
What does it mean if a relation is anti-symmetric?
That for all (x,y) in R where x =/= y, (y,x) does not exist in R. In other words, if you put in 3 and get back 4, you will not get back 3 if you put in 4.
How do you draw a matrix representation of a relation?
Draw possible values for x on one axis (generally 1-4) and possible values for y on the other (also 1-4). Mark 1’s where the relation holds true, 0’s where it does not.
What is required in order for a relation R on X to be a partial order?
It must be reflexive, anti-symmetric and transitive
What are the components of a digraph?
Vertices - Represent elements
Directed Edge - (relation) Represents an element (x,y) being present in the relation. In other words, if you put in x and get y.
Loop - Represents an element (x,x) being present in the relation. In other words, if you put in x and get x.