A logical matrix, binary matrix, relation matrix, Boolean matrix, or (0, 1) matrix is a
matrix
Matrix most commonly refers to:
* ''The Matrix'' (franchise), an American media franchise
** ''The Matrix'', a 1999 science-fiction action film
** "The Matrix", a fictional setting, a virtual reality environment, within ''The Matrix'' (franchis ...
with entries from the
Boolean domain
In mathematics and abstract algebra, a Boolean domain is a set consisting of exactly two elements whose interpretations include ''false'' and ''true''. In logic, mathematics and theoretical computer science, a Boolean domain is usually written as ...
Such a matrix can be used to represent a
binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over Set (mathematics), sets and is a new set of ordered pairs consisting of ele ...
between a pair of
finite set
In mathematics, particularly set theory, a finite set is a set that has a finite number of elements. Informally, a finite set is a set which one could in principle count and finish counting. For example,
:\
is a finite set with five elements. Th ...
s.
Matrix representation of a relation
If ''R'' is a
binary relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over Set (mathematics), sets and is a new set of ordered pairs consisting of ele ...
between the finite
indexed set
In mathematics, a family, or indexed family, is informally a collection of objects, each associated with an index from some index set. For example, a ''family of real numbers, indexed by the set of integers'' is a collection of real numbers, wher ...
s ''X'' and ''Y'' (so ), 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
:
In order to designate the row and column numbers of the matrix, the sets ''X'' and ''Y'' are indexed with positive integers: ''i'' ranges from 1 to the
cardinality
In mathematics, the cardinality of a set is a measure of the number of elements of the set. For example, the set A = \ contains 3 elements, and therefore A has a cardinality of 3. Beginning in the late 19th century, this concept was generalized ...
(size) of ''X'', and ''j'' ranges from 1 to the cardinality of ''Y''. See the entry on
indexed set
In mathematics, a family, or indexed family, is informally a collection of objects, each associated with an index from some index set. For example, a ''family of real numbers, indexed by the set of integers'' is a collection of real numbers, wher ...
s for more detail.
Example
The binary relation ''R'' on the set is defined so that ''aRb'' holds if and only if ''a''
divides
In mathematics, a divisor of an integer n, also called a factor of n, is an integer m that may be multiplied by some integer to produce n. In this case, one also says that n is a multiple of m. An integer n is divisible or evenly divisible by ...
''b'' evenly, with no remainder. For example, 2''R''4 holds because 2 divides 4 without leaving a remainder, but 3''R''4 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.
:.
The corresponding representation as a logical matrix is
:
which includes a diagonal of ones, since each number divides itself.
Other examples
* A
permutation matrix
In mathematics, particularly in matrix theory, a permutation matrix is a square binary matrix that has exactly one entry of 1 in each row and each column and 0s elsewhere. Each such matrix, say , represents a permutation of elements and, when ...
is a (0, 1)-matrix, all of whose columns and rows each have exactly one nonzero element.
** A
Costas array
In mathematics, a Costas array can be regarded geometrically as a set of ''n'' points, each at the center of a square in an ''n''×''n'' square tiling such that each row or column contains only one point, and all of the ''n''(''n'' &minu ...
is a special case of a permutation matrix.
* An
incidence matrix
In mathematics, an incidence matrix is a logical matrix that shows the relationship between two classes of objects, usually called an incidence relation. If the first class is ''X'' and the second is ''Y'', the matrix has one row for each element ...
in
combinatorics
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many appl ...
and
finite geometry
Finite is the opposite of infinite. It may refer to:
* Finite number (disambiguation)
* Finite set, a set whose cardinality (number of elements) is some natural number
* Finite verb, a verb form that has a subject, usually being inflected or marked ...
has ones to indicate incidence between points (or vertices) and lines of a geometry, blocks of a
block design
In combinatorial mathematics, a block design is an incidence structure consisting of a set together with a family of subsets known as ''blocks'', chosen such that frequency of the elements satisfies certain conditions making the collection of bl ...
, or edges of a
graph (discrete mathematics)
In discrete mathematics, and more specifically in graph theory, a graph is a structure amounting to a Set (mathematics), set of objects in which some pairs of the objects are in some sense "related". The objects correspond to mathematical abstra ...
.
* A
design matrix
In statistics and in particular in regression analysis, a design matrix, also known as model matrix or regressor matrix and often denoted by X, is a matrix of values of explanatory variables of a set of objects. Each row represents an individual ob ...
in
analysis of variance
Analysis of variance (ANOVA) is a collection of statistical models and their associated estimation procedures (such as the "variation" among and between groups) used to analyze the differences among means. ANOVA was developed by the statisticia ...
is a (0, 1)-matrix with constant row sums.
* A logical matrix may represent an
adjacency matrix
In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph.
In the special case of a finite simp ...
in
graph theory
In mathematics, graph theory is the study of ''graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of '' vertices'' (also called ''nodes'' or ''points'') which are conne ...
: non-symmetric matrices correspond to
directed graph
In mathematics, and more specifically in graph theory, a directed graph (or digraph) is a graph that is made up of a set of vertices connected by directed edges, often called arcs.
Definition
In formal terms, a directed graph is an ordered pa ...
s, symmetric matrices to ordinary
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
s, and a 1 on the diagonal corresponds to a
loop
Loop or LOOP may refer to:
Brands and enterprises
* Loop (mobile), a Bulgarian virtual network operator and co-founder of Loop Live
* Loop, clothing, a company founded by Carlos Vasquez in the 1990s and worn by Digable Planets
* Loop Mobile, an ...
at the corresponding vertex.
* The
biadjacency matrix
In graph theory and computer science, an adjacency matrix is a square matrix used to represent a finite graph. The elements of the matrix indicate whether pairs of vertices are adjacent or not in the graph.
In the special case of a finite simple ...
of a simple, undirected
bipartite graph
In the mathematical field of graph theory, a bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V, that is every edge connects a vertex in U to one in V. Vertex sets U and V are ...
is a (0, 1)-matrix, and any (0, 1)-matrix arises in this way.
* The prime factors of a list of ''m''
square-free {{no footnotes, date=December 2015
In mathematics, a square-free element is an element ''r'' of a unique factorization domain ''R'' that is not divisible by a non-trivial square. This means that every ''s'' such that s^2\mid r is a unit of ''R''.
A ...
,
''n''-smooth numbers can be described as a ''m'' × π(''n'') (0, 1)-matrix, where π is the
prime-counting function
In mathematics, the prime-counting function is the function counting the number of prime numbers less than or equal to some real number ''x''. It is denoted by (''x'') (unrelated to the number ).
History
Of great interest in number theory is t ...
, and ''a''
''ij'' is 1 if and only if the ''j''th prime divides the ''i''th number. This representation is useful in the
quadratic sieve The quadratic sieve algorithm (QS) is an integer factorization algorithm and, in practice, the second fastest method known (after the general number field sieve). It is still the fastest for integers under 100 decimal digits or so, and is considerab ...
factoring algorithm.
* A
bitmap image
In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array or bitmap index.
As a noun, the term "bitmap" is very often used to refer to a particular bitmapping application: th ...
containing
pixel
In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest point in an all points addressable display device.
In most digital display devices, pixels are the smal ...
s in only two colors can be represented as a (0, 1)-matrix in which the zeros represent pixels of one color and the ones represent pixels of the other color.
* A binary matrix can be used to check the game rules in the game of
Go
Some properties
The matrix representation of the
equality relation on a finite set is the
identity matrix
In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere.
Terminology and notation
The identity matrix is often denoted by I_n, or simply by I if the size is immaterial o ...
I, that is, the matrix whose entries on the diagonal are all 1, while the others are all 0. More generally, if relation ''R'' satisfies then R is a
reflexive relation
In mathematics, a binary relation ''R'' on a set ''X'' is reflexive if it relates every element of ''X'' to itself.
An example of a reflexive relation is the relation " is equal to" on the set of real numbers, since every real number is equal to ...
.
If the Boolean domain is viewed as a
semiring
In abstract algebra, a semiring is an algebraic structure similar to a ring, but without the requirement that each element must have an additive inverse.
The term rig is also used occasionally—this originated as a joke, suggesting that rigs ar ...
, where addition corresponds to
logical OR
In logic, disjunction is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language sentence "it is raining or it is snowing" can be represented in logic using the disjunctive formula R \lor S ...
and multiplication to
logical AND
In logic, mathematics and linguistics, And (\wedge) is the truth-functional operator of logical conjunction; the ''and'' of a set of operands is true if and only if ''all'' of its operands are true. The logical connective that represents this ...
, the matrix representation of the
composition
Composition or Compositions may refer to:
Arts and literature
*Composition (dance), practice and teaching of choreography
*Composition (language), in literature and rhetoric, producing a work in spoken tradition and written discourse, to include v ...
of two relations is equal to the
matrix product
In mathematics, particularly in linear algebra, matrix multiplication is a binary operation that produces a matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the number of rows in the s ...
of the matrix representations of these relations.
This product can be computed in
expected time O(''n''
2).
Frequently operations on binary matrices are defined in terms of
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his book ...
mod 2—that is, the elements are treated as elements of the
Galois field
In mathematics, a finite field or Galois field (so-named in honor of Évariste Galois) is a field that contains a finite number of elements. As with any field, a finite field is a set on which the operations of multiplication, addition, subtra ...
. They arise in a variety of representations and have a number of more restricted special forms. They are applied e.g. in
XOR-satisfiability
In logic and computer science, the Boolean satisfiability problem (sometimes called propositional satisfiability problem and abbreviated SATISFIABILITY, SAT or B-SAT) is the problem of determining if there exists an interpretation that satisfie ...
.
The number of distinct ''m''-by-''n'' binary matrices is equal to 2
''mn'', and is thus finite.
Lattice
Let ''n'' and ''m'' be given and let ''U'' denote the set of all logical ''m'' × ''n'' matrices. Then ''U'' has a
partial order
In mathematics, especially order theory, a partially ordered set (also poset) formalizes and generalizes the intuitive concept of an ordering, sequencing, or arrangement of the elements of a set. A poset consists of a set together with a binary ...
given by
:
In fact, ''U'' forms a
Boolean algebra
In mathematics and mathematical logic, Boolean algebra is a branch of algebra. It differs from elementary algebra in two ways. First, the values of the variables are the truth values ''true'' and ''false'', usually denoted 1 and 0, whereas in e ...
with the operations
and
or AND may refer to:
Logic, grammar, and computing
* Conjunction (grammar), connecting two words, phrases, or clauses
* Logical conjunction in mathematical logic, notated as "∧", "⋅", "&", or simple juxtaposition
* Bitwise AND, a boolea ...
&
or between two matrices applied component-wise. The complement of a logical matrix is obtained by swapping all zeros and ones for their opposite.
Every logical matrix has a transpose Suppose ''A'' is a logical matrix with no columns or rows identically zero. Then the matrix product, using Boolean arithmetic,
contains the ''m'' × ''m''
identity matrix
In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere.
Terminology and notation
The identity matrix is often denoted by I_n, or simply by I if the size is immaterial o ...
, and the product
contains the ''n'' × ''n'' identity.
As a mathematical structure, the Boolean algebra ''U'' forms a
lattice
Lattice may refer to:
Arts and design
* Latticework, an ornamental criss-crossed framework, an arrangement of crossing laths or other thin strips of material
* Lattice (music), an organized grid model of pitch ratios
* Lattice (pastry), an orna ...
ordered by
inclusion
Inclusion or Include may refer to:
Sociology
* Social inclusion, aims to create an environment that supports equal opportunity for individuals and groups that form a society.
** Inclusion (disability rights), promotion of people with disabiliti ...
; additionally it is a multiplicative lattice due to matrix multiplication.
Every logical matrix in ''U'' corresponds to a binary relation. These listed operations on ''U'', and ordering, correspond to a
calculus of relations
In mathematical logic, algebraic logic is the reasoning obtained by manipulating equations with free variables.
What is now usually called classical algebraic logic focuses on the identification and algebraic description of models appropriate for ...
, where the matrix multiplication represents
composition of relations
In the mathematics of binary relations, the composition of relations is the forming of a new binary relation from two given binary relations ''R'' and ''S''. In the calculus of relations, the composition of relations is called relative multiplica ...
.
[ Irving Copilowish (December 1948). "Matrix development of the calculus of relations", ]Journal of Symbolic Logic
The '' Journal of Symbolic Logic'' is a peer-reviewed mathematics journal published quarterly by Association for Symbolic Logic. It was established in 1936 and covers mathematical logic. The journal is indexed by '' Mathematical Reviews'', Zentra ...
13(4): 193–20
Jstor link
/ref>
Logical vectors
If ''m'' or ''n'' equals one, then the ''m'' × ''n'' logical matrix (''M''ij) is a logical vector. If ''m'' = 1, the vector is a row vector, and if ''n'' = 1, it is a column vector. In either case the index equaling one is dropped from denotation of the vector.
Suppose and are two logical vectors. The outer product
In linear algebra, the outer product of two coordinate vector
In linear algebra, a coordinate vector is a representation of a vector as an ordered list of numbers (a tuple) that describes the vector in terms of a particular ordered basis. An ea ...
of ''P'' and ''Q'' results in an ''m'' × ''n'' rectangular relation
In mathematics, a binary relation associates elements of one set, called the ''domain'', with elements of another set, called the ''codomain''. A binary relation over sets and is a new set of ordered pairs consisting of elements in and ...
:
A re-ordering of the rows and columns of such a matrix can assemble all the ones into a rectangular part of the matrix.
Let ''h'' be the vector of all ones. Then if ''v'' is an arbitrary logical vector, the relation ''R'' = ''v h''T has constant rows determined by ''v''. In the calculus of relations
In mathematical logic, algebraic logic is the reasoning obtained by manipulating equations with free variables.
What is now usually called classical algebraic logic focuses on the identification and algebraic description of models appropriate for ...
such an ''R'' is called a vector.[ A particular instance is the universal relation .
For a given relation ''R'', a maximal rectangular relation contained in ''R'' is called a concept in R. Relations may be studied by decomposing into concepts, and then noting the induced concept lattice.
Consider the table of group-like structures, where "unneeded" can be denoted 0, and "required" denoted by 1, forming a logical matrix ''R''. To calculate elements of , it is necessary to use the logical inner product of pairs of logical vectors in rows of this matrix. If this inner product is 0, then the rows are orthogonal. In fact, semigroup is orthogonal to loop, small category is orthogonal to quasigroup, and groupoid is orthogonal to magma. Consequently there are zeros in , and it fails to be a ]universal relation
In mathematics, a homogeneous relation (also called endorelation) over a set ''X'' is a binary relation over ''X'' and itself, i.e. it is a subset of the Cartesian product . This is commonly phrased as "a relation on ''X''" or "a (binary) relation ...
.
Row and column sums
Adding up all the ones in a logical matrix may be accomplished in two ways: first summing the rows or first summing the columns. When the row sums are added, the sum is the same as when the column sums are added. In incidence geometry
In mathematics, incidence geometry is the study of incidence structures. A geometric structure such as the Euclidean plane is a complicated object that involves concepts such as length, angles, continuity, betweenness, and incidence. An ''incidenc ...
, the matrix is interpreted as an incidence matrix
In mathematics, an incidence matrix is a logical matrix that shows the relationship between two classes of objects, usually called an incidence relation. If the first class is ''X'' and the second is ''Y'', the matrix has one row for each element ...
with the rows corresponding to "points" and the columns as "blocks" (generalizing lines made of points). A row sum is called its ''point degree'', and a column sum is the ''block degree''. Proposition 1.6 in ''Design Theory'' says that the sum of point degrees equals the sum of block degrees.
An early problem in the area was "to find necessary and sufficient conditions for the existence of an incidence structure
In mathematics, an incidence structure is an abstract system consisting of two types of objects and a single relationship between these types of objects. Consider the points and lines of the Euclidean plane as the two types of objects and ignore al ...
with given point degrees and block degrees (or in matrix language, for the existence of a (0, 1)-matrix of type ''v'' × ''b'' with given row and column sums".[ Such a structure is a ]block design
In combinatorial mathematics, a block design is an incidence structure consisting of a set together with a family of subsets known as ''blocks'', chosen such that frequency of the elements satisfies certain conditions making the collection of bl ...
.
See also
* List of matrices
This article lists some important classes of matrices used in mathematics, science and engineering. A matrix (plural matrices, or less commonly matrixes) is a rectangular array of numbers called ''entries''. Matrices have a long history of both st ...
* Binatorix (a binary De Bruijn torus)
* Bit array
A bit array (also known as bitmask, bit map, bit set, bit string, or bit vector) is an array data structure that compactly stores bits. It can be used to implement a simple set data structure. A bit array is effective at exploiting bit-level p ...
* Redheffer matrix
* Truth table
A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional argumen ...
Notes
References
* , § 31.3, Binary Matrices
*
* H. J. Ryser
Herbert John Ryser (July 28, 1923 – July 12, 1985) was a professor of mathematics, widely regarded as one of the major figures in combinatorics in the 20th century.[Canadian Journal of Mathematics
The ''Canadian Journal of Mathematics'' (french: Journal canadien de mathématiques) is a bimonthly mathematics journal published by the Canadian Mathematical Society.
It was established in 1949 by H. S. M. Coxeter and G. de B. Robinson. The ...]
9: 371–7.
* Ryser, H.J. (1960) "Traces of matrices of zeroes and ones", ''Canadian Journal of Mathematics'' 12: 463–76.
* Ryser, H.J. (1960) "Matrices of Zeros and Ones", Bulletin of the American Mathematical Society
The ''Bulletin of the American Mathematical Society'' is a quarterly mathematical journal published by the American Mathematical Society.
Scope
It publishes surveys on contemporary research topics, written at a level accessible to non-experts. I ...
66: 442–64.
* D. R. Fulkerson (1960) "Zero-one matrices with zero trace", Pacific Journal of Mathematics
The Pacific Journal of Mathematics is a mathematics research journal supported by several universities and research institutes, and currently published on their behalf by Mathematical Sciences Publishers, a non-profit academic publishing organisati ...
10; 831–6
* D. R. Fulkerson & H. J. Ryser (1961) "Widths and heights of (0, 1)-matrices", ''Canadian Journal of Mathematics'' 13: 239–55.
* L. R. Ford Jr.
Lester Randolph Ford Jr. (September 23, 1927 – February 26, 2017) was an American mathematician specializing in network flow problems. He was the son of mathematician Lester R. Ford Sr.
Ford's paper with D. R. Fulkerson on the maximum flow p ...
& D. R. Fulkerson (1962) § 2.12 "Matrices composed of 0's and 1's", pages 79 to 91 in ''Flows in Networks'', Princeton University Press
Princeton University Press is an independent publisher with close connections to Princeton University. Its mission is to disseminate scholarship within academia and society at large.
The press was founded by Whitney Darrow, with the financial su ...
External links
*
{{DEFAULTSORT:Logical Matrix
Boolean algebra
Matrices