# Costas array

In mathematics, a Costas array can be regarded geometrically as a set of n points lying on the squares of a n×n checkerboard, such that each row or column contains only one point, and that all of the n(n − 1)/2 displacement vectors between each pair of dots are distinct. This results in an ideal 'thumbtack' auto-ambiguity function, making the arrays useful in applications such as sonar and radar. Costas arrays can be regarded as two-dimensional cousins of the one-dimensional Golomb ruler construction, and, as well as being of mathematical interest, have similar applications in experimental design and phased array radar engineering.

Costas arrays are named after John P. Costas, who first wrote about them in a 1965 technical report. Independently, Edgar Gilbert also wrote about them in the same year, publishing what is now known as the logarithmic Welch method of constructing Costas arrays.[1]

## Numerical representation

A Costas array may be represented numerically as an n×n array of numbers, where each entry is either 1, for a point, or 0, for the absence of a point. When interpreted as binary matrices, these arrays of numbers have the property that, since each row and column has the constraint that it only has one point on it, they are therefore also permutation matrices. Thus, the Costas arrays for any given n are a subset of the permutation matrices of order n.

Arrays are usually described as a series of indices specifying the column for any row. Since it is given that any column has only one point, it is possible to represent an array one-dimensionally. For instance, the following is a valid Costas array of order N = 4:

 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 0

There are dots at coordinates: (1,2), (2,1), (3,3), (4,4)

Since the x-coordinate increases linearly, we can write this in shorthand as the set of all y-coordinates. The position in the set would then be the x-coordinate. Observe: {2,1,3,4} would describe the aforementioned array. This makes it easy to communicate the arrays for a given order of N.

## Known arrays

All Costas arrays of size up to and including 29×29 are known. Costas arrays are known for infinitely many sizes because there exist two methods of generating them, both of which work near primes (of which there are infinitely many) and powers of primes. These are known as the Welch and Lempel-Golomb generation methods, and come from a branch of mathematics known as finite field theory.

The following table describes all possible Costas arrays of size up to six 6×6:

N = 1
{1}

N = 2
{1,2} {2,1}

N = 3
{1,3,2} {2,1,3} {2,3,1} {3,1,2}

N = 4
{1,2,4,3} {1,3,4,2} {1,4,2,3} {2,1,3,4} {2,3,1,4} {2,4,3,1} {3,1,2,4} {3,2,4,1} {3,4,2,1} {4,1,3,2} {4,2,1,3} {4,3,1,2}

N = 5
{1,3,4,2,5} {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1,6,2,5} {3,4,2,6,5,1} {3,4,6,1,5,2} {3,5,1,2,6,4} {3,5,1,4,2,6} {3,5,2,1,6,4} {3,5,4,1,2,6} {3,5,4,2,6,1} {3,5,6,1,4,2} {3,5,6,2,1,4} {3,6,1,5,4,2} {3,6,4,5,2,1} {3,6,5,1,2,4} {4,1,2,6,5,3} {4,1,3,2,5,6} {4,1,6,2,3,5} {4,2,1,5,6,3} {4,2,1,6,3,5} {4,2,3,5,1,6} {4,2,3,6,5,1} {4,2,5,6,1,3} {4,2,6,3,5,1} {4,2,6,5,1,3} {4,3,1,6,2,5} {4,3,5,1,2,6} {4,3,6,1,5,2} {4,5,1,3,2,6} {4,5,1,6,3,2} {4,5,2,1,3,6} {4,5,2,6,1,3} {4,6,1,2,5,3} {4,6,1,5,2,3} {4,6,2,1,5,3} {4,6,2,3,1,5} {4,6,5,2,3,1} {5,1,2,4,3,6} {5,1,3,2,6,4} {5,1,3,4,2,6} {5,1,6,3,4,2} {5,2,3,1,4,6} {5,2,4,3,1,6} {5,2,4,3,6,1} {5,2,6,1,3,4} {5,2,6,1,4,3} {5,3,2,4,1,6} {5,3,2,6,1,4} {5,3,4,1,6,2} {5,3,4,6,2,1} {5,3,6,1,2,4} {5,4,1,6,2,3} {5,4,2,3,6,1} {5,4,6,2,3,1} {6,1,3,4,2,5} {6,1,4,2,3,5} {6,1,4,3,5,2} {6,1,4,5,3,2} {6,1,5,3,2,4} {6,2,1,4,5,3} {6,2,1,5,3,4} {6,2,3,1,5,4} {6,2,3,5,4,1} {6,2,4,1,5,3} {6,2,4,3,1,5} {6,3,1,2,5,4} {6,3,2,4,5,1} {6,3,4,2,1,5} {6,4,1,3,2,5} {6,4,5,1,3,2} {6,4,5,2,1,3} {6,5,1,3,4,2} {6,5,2,3,1,4}

A full database of the arrays for all sizes which have been exhaustively checked is available [1] It is not known whether Costas arrays exist for all sizes. Currently, the smallest sizes for which no arrays are known are 32×32 and 33×33.

## Constructions

### Welch

A Welch–Costas array, or just Welch array, is a Costas array generated using the following method, first discovered by Edgar Gilbert in 1965 and rediscovered in 1982 by Lloyd R. Welch. The Welch–Costas array is constructed by taking a primitive root g of a prime number p and defining the array A by $A_{i,j} = 1$ if $j \equiv g^i \bmod p$, otherwise 0. The result is a Costas array of size p − 1.

Example:

3 is a primitive element modulo 5.

31 = 3
32 = 9 = 4 (mod 5)
33 = 27 = 2 (mod 5)
34 = 81 = 1 (mod 5)

Therefore [3 4 2 1] is a Costas permutation. More specifically, this is an exponential Welch array. The transposition of the array is a logarithmic Welch array.

The number of Welch–Costas arrays which exist for a given size depends on the totient function.

### Lempel–Golomb

The Lempel–Golomb construction takes α and β to be primitive elements of the finite field GF(q) and similarly defines $A_{i,j} = 1$ if $\alpha^i + \beta^j = 1$, otherwise 0. The result is a Costas array of size q − 2. If α + β = 1 then the first row and column may be deleted to form another Costas array of size q − 3: it is not known whether there is such a pair of primitive elements for every prime power q.