matrix representation of relation composition


\PMlinkescapephrase

compositionMathworldPlanetmathPlanetmath \PMlinkescapephraseComposition \PMlinkescapephraseorder \PMlinkescapephraseOrder \PMlinkescapephrasereflect \PMlinkescapephraseReflect \PMlinkescapephraserelationMathworldPlanetmath \PMlinkescapephraseRelation \PMlinkescapephraserelational compositionPlanetmathPlanetmath \PMlinkescapephraseRelational composition \PMlinkescapephraserepresentation \PMlinkescapephraseRepresentation \PMlinkescapephrasesimple \PMlinkescapephraseSimple

We have it within our reach to pick up another way of representing 2-adic relations (http://planetmath.org/RelationTheory), namely, the representation as logical matricesMathworldPlanetmath, and also to grasp the analogyMathworldPlanetmath between relational composition (http://planetmath.org/RelationComposition2) and ordinary matrix multiplicationMathworldPlanetmath 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 GH of the 2-adic relations G and H.

Here is the setup that we had before:

X=Y=Z={1,2,3,4,5,6,7}

G=4:3+4:4+4:5X×Y=X×XH=3:4+4:4+5:4Y×Z=X×X

Let us recall the rule for finding the relational composition of a pair of 2-adic relations. Given the 2-adic relations PX×Y and QY×Z, the relational composition of P and Q, in that order, is written as PQ, 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 productMathworldPlanetmathPlanetmath of two elementary relations of shapes a:b and c:d.

(a:b)(c:d)=(a:d)ifb=c(a:b)(c:d)=0otherwise

To find the relational composition GH, one may begin by writing it as a quasi-algebraic product:

GH=(4:3+4:4+4:5)(3:4+4:4+5:4)

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

GH=(4:3)(3:4)+(4:3)(4:4)+(4:3)(5:4)+(4:4)(3:4)+(4:4)(4:4)+(4:4)(5:4)+(4:5)(3:4)+(4:5)(4:4)+(4:5)(5:4)

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

GH=(4:4)+0+0+0+(4:4)+0+0+0+(4:4)

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

GH=(4:4)

With an eye toward extracting a general formulaMathworldPlanetmathPlanetmath 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 GH.

1 Arrangement

Given the space X={1,2,3,4,5,6,7}, whose cardinality |X| is 7, there are |X×X|=|X||X|=77=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 collectionMathworldPlanetmath of elementary relations as being arranged in a lexicographic block of the following form:

1:11:21:31:41:51:61:72:12:22:32:42:52:62:73:13:23:33:43:53:63:74:14:24:34:44:54:64:75:15:25:35:45:55:65:76:16:26:36:46:56:66:77:17:27:37:47:57:67:7

2 Expansion

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

G=ijGij(i:j)
H=ijHij(i:j)

The notation ij indicates a logical sum over the collection of elementary relations i:j, while the factors Gij and Hij are values in the boolean domain 𝔹={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 Lij 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:

G=4:3+4:4+4:5=0(1:1)+0(1:2)+0(1:3)+0(1:4)+0(1:5)+0(1:6)+0(1:7)+0(2:1)+0(2:2)+0(2:3)+0(2:4)+0(2:5)+0(2:6)+0(2:7)+0(3:1)+0(3:2)+0(3:3)+0(3:4)+0(3:5)+0(3:6)+0(3:7)+0(4:1)+0(4:2)+1(4:3)+1(4:4)+1(4:5)+0(4:6)+0(4:7)+0(5:1)+0(5:2)+0(5:3)+0(5:4)+0(5:5)+0(5:6)+0(5:7)+0(6:1)+0(6:2)+0(6:3)+0(6:4)+0(6:5)+0(6:6)+0(6:7)+0(7:1)+0(7:2)+0(7:3)+0(7:4)+0(7:5)+0(7:6)+0(7:7)

H=3:4+4:4+5:4=0(1:1)+0(1:2)+0(1:3)+0(1:4)+0(1:5)+0(1:6)+0(1:7)+0(2:1)+0(2:2)+0(2:3)+0(2:4)+0(2:5)+0(2:6)+0(2:7)+0(3:1)+0(3:2)+0(3:3)+1(3:4)+0(3:5)+0(3:6)+0(3:7)+0(4:1)+0(4:2)+0(4:3)+1(4:4)+0(4:5)+0(4:6)+0(4:7)+0(5:1)+0(5:2)+0(5:3)+1(5:4)+0(5:5)+0(5:6)+0(5:7)+0(6:1)+0(6:2)+0(6:3)+0(6:4)+0(6:5)+0(6:6)+0(6:7)+0(7:1)+0(7:2)+0(7:3)+0(7:4)+0(7:5)+0(7:6)+0(7:7)

3 Extraction

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

G=[0000000000000000000000011100000000000000000000000]

H=[0000000000000000010000001000000100000000000000000]

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 GH can be regarded as a product of sums, a fact that can be indicated as follows:

GH=(ijGij(i:j))(ijHij(i:j)).

The composite relation GH is itself a 2-adic relation over the same space X, in other words, GHX×X, and this means that GH must be amenable to being written as a logical sum of the following form:

GH=ij(GH)ij(i:j).

In this formula, (GH)ij is the coefficient of GH with respect to the elementary relation i:j.

One of the best ways to reason out what GH should be is to ask oneself what its coefficient (GH)ij should be for each of the elementary relations i:j in turn.

So let us pose the question:

(GH)ij=What?

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

GH=(ikGik(i:k))(kjHkj(k:j)).

A moment’s thought will tell us that (GH)ij=1 if and only if there is an element k in X such that Gik=1 and Hkj=1.

Consequently, we have the result:

(GH)ij=kGikHkj.

This follows from the properties of logical products and sums, specifically, from the fact that the product GikHkj is 1 if and only if both Gik and Hkj are 1, and from the fact that kFk is equal to 1 just in case some Fk is 1.

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

GH=ij(GH)ij(i:j)=ij(kGikHkj)(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 kGikHkj is what is usually called a scalar productMathworldPlanetmath. In this case it is the scalar product of the ith row of G with the jth 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=[0000000000000000000000011100000000000000000000000]

H=[0000000000000000010000001000000100000000000000000]

The formula for computing GH says the following:

(GH)ij=theijthentry in the matrix representation forGH=the entry in theithrow and thejthcolumn ofGH=the scalar product of theithrow ofGwith the jthcolumn ofH=kGikHkj

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 GH.

GH=[0000000000000000000000001000000000000000000000000]

Title matrix representation of relation composition
Canonical name MatrixRepresentationOfRelationComposition
Date of creation 2013-03-22 17:50:28
Last modified on 2013-03-22 17:50:28
Owner Jon Awbrey (15246)
Last modified by Jon Awbrey (15246)
Numerical id 21
Author Jon Awbrey (15246)
Entry type Example
Classification msc 68R01
Classification msc 68P15
Classification msc 08A02
Classification msc 05C65
Classification msc 05B30
Classification msc 05B20
Classification msc 03E20
Classification msc 03B10
Related topic RelationTheory
Related topic AlgebraicRepresentationOfRelationComposition
Related topic GeometricRepresentationOfRelationComposition
Related topic GraphTheoreticRepresentationOfRelationComposition
Related topic LogicalMatrix