# Matrix of ones

In mathematics, a matrix of ones or all-ones matrix is a matrix where every element is equal to one.[1] Examples of standard notation are given below:

${\displaystyle J_{2}={\begin{pmatrix}1&1\\1&1\end{pmatrix}};\quad J_{3}={\begin{pmatrix}1&1&1\\1&1&1\\1&1&1\end{pmatrix}};\quad J_{2,5}={\begin{pmatrix}1&1&1&1&1\\1&1&1&1&1\end{pmatrix}};\quad J_{1,2}={\begin{pmatrix}1&1\end{pmatrix}}.\quad }$

Some sources call the all-ones matrix the unit matrix,[2] but that term may also refer to the identity matrix, a different matrix.

A vector of ones or all-ones vector is matrix of ones having row or column form.

## Properties

For an n × n matrix of ones J, the following properties hold:

• The trace of J is n,[3] and the determinant is 1 if n is 1, or 0 otherwise.
• The characteristic polynomial of J is ${\displaystyle (x-n)x^{n-1}}$ .
• The rank of J is 1 and the eigenvalues are n with multiplicity 1 and 0 with multiplicity n − 1.[4]
• ${\displaystyle J^{k}=n^{k-1}J}$  for ${\displaystyle k=1,2,\ldots .}$ [5]
• J is the neutral element of the Hadamard product.[6]

When J is considered as a matrix over the real numbers, the following additional properties hold:

## Applications

The all-ones matrix arises in the mathematical field of combinatorics, particularly involving the application of algebraic methods to graph theory. For example, if A is the adjacency matrix of a n-vertex undirected graph G, and J is the all-ones matrix of the same dimension, then G is a regular graph if and only if AJ = JA.[7] As a second example, the matrix appears in some linear-algebraic proofs of Cayley's formula, which gives the number of spanning trees of a complete graph, using the matrix tree theorem.