Relations Flashcards
What is a ordered n-tupes
an ordered collection of elements
What are 2-tuples called
ordered pairs
`What is the cartesian product
If A and B are sets, then the cartesian product of A and B, which is denoted by A x B, is the set of all ordered pairs (a,b) such that a is an element of A and b is an element of B
What would the answer for {r, o, w} x {a,n}
{r, o, w} x {a, n} = {(r,a), (r,n), (o,a), (o,n), (w,a), (w,n)}
Here are some examples
{r, o, w} x (a, n} = {(r,a), (r,n), (o,a), (o,n), (w,a), (w,n)}
= {(w,a), (r,a), (o,a), (o,n), (r,n), (w,n)}
{r, o, w, a)x {n) = {(r,n), (o,n), (w,n), (a,n)}
{r, o, w} × 0 = 0
What is the difference between sets and tuples
for sets order doesn’t matter, but for tuples it does
For a relation on a set to be transitive what must be true
every element must be related to itself
For a relation on a set to be symmetric what must be true
a relation on (a set) A is symmetric if xRy then yRx
For a relation on a set to be antisymmetric what must be true
aRb, bRa and a = b
What is a equivalence relation
When a set is transitive, symmetric and reflexive
What is reflexive closure
where you add the missing reflexive value(s) to provide the minimal values to set A and still contains R
What is symmetric closure
Symmetric closure of a binary relation R on a set A is the smallest
symmetric relation on a set A that contains R.
R$ = R U {(b, a) | (a, b) e R}
EXAMPLE: Let R be the relation on the set {0, 1,2 3} containing the ordered pairs (0, 1), (1,2), (2,0), (2,2) and (3,0). Find the symmetric closure
R = {(0, 1), (1, 1), (1, 2), (2, 0), (2, 2), (3, 0)}
A = {0, 1, 2, 3}
R(+s) = R U {(b, a) | (a,b) e R}
R(+s) = {(0, 1), (1, 1), (1, 2), (2, 0), (2, 2), (3, 0), (1,0), (2, 1), (0, 2), (0, 3)}
What is a transitive closure
Transitive closure of a binary relation R on a set A is the smallest transitive relation on a set A that contains R.
R(+ ) = R U {(a, c) | (a, b) e R ^ (b, c) e R]
Solve: Let R be the relation on a set {1, 2, 3] containing the ordered pairs (1, 1), (2, 3),
and (3, 1). Find the transitive closure of R.
Solution: R = {(1, 1), (2, 3). (3, 1)]
A = {1, 2, 3}
R$ = R U {(a, c) | (a, b)ER ^ (b, c) ER}
R$ = {(1, 1), (2, 3), (3, 1), (2, 1)]