|
|
Definition 2.2 (Cartesian Product)
A × B = { (x,y) | x ∈ A and y ∈ B }
are sets.
The set of all n-tuples
with
, 1 ≤ i ≤ n,
is denoted by
We write:
= { (
|
, 1 ≤ i ≤ n }
Examples:
Definition 2.3 (Relation)
If (x,y) ∈ R we say x is R-related to y.
To express that R is a relation from A to B we write R: A ↔ B
Shorthand: (x,y) ∈ R == xRy
Examples:
A relation C can now be defined as a list of pairs (x,y) where x is a supplier and y is a product.
C = { (S1, P1) , (S1, P3), (S2, P2), (S2, P3) }
Relation in tabular form:
+---+----+----+----+
| | P1 | P2 | P3 |
+---+----+----+----+
|S1 | 1 | 0 | 1 |
+---+----+----+----+
|S2 | 0 | 1 | 1 |
+---+----+----+----+
A graphically representation of the relation → board
|
|
Last modified 22/May/97