Logical Matrices
   HOME

TheInfoList



OR:

A logical matrix, binary matrix, relation matrix, Boolean matrix, or (0, 1)-matrix is a
matrix Matrix (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the m ...
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 ...
Such a matrix can be used to represent a
binary relation In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
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. It is an important tool in combinatorial mathematics and
theoretical computer science Theoretical computer science is a subfield of computer science and mathematics that focuses on the Abstraction, abstract and mathematical foundations of computation. It is difficult to circumscribe the theoretical areas precisely. The Associati ...
.


Matrix representation of a relation

If ''R'' is a
binary relation In mathematics, a binary relation associates some elements of one Set (mathematics), set called the ''domain'' with some elements of another set called the ''codomain''. Precisely, a binary relation over sets X and Y is a set of ordered pairs ...
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, where a ...
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 :m_ = \begin 1 & (x_i, y_j) \in R, \\ 0 & (x_i, y_j) \not\in R. \end In order to designate the row and column numbers of the matrix, the sets ''X'' and ''Y'' are indexed with positive
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
s: ''i'' ranges from 1 to the
cardinality The thumb is the first digit of the hand, next to the index finger. When a person is standing in the medical anatomical position (where the palm is facing to the front), the thumb is the outermost digit. The Medical Latin English noun for thum ...
(size) of ''X'', and ''j'' ranges from 1 to the cardinality of ''Y''. See the article 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, where a ...
s for more detail. The
transpose In linear algebra, the transpose of a Matrix (mathematics), matrix is an operator which flips a matrix over its diagonal; that is, it switches the row and column indices of the matrix by producing another matrix, often denoted by (among other ...
R^T of the logical matrix R of a binary relation corresponds to the
converse relation In mathematics, the converse of a binary relation is the relation that occurs when the order of the elements is switched in the relation. For example, the converse of the relation 'child of' is the relation 'parent of'. In formal terms ...
.


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 divisibl ...
''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 :\begin 1 & 1 & 1 & 1 \\ 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end, 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 with all other entries 0. An permutation matrix can represent a permutation of elements. ...
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 geometry, 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''& ...
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 o ...
in
combinatorics Combinatorics is an area of mathematics primarily concerned with counting, both as a means and as an end to obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many ...
and
finite geometry A finite geometry is any geometry, geometric system that has only a finite set, finite number of point (geometry), points. The familiar Euclidean geometry is not finite, because a Euclidean line contains infinitely many points. A geometry based ...
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 number of occurrences of each element satisfies certain conditions making the co ...
, or edges of a
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 discret ...
. * 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 o ...
in
analysis of variance Analysis of variance (ANOVA) is a family of statistical methods used to compare the Mean, means of two or more groups by analyzing variance. Specifically, ANOVA compares the amount of variation ''between'' the group means to the amount of variati ...
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 (discrete mathematics), graph. The elements of the matrix (mathematics), matrix indicate whether pairs of Vertex (graph theory), vertices ...
in
graph theory In mathematics and computer science, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures used to model pairwise relations between objects. A graph in this context is made up of ''Vertex (graph ...
: non-
symmetric Symmetry () in everyday life refers to a sense of harmonious and beautiful proportion and balance. In mathematics, the term has a more precise definition and is usually used to refer to an object that is invariant under some transformations ...
matrices correspond to directed graphs, 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 discret ...
s, and a 1 on the diagonal corresponds to a loop 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 simp ...
of a simple, undirected
bipartite graph In the mathematics, mathematical field of graph theory, a bipartite graph (or bigraph) is a Graph (discrete mathematics), graph whose vertex (graph theory), vertices can be divided into two disjoint sets, disjoint and Independent set (graph theo ...
is a (0, 1)-matrix, and any (0, 1)-matrix arises in this way. * The
prime factor A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only ways ...
s 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''. ...
, ''n''-smooth numbers can be described as an ''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 . It is denoted by (unrelated to the number ). A symmetric variant seen sometimes is , which is equal ...
, 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 consider ...
factoring algorithm. * A
bitmap image In computing, a bitmap (also called raster) graphic is an image formed from rows of different colored pixels. A GIF is an example of a graphics image file that uses a bitmap. As a noun, the term "bitmap" is very often used to refer to a partic ...
containing
pixel In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a Raster graphics, raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, p ...
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. * The
four valued logic In logic, a four-valued logic is any logic with four truth values. Several types of four-valued logic have been advanced. Belnap Nuel Belnap considered the challenge of question answering by computer in 1975. Noting human fallibility, he was con ...
of two bits, transformed by 2x2 logical matrices, forms a
transition system In theoretical computer science, a transition system is a concept used in the study of computation. It is used to describe the potential behavior of discrete systems. It consists of states and transitions between states, which may be labeled wi ...
. * A
recurrence plot In descriptive statistics and chaos theory, a recurrence plot (RP) is a plot showing, for each moment j in time, the times at which the state of a dynamical system returns to the previous state at i, i.e., when the phase space trajectory visits rou ...
and its variants are matrices that shows which pairs of points are closer than a certain vicinity threshold in a
phase space The phase space of a physical system is the set of all possible physical states of the system when described by a given parameterization. Each possible state corresponds uniquely to a point in the phase space. For mechanical systems, the p ...
.


Some properties

The matrix representation of the
equality relation In mathematics, equality is a relationship between two quantities or expressions, stating that they have the same value, or represent the same mathematical object. Equality between and is written , and read " equals ". In this equality, ...
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. It has unique properties, for example when the identity matrix represents a geometric transformation, the obje ...
''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 itself. A ...
. If the Boolean domain is viewed as a
semiring In abstract algebra, a semiring is an algebraic structure. Semirings are a generalization of rings, dropping the requirement that each element must have an additive inverse. At the same time, semirings are a generalization of bounded distribu ...
, where addition corresponds to
logical OR In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as \lor and read aloud as "or". For instance, the English language, English language ...
and multiplication to
logical AND In logic, mathematics and linguistics, ''and'' (\wedge) is the truth-functional operator of conjunction or logical conjunction. The logical connective of this operator is typically represented as \wedge or \& or K (prefix) or \times or \cdo ...
, 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 ...
of two relations is equal to the
matrix product In mathematics, specifically 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 operations for integers, other than the usual ones from elementary arithmetic, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to mo ...
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, subtr ...
\bold(2) = \mathbb_2. 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) asks whether there exists an interpretation that satisfies a given Boolean f ...
. 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 partial order on a set is an arrangement such that, for certain pairs of elements, one precedes the other. The word ''partial'' is used to indicate that not every pair of elements needs to be comparable ...
given by :\forall A,B \in U, \quad A \leq B \quad \text \quad \forall i,j \quad A_ = 1 \implies B_ = 1 . 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 variable (mathematics), variables are the truth values ''true'' and ''false'', usually denot ...
with the operations and & 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, A^A 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. It has unique properties, for example when the identity matrix represents a geometric transformation, the obje ...
, and the product AA^ contains the ''n'' × ''n'' identity. As a mathematical structure, the Boolean algebra ''U'' forms a lattice ordered by
inclusion Inclusion or Include may refer to: Sociology * Social inclusion, action taken to support people of different backgrounds sharing life together. ** Inclusion (disability rights), promotion of people with disabilities sharing various aspects of lif ...
; 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 ...
.


Logical vectors

If ''m'' or ''n'' equals one, then the ''m'' × ''n'' logical matrix (''m''''ij'') is a logical vector or
bit string 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 pa ...
. If ''m'' = 1, the vector is a row vector, and if ''n'' = 1, it is a column vector. In either case the index equaling 1 is dropped from denotation of the vector. Suppose (P_i),\, i=1,2,\ldots,m and (Q_j),\, j=1,2,\ldots,n are two logical vectors. The
outer product In linear algebra, the outer product of two coordinate vectors is the matrix whose entries are all products of an element in the first vector with an element in the second vector. If the two coordinate vectors have dimensions ''n'' and ''m'', the ...
of ''P'' and ''Q'' results in an ''m'' × ''n'' rectangular relation :m_ = P_i \land Q_j. A reordering 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 hh^. 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 RR^, 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,
small category In mathematics, a category (sometimes called an abstract category to distinguish it from a concrete category) is a collection of "objects" that are linked by "arrows". A category has two basic properties: the ability to compose the arrows asso ...
is orthogonal to
quasigroup In mathematics, especially in abstract algebra, a quasigroup is an algebraic structure that resembles a group in the sense that " division" is always possible. Quasigroups differ from groups mainly in that the associative and identity element pro ...
, and
groupoid In mathematics, especially in category theory and homotopy theory, a groupoid (less often Brandt groupoid or virtual group) generalises the notion of group in several equivalent ways. A groupoid can be seen as a: * '' Group'' with a partial fu ...
is orthogonal to
magma Magma () is the molten or semi-molten natural material from which all igneous rocks are formed. Magma (sometimes colloquially but incorrectly referred to as ''lava'') is found beneath the surface of the Earth, and evidence of magmatism has also ...
. Consequently there are zeros in RR^, and it fails to be a
universal relation In mathematics, a homogeneous relation (also called endorelation) on a set ''X'' is a binary relation between ''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 ''incide ...
, 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 o ...
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''. The sum of point degrees equals the sum of block degrees.E.g., see 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 Point (geometry), points and Line (geometry), lines of the Euclidean plane as t ...
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". This problem is solved by the Gale–Ryser theorem.


See also

*
List of matrices A list is a set of discrete items of information collected and set forth in some format for utility, entertainment, or other purposes. A list may be memorialized in any number of ways, including existing only in the mind of the list-maker, but ...
* 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 par ...
* Disjunct matrix * 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 arg ...
*
Three-valued logic In logic, a three-valued logic (also trinary logic, trivalent, ternary, or trilean, sometimes abbreviated 3VL) is any of several many-valued logic systems in which there are three truth values indicating ''true'', ''false'', and some third value ...


Notes


References

* * * * * * * * * *


External links

* {{DEFAULTSORT:Logical Matrix Boolean algebra Matrices (mathematics)