You are on page 1of 2

A logical matrix, binary matrix, relation matrix, Boolean matrix, or (0,1) matrix is

a matrix with entries from the Boolean domain B = {0, 1}. Such a matrix can be used to represent
a binary relation between a pair of finite sets

The number of binary matrices is , so the number of square binary matrices is

which, for n = 1, 2, ..., gives 2, 16, 512, 65536, etc. and is thus finite.

A Boolean matrix algebra is described which enables many logical functions to

be manipulated simultaneously. The algebra is similar to conventional matrix
algebra and its structure includes a topological description of logic circuits. The
matrices are readily manipulated by the digital computer.

1. A Boolean matrix has an inverse if and only if it is orthogonal, ie, if A O A T !
= I, then no inverse exists.
2. A Boolean matrix can be uniquely decomposed into the disjoint union of a
symmetric and skew-symmetric Boolean matrix.
3. A Boolean matrix can be uniquely decomposed into the joint intersection
of a symmetric and tranjugate Boolean matrix
Tranjugate matrix is a matrix for which A U A T is I.
If a Boolean matrix is tranjugate, then diagonal elements must be 1.

Applications / Examples :
1. Matrix representation of a relation
If R is a binary relation between the finite indexed sets X and Y (so R XY), then R can be
represented by the logical matrix M whose row and column indices index the elements
of X and Y, respectively, such that the entries of M are defined by:
< MATRIX RELATION > (function 1)
The binary relation R on the set {1, 2, 3, 4} is defined so that aRb holds if and only
if a divides b evenly, with no remainder. For example, 2R4 holds because 2 divides 4 without
leaving a remainder, but 3R4 does not hold because when 3 divides 4 there is a remainder of 1.
The following set is the set of pairs for which the relation R holds.
{(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}.
The corresponding representation as a Boolean matrix is:

(matrix 2)

2. A bitmap image containing pixels in only two colors can be represented as a (0,1)-matrix in
which the 0's represent pixels of one color and the 1's represent pixels of the other color.

3. The matrix representation of the equality relation on a finite set is an identity matrix, that is,
one whose entries on the diagonal are all 1, while the others are all 0.

4. An adjacency matrix in graph theory is a matrix whose rows and columns represent the
vertices and whose entries represent the edges of the graph. The adjacency matrix of
a simple, undirected graph is a binary symmetric matrix with zero diagonal.
Let G and H be two directed graphs with the same vertex set. Let A be the
adjacency matrix for G and B the adjacency matrix for H. Then the adjacency
matrix for G H is A + B, where Boolean addition used on the entries of
matrices A and B

Finally, Boolean matrix multiplication and addition can be put together to

compute the adjacency matrix A+ for G+, the transitive closure of G:
G + = G1 G2 Gn
A + = A1 + A2 + + An

Matrix Multiplication
Let A and B be n m matrices.
Let A = [aij ] be m k and B = [bij ] be k n. The Boolean product of A and B, A
O B, is the m n matrix C = [cij ] defined by
cij = (ai1 b1j ) (ai2 b2j ) (ai3 b3j ) (aik bkj ).
1. The meet of A and B: A B = [aij bij ] (LOGICAL AND)
2. The join of A and B: A B = [aij bij ] (LOGICAL OR)

Boolean operations on zero-one matrices is completely analogous to the

standard operations, except we use the Boolean operators (logical AND) and
(logical OR) on the binary digits instead of ordinary multiplication and addition,
Boolean matrix multiplication is like normal matrix product, but with addition
defined as 1+1=1 (logical OR), and multiplication defined as 1.1 = 1 (logical


I have two boolean matrices:

A = |1 1 0|
|0 1 0|
|0 0 1|


B = |1 0 0|
|1 1 1|
|0 0 1|

(matrix 3)