PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: Medium Entry average rating: No information on entry rating
[parent] matrix representation of relation composition (Example)

We have it within our reach to pick up another way of representing 2-adic relations, namely, the representation as logical matrices, and also to grasp the analogy between relational composition and ordinary matrix multiplication as it appears in linear algebra.

First of all, while we still have the data of a very simple concrete case in mind, let us reflect on what we did in our last Example in order to find the composition $ G \circ H$ of the 2-adic relations $ G$ and $ H$.

Here is the setup that we had before:

\begin{displaymath}\begin{array}{lllllll} X & = & Y & = & Z & = & \mathrm{ \{ 1, 2, 3, 4, 5, 6, 7 \} } \end{array}\end{displaymath}
\begin{displaymath}\begin{array}{lllllllllll} G & = & 4:3 & + & 4:4 & + & 4:5 & ... ...& 5:4 & \subseteq & Y \times Z & = & X \times X \ \end{array}\end{displaymath}

Let us recall the rule for finding the relational composition of a pair of 2-adic relations. Given the 2-adic relations $ P \subseteq X \times Y$ and $ Q \subseteq Y \times Z$, the relational composition of $ P$ and $ Q$, in that order, is written as $ P \circ Q$, or more simply as $ PQ$, and obtained as follows:

To compute $ PQ$, in general, where $ P$ and $ Q$ are 2-adic relations, simply multiply out the two sums in the ordinary distributive algebraic way, but subject to the following rule for finding the product of two elementary relations of shapes $ a:b$ and $ c:d$.

\begin{displaymath}\begin{array}{lccc} (a:b)(c:d) & = & (a:d) & \mathrm{if}\ b = c \ \ (a:b)(c:d) & = & 0 & \mathrm{otherwise} \ \end{array}\end{displaymath}

To find the relational composition $ G \circ H$, one may begin by writing it as a quasi-algebraic product:

$ G \circ H = (4\mathrm{:}3 + 4\mathrm{:}4 + 4\mathrm{:}5)(3\mathrm{:}4 + 4\mathrm{:}4 + 5\mathrm{:}4)$

Multiplying this out in accord with the applicable form of distributive law one obtains the following expansion:

\begin{displaymath}\begin{array}{lccccccc} G \circ H & = & (4:3)(3:4) & + & (4:3... ... (4:5)(3:4) & + & (4:5)(4:4) & + & (4:5)(5:4) & \ \end{array}\end{displaymath}

Applying the rule that determines the product of elementary relations produces the following array:

\begin{displaymath}\begin{array}{lccccccc} G \circ H & = & (4:4) & + & 0 & + & 0... ...:4) & + & 0 & + \ & & 0 & + & 0 & + & (4:4) & \ \end{array}\end{displaymath}

Since the plus sign in this context represents an operation of logical disjunction or set-theoretic aggregation, all of the positive multiplicities count as one, and this gives the ultimate result:

$ G \circ H = (4:4)$

With an eye toward extracting a general formula for relation composition, viewed here on analogy with algebraic multiplication, let us examine what we did in multiplying the 2-adic relations $ G$ and $ H$ together to obtain their relational composite $ G \circ H$.

Arrangement

Given the space $ X = \{ 1, 2, 3, 4, 5, 6, 7 \}$, whose cardinality $ \vert X\vert$ is $ 7$, there are $ \vert X \times X\vert = \vert X\vert \cdot \vert X\vert = 7 \cdot 7 = 49$ elementary relations of the form $ i:j$, where $ i$ and $ j$ range over the space $ X$. Although they might be organized in many different ways, it is convenient to regard the collection of elementary relations as being arranged in a lexicographic block of the following form:

\begin{displaymath}\begin{array}{lllllll} 1\mathrm{:}1 & 1\mathrm{:}2 & 1\mathrm... ...}4 & 7\mathrm{:}5 & 7\mathrm{:}6 & 7\mathrm{:}7 \ \end{array}\end{displaymath}

Expansion

The relations $ G$ and $ H$ may then be regarded as logical sums of the following forms:

$ G = \sum_{ij} G_{ij}(i:j)$
$ H = \sum_{ij} H_{ij}(i:j)$

The notation $ \sum_{ij}$ indicates a logical sum over the collection of elementary relations $ i:j$, while the factors $ G_{ij}$ and $ H_{ij}$ are values in the boolean domain $ \mathbb{B} = \{ 0, 1 \}$ that are known as the coefficients of the relations $ G$ and $ H$, respectively, with regard to the corresponding elementary relations $ i:j$.

In general, for a 2-adic relation $ L$, the coefficient $ L_{ij}$ of the elementary relation $ i:j$ in the relation $ L$ will be 0 or 1, respectively, as $ i:j$ is excluded from or included in $ L$.

With these conventions in place, the expansions of $ G$ and $ H$ may be written out as follows:

\begin{displaymath}\begin{array}{cccccccccccccccc} G & & = & & 4:3 & + & 4:4 & +... ...) & + & 0(7\mathrm{:}6) & + & 0(7\mathrm{:}7) & \ \end{array}\end{displaymath}
\begin{displaymath}\begin{array}{cccccccccccccccc} H & & = & & 3:4 & + & 4:4 & +... ...) & + & 0(7\mathrm{:}6) & + & 0(7\mathrm{:}7) & \ \end{array}\end{displaymath}

Extraction

Stripping down to the bare essentials, one obtains the following matrices of coefficients for the relations $ G$ and $ H$.

$ G = \left[\begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 &... ... 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 & 0 & 0 & 0 \ \end{array}\right]$
$ H = \left[\begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 &... ... 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 & 0 & 0 & 0 \ \end{array}\right]$

These are the logical matrix representations of the 2-adic relations $ G$ and $ H$.

If the 2-adic relations $ G$ and $ H$ are viewed as logical sums, then their relational composition $ G \circ H$ can be regarded as a product of sums, a fact that can be indicated as follows:

$ G \circ H = (\sum_{ij} G_{ij}(i:j))(\sum_{ij} H_{ij}(i:j)).$

The composite relation $ G \circ H$ is itself a 2-adic relation over the same space $ X$, in other words, $ G \circ H \subseteq X \times X$, and this means that $ G \circ H$ must be amenable to being written as a logical sum of the following form:

$ G \circ H = \sum_{ij}(G \circ H)_{ij}(i:j).$

In this formula, $ (G \circ H)_{ij}$ is the coefficient of $ G \circ H$ with respect to the elementary relation $ i:j$.

One of the best ways to reason out what $ G \circ H$ should be is to ask oneself what its coefficient $ (G \circ H)_{ij}$ should be for each of the elementary relations $ i:j$ in turn.

So let us pose the question:

\begin{displaymath}\begin{array}{lll} (G \circ H)_{ij} & = & \operatorname{What}? \end{array}\end{displaymath}

In order to answer this question, it helps to realize that the indicated product given above can be written in the following equivalent form:

$ G \circ H = (\sum_{ik} G_{ik}(i:k))(\sum_{kj} H_{kj}(k:j)).$

A moment's thought will tell us that $ (G \circ H)_{ij} = 1$ if and only if there is an element $ k$ in $ X$ such that $ G_{ik} = 1$ and $ H_{kj} = 1$.

Consequently, we have the result:

$ (G \circ H)_{ij} = \sum_{k} G_{ik} H_{kj}.$

This follows from the properties of logical products and sums, specifically, from the fact that the product $ G_{ik} H_{kj}$ is 1 if and only if both $ G_{ik}$ and $ H_{kj}$ are 1, and from the fact that $ \sum_{k} F_{k}$ is equal to 1 just in case some $ F_{k}$ is 1.

All that remains in order to obtain a computational formula for the relational composite $ G \circ H$ of the 2-adic relations $ G$ and $ H$ is to collect the coefficients $ (G \circ H)_{ij} $ over the appropriate basis of elementary relations $ i:j$, as $ i$ and $ j$ range through $ X$.

$ G \circ H = \sum_{ij}(G \circ H)_{ij}(i:j) = \sum_{ij}(\sum_{k} G_{ik} H_{kj})(i:j).$

This is the logical analogue of matrix multiplication in linear algebra, the difference in the logical setting being that all of the operations performed on coefficients take place in a system of logical arithmetic where summation corresponds to logical disjunction and multiplication corresponds to logical conjunction.

By way of disentangling this formula, one may notice that the form $ \sum_{k} G_{ik} H_{kj}$ is what is usually called a scalar product. In this case it is the scalar product of the $ i^{\mbox{\small {th}}}$ row of $ G$ with the $ j^{\mbox{\small {th}}}$ column of $ H$.

To make this statement more concrete, let us go back to the particular examples of $ G$ and $ H$ that we came in with:

$ G = \left[\begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 &... ... 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 & 0 & 0 & 0 \ \end{array}\right]$
$ H = \left[\begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 &... ... 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 & 0 & 0 & 0 \ \end{array}\right]$

The formula for computing $ G \circ H$ says the following:

\begin{displaymath}\begin{array}{cl} (G \circ H)_{ij} \ = & \mbox{the}\ ij^{\m... ...ox{column of}\ H \ = & \sum_{k} G_{ik} H_{kj} \ \end{array}\end{displaymath}

As it happens, it is possible to make exceedingly light work of this example, since there is only one row of $ G$ and one column of $ H$ that are not all zeroes. Taking the scalar product, in a logical way, of the fourth row of $ G$ with the fourth column of $ H$ produces the sole non-zero entry for the matrix of $ G \circ H$.

$ G \circ H = \left[\begin{array}{ccccccc} 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 &... ... 0 & 0 & 0 & 0 & 0 & 0 & 0 \ 0 & 0 & 0 & 0 & 0 & 0 & 0 \ \end{array}\right]$



"matrix representation of relation composition" is owned by Jon Awbrey.
(view preamble | get metadata)

View style:

See Also: relation theory, algebraic representation of relation composition, geometric representation of relation composition, graph-theoretic representation of relation composition, logical matrix


This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: column, row, scalar product, conjunction, summation, arithmetic, difference, basis, properties, moment's, amenable, representations, matrices, place, coefficient, Boolean domain, factors, block, collection, range, cardinality, composite, relation composition, formula, multiplicities, positive, disjunction, operation, represents, plus sign, distributive law, product, algebraic, distributive, relations, linear algebra, matrix multiplication, analogy, logical matrices
There is 1 reference to this entry.

This is version 18 of matrix representation of relation composition, born on 2008-02-22, modified 2008-02-23.
Object id is 10312, canonical name is MatrixRepresentationOfRelationComposition.
Accessed 633 times total.

Classification:
AMS MSC03B10 (Mathematical logic and foundations :: General logic :: Classical first-order logic)
 03E20 (Mathematical logic and foundations :: Set theory :: Other classical set theory )
 05B20 (Combinatorics :: Designs and configurations :: Matrices )
 05B30 (Combinatorics :: Designs and configurations :: Other designs, configurations)
 05C65 (Combinatorics :: Graph theory :: Hypergraphs)
 08A02 (General algebraic systems :: Algebraic structures :: Relational systems, laws of composition)
 68P15 (Computer science :: Theory of data :: Database theory)
 68R01 (Computer science :: Discrete mathematics in relation to computer science :: General)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)