Permutation Matrices, Their Discrete Derivatives and Extremal Properties

For a permutation $\pi$, and the corresponding permutation matrix, we introduce the notion of {\em discrete derivative}, obtained by taking differences of successive entries in $\pi$. We characterize the possible derivatives of permutations, and consider questions for permutations with certain properties satisfied by the derivative. For instance, we consider permutations with distinct derivatives, and the relationship to so-called Costas arrays.


Introduction
Let π = (π 1 , π 2 , . . ., π n ) be a permutation of {1, 2, . . ., n}, a permutation of order n.The permutation π can be given in the equivalent form as an n × n permutation matrix P π with 1's in positions (i, π i ) for i = 1, 2, . . ., n and 0's elsewhere.Let S n denote the set of all permutations of order n, and let P n denote the corresponding set of n × n permutation matrices.We define the discrete derivative of π and P π to be the vector The integers π i − π i−1 are the first-order differences of π.For k = 1, 2, . . ., n − 1 we define the kth order differences of π to be integers π i − π i−k for i = k + 1, . . ., n.Note that the kth order differences for k ≥ 2 are sums of first-order differences: If k = 0, then the zeroth order differences are defined to be the entries of π itself.We assemble all these differences in a triangle Θ π that we call the difference triangle of π.To illustrate, if n = 6 and π = (3, 5, 1, 6, 2, 4), then We label the rows of the difference triangle of a permutation of order n as 0, 1, 2, . . ., n − 1 so that they correspond to the order of the differences in the rows.
The notion of the derivative of a permutation captures the changes in consecutive entries of a permutation π, and therefore contains information about e.g. the descents of a permutation.We refer to the book [1] on permutations and their descents.Permutation matrices and more general classes of (0, 1)-matrices are treated in [2].
A Costas permutation (or Costas array or Costas permutation matrix) ( [5]) is a permutation π of order n such that for each k = 0, 1, 2, . . ., n − 1, its kth order differences in row k of its difference triangle are distinct.Since π is a permutation, its zeroth order differences are distinct; since π has only one (n − 1)st difference, no restriction is placed on (n − 1)st order differences.If we think of a permutation matrix as a configuration of points in the Euclidean plane at the integral positions (i, π i ) for i = 1, . . ., n, then for a Costas permutation, no two of the line segments determined by these points have both the same length and the same slope, and thus all the line segments they determine are distinct.In terms of its difference triangle, the integers in each row are distinct.We remark that a Golomb ruler of order n is defined to be a sequence of n distinct positive integers such that all of the entries in its difference triangle are distinct.Since we confine our attention to permutations of {1, 2, . . ., n} a Golumb ruler is possible only in the trivial cases of n = 1 or 2.An example of a Costas permutation of order 4 is π = (4, 3, 1, 2) with difference triangle If a symmetry of the dihedral group D 4 is applied to a Costas permutation, the result is also a Costas permutation.Other structural properties of Costas permutations are given in [6].In particular, the following holds: Costas arrays are difficult to construct and are conjectured to exist for all n; one may consult [3] for up-to-date information on their existence.The smallest n for which the existence of a Costas array is not known is n = 32.It thus seems natural to investigate permutations under less restrictive conditions.Accordingly, we define a permutation to be a k-Costas permutation provided that for each i = 0, 1, . . ., k, its ith order differences are distinct.Thus an (n−1)-Costas permutation is a Costas permutation.A 1-Costas permutation is a permutation whose discrete derivative consists of distinct integers.For more on Costas arrays, see [6,7,8,9].
In this paper we investigate various properties of the discrete derivative of a permutation, some of which are motivated by the classical derivative of a function.We now summarize the contents of this paper.In Section 2, we develop some basic properties of the discrete derivative of a permutation.In Section 3 we define the local and global variations of a permutation and determine their extreme values with characterizations of equality.Some other extremal questions, and the notion of convexity, are treated in Section 4. Finally, in Section 5 we discuss some possible generalizations of the content of this paper.

The discrete derivative
The following observation is the analogue of the fact that a function is determined up to a constant by its derivative.Here, since we are dealing with permutations in S n , no constant is involved.
Proof.First, it is clear that π is uniquely determined by the extension (π 1 , π 2 − π 1 , . . ., π n − π n−1 ) of the discrete derivative, due to the expression Next, when π ∈ S n is given, then any other π ′ ∈ S n with D(π) = D(π ′ ), must be obtained by a shifting of π in the sense that π ′ i = a + π i (i ≤ n) for some integer a.But this implies that a = 0; otherwise some π ′ i would not lie in the set {1, 2, . . ., n}.Thus π ′ = π.
By Proposition 2.1 a permutation π = (π 1 , π 2 , . . ., π n ) ∈ S n is determined by the (n − 1) entries in row 1 of its difference triangle Θ π .The permutation π is, of course, also determined by any (n − 1) of the entries of π itself.There are other sets of (n − 1) entries of the difference triangle which determine its corresponding permutation.Consider the complete graph K n with vertices labeled 1, 2, . . ., n.To each edge {i, j} of K n with i < j we give the weight (π j − π i ), thereby obtaining a weighted complete graph K π n .
Proof.The weighted spanning tree T π has (n − 1) edges.Let p, q, r be distinct vertices of T π with edges {p, q} and {q, r} where p < q and q < r.Then the weight of {p, q} is π q −π p and the weight of {q, r} is π r −π q .Since (π r −π q )+(π q −π p ) = π r −π p , the weight of the edge {p, r} is also determined.Proceeding inductively like this, we see that the weights of all the edges of K π n are determined, in particular the weights of the edges {1, 2}, {2, 3}, . . ., {n − 1, n}; thus the first-order differences of π, and thus π itself (see Proposition 2.1), are determined.
It is natural to ask which vectors in Z n are discrete derivatives of permutations in S n .
Define, for an integral vector z = (z 1 , z 2 , . . ., z n−1 ), the set Proposition 2. 5. Let z = (z 1 , z 2 , . . ., z n−1 ) be an integral vector.Then z is the discrete derivative of some permutation in S n if and only if S z is a set of n consecutive integers containing 0.
Proof.Assume z = D(π) for some π ∈ S n .Then, by (3), Therefore S z consists of the numbers π 1 , π 2 , . . ., π n with π 1 subtracted from each, and this is a set of n consecutive integers containing 0.
Conversely, let S be a set of n consecutive integers containing 0, so and by Proposition 2.5 each of the sets in ( 5) is the sum-characteristic of a permutation in S n .The sum-characteristic of a permutation π = (π 1 , π 2 , . . ., π n ) is uniquely determined by π 1 and thus is the sum-characteristic of (n − 1)! permutations in S n .
Let π ∈ S n with discrete derivative D(π) = (a 1 , a 2 , . . ., a n−1 ).It follows from (1) that π is a Costas permutation if and only if the integers in each of the sequences are distinct.Thus the existence of Costas permutations can be regarded as a problem within additive number theory.
Example 2. 6.Consider the permutation in Example 2.2, so π = (5, 2, 7, 4, 1, 6, 3) ∈ S 7 and D(π) = (−3, 5, −3, −3, 5, −3).Then, if z = D(π), we get We now construct another permutation π ′ such that S z ′ = S z where z We now consider some questions related to the signs and values of the discrete derivative of a permutation.It is easy to see that there is only one permutation π ∈ S n having only positive discrete derivatives, namely the identity permutation π = ι n corresponding to the n×n identity matrix I n .Similarly, the anti-identity permutation ζ n = (n, . . ., 2, 1) corresponding to the backward identity matrix where l ij = 1 when j = n − i + 1 and 0 otherwise (i ≤ n), is the only permutation with only negative derivatives.A permutation in S n is a Grassmannian permutation provided it has only one descent.Grassmannian permutations are the only permutations π with only one negative entry in their discrete derivative.Henceforth we generally refer to a discrete derivative simply as a derivative.
Let p and q be distinct integers.If for some n ≥ 1 there exists a permutation π ∈ S n , such that {D(π) i : i ≤ n − 1} = {p, q}, then we say that (p, q) is a Dpair.Let (p, q) be a D-pair.Then (q, p) is also a D-pair, and therefore we assume hereafter than |p| ≥ |q|.In fact, we may also assume p > 0 because, the reverse of a permutation has the same derivative values as the original but with opposite signs.
Lemma 2. 7. Assume that n ≥ 3 and that (p, q) is a D-pair.Then p and q have opposite signs, and p and q are relatively prime.
Proof.The only permutation with all derivatives positive (and thus all equal to 1), is the identity permutation, and the only permutation with all derivatives negative (and thus all equal to −1), is the anti-identity permutation.So p and q have opposite signs.If gcd(p, q) := d ≥ 2, then each of π 2 , π 3 , . . ., π n differ from π 1 by a multiple of d, an impossibility as π is a permutation.
We next show that the conditions on p and q discussed above provide a characterization of D-pairs.
Assume that π i = π j for some i, j with 1 ≤ i < j ≤ n.This implies that and therefore ia ≡ ja mod (a + b).
Since gcd(a, a + b) = gcd(a, b) = 1, we see that i ≡ j mod (a + b) and hence i = j.This proves that π is a permutation.
Next we consider the derivatives of π.For each i we consider two possibilities: Case 1: (s−1)(a+b) < p i < p i+1 ≤ s(a+b) for some s.
Case 2: p i ≤ s(a + b) and p i+1 > s(a + b) for some s.The facts that p i+1 = p i + a and π is obtained by reducing the p i 's modulo a + b implies that Note that Case 2 will occur for some i as p n > n.In fact, This shows that {D(π) i : i ≤ n − 1} = {a, −b}, and we conclude that (a, −b) is a D-pair and π is a realization of (a, −b).
In terms of permutation matrices, the proof just given constructs an n × n permutation matrix P with n = a+b that realizes a D-pair (a, −b).The construction is easy to describe: for a ≥ 2 put a 1 in position (1, 1) and, row by row, move a columns to the right computing column indices modulo (a + b), that is, move cyclically from row to row.For a = 1 we do the same, but start in position (1, 2).
The following example illustrates this construction.
Our construction is a simple generalization of the standard full-cycle permutation matrix (a equals 1) on which the definition of a circulant matrix rests.
The inverse of π is given by Thus π −1 realizes the D-pair (11, −7).Since the permutation matrix corresponding to π −1 is the transpose of the permutation matrix ( 7), these differences result by cyclically considering the columns of (7).

Local and global variation of a permutation
In this section we define the local and global variation of permutations and investigate some of their properties.
(b) The global variation of π is given by the ℓ 1 -norm of the discrete derivative.
Theorem 3.2.Let n ≥ 2 be a positive integer.Then there exists a 1-Costas permutation π * ∈ S n with δ(π * ) = ⌈ n 2 ⌉, the smallest possible value.Such a minimizing permutation π * depends on the parity of n and is given by: (i) n is even, say n = 2k: π * corresponds to the permutation matrix (ii) n is odd, and n = 2k + 1 with k even: π * corresponds to the permutation matrix (iii) n is odd, and n = 2k + 1 with k odd: π * corresponds to the permutation matrix Moreover, in each case, π * attains the minimum value of ∆(π) for 1-Costas permutations, and this minimum value is n 2 4 when n is even, and (n−1) 2
We now give three examples illustrating the three cases in Theorem 3.2.
We now determine the extreme values of the global variation for general permutations.Clearly, min π∈Sn ∆(π) = n − 1 and this minimum is attained only for the identity and the anti-identity permutations.The problem of maximizing ∆(π) is more complex.Define ∆ * n = max{∆(π) : π ∈ S n }.It is convenient to treat the even and odd cases separately.
Let n be even, say n = 2k, and let π = (π 1 , π 2 , . . ., π n ) be a permutation.We say that π is mid-alternating if for all i < n the consecutive entries of π satisfy either (i) Example 3. 6.Let n = 8, so k = 4.The permutation π = (4, 6, 2, 7, 3, 8, 1, 5) is mid-alternating, and the corresponding permutation matrix is Of two 1's in consecutive rows, one is to the left of the double-vertical line and one is to the right.
The permutation π in Example 3.6 satisfies the conditions of Theorem 3.7, so ∆(π) = ∆ * 8 = 31.We turn to the case when n is odd, say n = 2k + 1, and let π = (π 1 , π 2 , . . ., π n ) be a permutation.We say that π is mid-alternating if for all i < n the consecutive entries of π satisfy either (i) The following result may be shown using the same type of arguments as in the proof of Theorem 3.7, so we therefore omit the proof.

Other properties of the discrete derivative
We observe that min π∈Sn max i |D(π) i | = 1, and this minimum is attained for the identity and anti-identity permutations.Now we determine max π∈Sn min i |D(π) i |.
Let π ∈ S n , and define k = ⌊n/2⌋.Assume min i |D(π) i | ≥ k + 1.Let P be the permutation matrix corresponding to π.Let i be the row of the unique 1 in column k + 1.Then i has at least one adjacent row, say it is row i − 1 (the argument is similar if it is row i + 1, or both).Row i − 1 has a unique 1, say in column p.But then |D(π It remains to construct a permutation π ∈ S n with min i |D(π If n is even, say n = 2k, let If n is odd, say n = 2k + 1, let Let P (n) be the permutation matrix corresponding to the extreme permutation π (n) constructed in the proof of Theorem 4.1.Note that when n is even Example 4.2.The extreme permutation matrices P (6) and P (7) are given by Here D(6) = D(7) = 3.The permutation in Example 2.2 also attains D(7) .
Next we discuss an analogue of convexity for the discrete derivative.We say that a permutation π = (π 1 , π 2 , . . ., π n ) ∈ S n and its corresponding permutation matrix P = P (π) are convex provided its derivatives are increasing, i.e., This is equivalent to For instance, both the identity matrix and the backward identity matrix are convex.A class of convex permutation matrices are obtained by a modification of the matrix Π k defined before Proposition 3.2.Let Π * k be obtained from Π k by a plane rotation of the matrix by a counter-clockwise rotation of 90 degrees.For example, which corresponds to the permutation (6, 4, 2, 1, 3, 5) with derivative (−2, −2, −1, 2, 2).Then we see that Π * k is a convex permutation matrix for every k.Let P = [p ij ] be a n×n subpermutation matrix, i.e., a (0, 1)-matrix with at most one 1 in every row and column.If P contains a total of k 1's, then P corresponds to a subsequence (i 1 , i 2 , . . ., i k ) of a permutation of {1, 2, . . ., n}.Define I k (P ) = {i : p ij = 1 for some j ≤ k}, the set of rows containing a 1 in the first k columns.An interval in a set {1, 2, . . ., n} is a set of consecutive integers I = {k, k + 1, . . ., l} for some 1 ≤ k ≤ l ≤ n, and its length is |I| = l − k + 1.
Lemma 4. 3.If P is a convex permutation matrix of order n, then I k (P ) is an interval of length k for each k ≤ n.
Proof.Let π be the permutation corresponding to P .For k = 1 the statement is clearly true.So, assume k ≥ 2 and that I k (P ) is not an interval.Then there are i 1 , i 2 , i 3 ∈ I k (P ) with i 1 < i 2 < i 3 and the submatrix P 1 consisting of the first k columns of P has a 1 in rows i 1 and i 3 , but not in row i 2 .This clearly implies that there must exist an s such π s+1 − π s > 0 > π s+2 − π s+1 .So, the derivative is not increasing, and P is not convex, a contradiction.Therefore, I k (P ) is an interval.
Note that the converse of the implication in Lemma 4.3 is not true; for instance, consider the permutation matrix Then I k (P ) is an interval of length k for each k ≤ n, but P is not convex.
Let P be an n×n subpermutation matrix.Let k ≤ n.We say that P = [p ij ] is kconvex if (i) each of the first k columns contains exactly one 1, (ii) I k (P ) is an interval, say equal to {r, r + 1, . . ., s}, and (iii) π i+1 −π i ≤ π i+2 −π i+1 for i = r, r + 1, . . ., s −2 where π i is the unique column in P containing a 1 in row i.Now, let P be such a subpermutation matrix which is k-convex and where columns k + 1, . . ., n are all zero.Define the following (possibly empty) set I * k (P ) of cardinality at most 2: (i) Let r − 1 ∈ I * k (P ) if r > 1, and the matrix obtained from P by putting a 1 in position (r − 1, k + 1) is (k + 1)-convex (this means that the derivative in row r − 1 is less that the derivative in row r); (ii) Let s + 1 ∈ I * k (P ) if s < n, and the matrix obtained from P by putting a It follows from Lemma 4.3 that if P is a convex permutation matrix, then P is also k-convex for each k ≤ n.We use this property to construct convex permutation matrices of order n by the following algorithm.Proof.We may assume n ≥ 2. Consider Algorithm 1, and let p i1 = 1.For k = 1, we get Thus, after the step for k = 1, the resulting matrix P is 2-convex.It is not hard to see that the conditions on the set I * k (P ) assure that, when this set is nonempty for each k, the final matrix P constructed will be a permutation matrix with increasing derivatives and therefore it is convex.
Next, let Q = [q ij ] be a convex permutation matrix.We need to show that Q may be constructed by Algorithm 1 by suitable choice of the element in Step 3b in each iteration.Assume that Algorithm 1, after k iterations, has constructed a matrix P whose first k columns coincide with those of Q (for k = 1 this is clear).Thus, I k (P ) and I k (Q) are equal, say equal to {r, r + 1, r + k − 1}.Moreover, as , and therefore, in Algorithm 1, we can let column k + 1 of P have its 1 in row r − 1.A similar construction works when the 1 in column k + 1 of Q is in row r + k.Thus, in any case, the k + 1 first columns of P equal the corresponding columns of Q.So, by induction, we may obtain P = Q by suitable such choices in Algorithm 1.
Theorem 4. 5.The set of convex permutations of order n consists of n , and the permutations obtained by reversing the order in each of these permutations.
Proof.We consider Algorithm 1, and construct a convex matrix P = [p ij ] and corresponding permutation π = π(P ).By symmetry, we may assume for some i, and with k ≥ 2 maximal with this property.We discuss different cases.
Case 1: k = n.Then i = 1 and P = I n .
Then it is easy to see that, by convexity, that the only possibility is i = 2.This gives the permutation (n − 1, 1, 2, . . ., n − 2, n).This, however, by checking the derivatives (at the boundary of the interval), that I * k+2 = ∅ as 3 ≤ k ≤ n − 3. Thus, there is no convex permutation matrix in this case.
Case 5: k = 2. Then by checking the possible derivatives at the boundary of the interval I s (P ) for each s, one derives that p i1 = p i+1,2 = p i−1,3 = 1 and then p i+1,4 = 1, p i−2,5 = 1 etc.The only possibility is then that i = ⌊n/2⌋ and we obtain the matrix Π * n .
Example 4. 6.The convex permutation matrices of order n = 6 are the following 4 matrices .
and those additional 4 obtained by reordering rows in the opposite order.

Coda
In this concluding section, we discuss 1-Costas permutations and some additional properties of permutations involving their derivatives.
For permutations one may consider properties similar to Lipschitz properties of functions defined on the real line.We say that a permutation π, and the corresponding permutation matrix P π , is L-Lipschitz if Since we only consider permutations, the only values of interest here are L = 1, 2, . . ., n − 1.It is easy to verify that (18) is equivalent to to the simplified condition that |π i+1 − π i | ≤ L (i < n), or, equivalently, max i |D(π) i | ≤ L. The only permutations that are 1-Lipschitz are the identity and the anti-identity permutations.An interesting question is to characterize permutations that are L-Lipschitz, for a given L. We believe this can at least be done for L = 2.
Checking if a given permutation of order n has the 1-Costas property is easily done: compute all the (n − 1) derivatives, requiring (n − 1) arithmetic operations, and then sort these number (O(n log n) operations suffice).
Every n × n permutation matrix P with the 1-Costas property may be constructed, starting with the zero matrix, by a simple algorithm which, however, may result in failure: 1. Place a 1 in some position in the first row. .
Then π and P π are centrosymmetric.The difference triangle is Thus except for those repeats (highlighted) which follow from the centrosymmetric property, the difference triangle has no other repeats in its rows.Denoting π as (i 1 , i 2 , i 3 , i 4 , i 5 , i 6 , i 7 , i 8 ), the entries in the center of the difference triangle are 9 − 2i 4 , 9 − 2i 3 , 9 − 2i 2 , 9 − 2i 1 .
We define a Costas-centrosymmetric permutation to be a centrosymmetric permutation (i 1 , i 2 , . . ., i n ) whose difference table has no repeats other than those required by the centrosymmetric property.Note that the required repeats are of the form a − b = (n + 1 − b) − (n + 1 − a).Equivalently, we consider only the differences π j − π i where 1 ≤ i < j ≤ n + 1 − i. Example 5.2 is a Costas-centrosymmetric permutation.

Proposition 1 . 1 .
(Proposition 4.2 in [6]).If n ≥ 4, then in a Costas permutation matrix P = [p ij ] of order n, there exists p rs = 1 and p uv = 1 ((r, s) = (u, v)) such that also p ab = 1 and p cd = 1 where b − d = s − v and a − c = −(r − u), that is the line segment joining the points (a, b) and (c, d) has the same vertical displacement and opposite horizontal displacement as the line segment joining the points (r, s) and (u, v).

Proposition 3 . 1 .
For a permutation π ∈ S n , 1 ≤ δ(π) ≤ n − 1 with equality on the lower end if and only if π = ι n or ζ n and equality on the upper end if and only if 1 and n are adjacent in π.

Theorem 3 . 8 .
Let n be odd, and let π