
The same relation can be represented by a set of ordered pairs, a zero-one matrix, or a directed graph. The set lists its members precisely, the matrix supports computation, and the graph reveals loops, directions, and connections. Changing representation does not change the relation, provided that element order and edge direction are recorded consistently.
1. Zero-One Matrices
Rows Are Sources; Columns Are Targets
Let and , with fixed orderings. A relation is represented by the zero-one matrix
Row corresponds to the first component , and column to the second component . Changing an ordering changes the matrix’s appearance. Without specified orderings, the matrix cannot uniquely identify its relation. When , use the same ordering for rows and columns to apply the diagonal and transpose criteria.
Example: From a condition to a matrix. Let and , both listed in increasing order, and define if and only if . Find and .
Show solution and steps
The first row represents 1, which is greater than neither candidate target. The second row represents 2, which is related only to 1. The third represents 3, which is related to both 1 and 2. Thus
The three source elements give three rows, and the two target elements give two columns. Since the relation is between different sets, the square-matrix reflexivity test does not directly apply.
Example: Recovering ordered pairs from a matrix. Let and , ordered by their subscripts. Suppose
Find and explain how to check for omitted pairs.
Show solution and steps
Read the positions of the 1s row by row: column 2 in row 1; columns 1, 3, and 4 in row 2; and columns 1, 3, and 5 in row 3. Hence
The seven 1s give seven ordered pairs, each with its source from the row and its target from the column.
Membership Predicates and Characteristic Functions
For an n-ary relation , its characteristic function records membership:
The input is a complete tuple in the specified Cartesian product. A predicate such as defines this membership rule without listing infinitely many pairs.
For finite domains, a table can list all tuples with characteristic value 1. A zero-one matrix arranges these values by row and column for a binary relation.
Supplement: Membership algorithms. An algorithm representing a relation must terminate and decide membership correctly for every input in the stated domain. Specifying a mathematical predicate alone does not guarantee such a procedure.
2. Digraphs and Property Tests
Elements as Vertices; Pairs as Directed Edges
For a relation on , each element is a vertex and each is a directed edge from to . A pair is represented by a loop. An element occurring in no pair must still appear as an isolated vertex; omitting it changes the underlying set and may change the reflexivity test.
Three Views of Each Property
Assume that has elements, , and both matrix orderings are the same. Let denote the identity matrix, with 1s on the diagonal and 0s elsewhere. The symbol compares matrices entry by entry.
| Property | Set or composition criterion | Matrix criterion | Digraph criterion |
|---|---|---|---|
| Reflexive | Every diagonal entry is 1 | Every vertex has a loop | |
| Irreflexive | Every diagonal entry is 0 | No vertex has a loop | |
| Symmetric | Every edge between distinct vertices has its reverse | ||
| Antisymmetric | For , and cannot both be 1 | No distinct vertices are connected in both directions | |
| Asymmetric | The antisymmetry criterion, plus diagonal 0s | Neither opposite edges nor loops occur | |
| Transitive | Every two-step connection has a direct shortcut |
The symbol denotes the Boolean product defined below. Antisymmetry places no restriction on the diagonal. Opposite off-diagonal positions may both be 0; they simply cannot both be 1. Antisymmetry does not require every edge to point in the same direction and does not rule out cycles of length greater than two.
Example: Classifying a relation in three representations. Figure 1 represents the relation on given by
Determine whether it is reflexive, irreflexive, symmetric, antisymmetric, asymmetric, and transitive.
Show solution and steps
It is reflexive and antisymmetric. It is not irreflexive, symmetric, asymmetric, or transitive.
- Every diagonal entry is 1, so it is reflexive. Its loops disprove both irreflexivity and asymmetry.
- The reverse of is missing, disproving symmetry. No distinct vertices are related in both directions, establishing antisymmetry.
- Both and are present, but is absent, disproving transitivity. Equivalently, the Boolean square has 1 in position while the original matrix has 0, violating entrywise containment.
Example: Diagonal entries do not settle antisymmetry. On with the natural ordering, let
Determine whether each relation is reflexive, symmetric, and antisymmetric. Give a specific witness whenever a property fails.
Show solution and steps
Both are reflexive because every diagonal entry is 1. Neither is symmetric: both have but lack .
is not antisymmetric because and both occur for distinct elements. In , no off-diagonal pair and its reverse both occur, so is antisymmetric. Its cycle does not violate antisymmetry, which forbids two-way pairs rather than every directed cycle.
3. Matrix Forms of Relation Operations
Entrywise Boolean Operations and Transpose
For relations using the same element orderings:
| Relation operation | Matrix operation |
|---|---|
| Inverse | Transpose |
| Union | Entrywise OR, |
| Intersection | Entrywise AND, |
| Difference | Entrywise |
| Symmetric difference | Entrywise exclusive OR |
| Complement | Interchange 0 and 1 in every position |
Ordinary matrix addition does not directly compute union: two 1s would add to 2, while a relation matrix records only presence or absence.
Example: Union and intersection of matrices. Two relations on have matrices
Find and .
Show solution and steps
For union, write 1 wherever either input is 1. For intersection, write 1 only where both inputs are 1:
For example, position has inputs 1 and 0, giving union 1 and intersection 0. Position has two 1s, so both results are 1.
Boolean Products and Composition
For an matrix and an matrix , define the Boolean product by
Use the same row–column pairing as ordinary multiplication, but replace multiplication with AND and addition with OR. The result is 1 if there is at least one intermediate index for which both entries are 1. The number of such intermediate connections does not affect the final Boolean value.
For relations and , this gives
The relation is written , but its matrix is computed in the order . This follows from the convention “rows are sources; columns are targets.” The columns of and rows of both correspond to , and their dimensions must match.
Example: Computing a Boolean product. Given
find and explain the computations for its first and second rows.
Show solution and steps
The entry in row 1, column 1 is
The other two entries in the first row are also 1. Alternatively, row 1 of says that intermediate vertices 1 and 3 can be reached. Take the entrywise OR of rows 1 and 3 of :
Row 2 of reaches intermediate vertices 1 and 2, so OR the corresponding rows of to get . Row 3 of contains no 1s, so its output row is all zeros. Thus
Boolean Powers and Walk Length
Write for the th Boolean power of . Then
Its entry is 1 exactly when a directed walk of edges exists from to . Ordinary arithmetic matrix powers count the number of these walks; Boolean powers record only whether at least one exists.
Example: A loop in a Boolean square. List in increasing order, and suppose
Find and explain why belongs to .
Show solution and steps
Row 1 reaches vertex 2, so copy row 2 of the original matrix. Row 2 reaches vertices 2 and 3, so OR rows 2 and 3. Row 3 reaches vertex 1, so copy row 1. The result is
The loop can be followed twice, giving the two-step walk . Hence . Walks may repeat both vertices and edges.
4. Review and Self-Check
Keep three correspondences in mind: first component ↔ matrix row ↔ edge source; second component ↔ matrix column ↔ edge target; membership in the relation ↔ matrix entry 1 ↔ presence of an edge.
- If has entries equal to 1, how many 1s does have? For a relation on elements, how many 1s does have?
- Does deleting an isolated vertex leave a digraph representing the same relation on the same set?
- Which edge must be added to the relation in Figure 1 to make it transitive? Give the new matrix.
Show self-check answers
- Transpose preserves the number of 1s, giving . The complement flips all positions, giving .
- No. Even if the edge set is unchanged, the vertex set has changed, which may affect reflexivity. A representation must include every element of the specified underlying set.
- Add . The matrix becomes . Every two-step connection now has its direct edge.
Glossary and Sources
| Term | Main idea |
|---|---|
| Zero-one matrix | Every entry is either 0 or 1 |
| Transpose | Exchange rows and columns |
| Boolean product | Use AND for multiplication and OR for addition |
| Boolean power | Repeated Boolean multiplication |
| Directed graph / digraph | Vertices together with directed edges |
| Loop | An edge from a vertex to itself |
- Course slides.
- Rosen, 8th edition, Section 9.3: printed pages 621–626, PDF pages 644–649. The Boolean square example is on printed page 624; digraph definitions and property tests are on pages 625–626.
- Figure 1 and its classification example are constructed from the definitions; the full edge set and matrix are given in the text. Matrix criteria for difference, complement, asymmetry, and transitivity are supplementary deductions from the definitions.
Updated: