Near MDS poset codes and distributions
aa r X i v : . [ c s . I T ] A p r NEAR MDS POSET CODES AND DISTRIBUTIONS
ALEXANDER BARG AND PUNARBASU PURKAYASTHA
Abstract.
We study q -ary codes with distance defined by a partial orderof the coordinates of the codewords. Maximum Distance Separable (MDS)codes in the poset metric have been studied in a number of earlier works. Weconsider codes that are close to MDS codes by the value of their minimumdistance. For such codes, we determine their weight distribution, and in theparticular case of the “ordered metric” characterize distributions of points inthe unit cube defined by the codes. We also give some constructions of codesin the ordered Hamming space. Introduction
A set of points C = { c , . . . , c M } in the q -ary n -dimensional Hamming space F nq is called a Maximum Distance Separable (MDS) code if the Hamming distancebetween any two distinct points of C satisfies d ( c i , c j ) ≥ d and the number of pointsis M = q n − d +1 . By the well-known Singleton bound of coding theory, this is themaximum possible number of points with the given separation. If C is an MDScode that forms an F q -linear space, then its dimension k , distance d and length n satisfy the relation d = n − k + 1 . MDS codes are known to be linked to classicalold problems in finite geometry and to a number of other combinatorial questionsrelated to the Hamming space [19, 1]. At the same time, the length of MDS codescannot be very large; in particular, in all the known cases, n ≤ q +2 . This restrictionhas led to the study of classes of codes with distance properties close to MDS codes,such as t -th rank MDS codes [22], near MDS codes [6] and almost MDS codes [5].The distance of these codes is only slightly less than n − k + 1, and at the sametime they still have many of the structural properties associated with MDS codes.In this paper we extend the study of linear near MDS (NMDS) codes to the caseof the ordered Hamming space and more generally, to poset metrics. The orderedHamming weight was introduced by Niederreiter [16] for the purpose of studyinguniform distributions of points in the unit cube. The ordered Hamming space in thecontext of coding theory was first considered by Rosenbloom and Tsfasman [18] for astudy of one generalization of Reed-Solomon codes (the ordered distance is thereforesometimes called the NRT distance). The ordered Hamming space and the NRTmetric have multiple applications in coding theory including a generalization of theFourier transform over finite fields [10, 14], list decoding of algebraic codes [17], andcoding for a fading channel of special structure [18, 9]. This space also gives riseto a range of combinatorial problems. In the context of algebraic combinatorics, it Mathematics Subject Classification.
Primary 94B25.
Key words and phrases.
Poset metrics, ordered Hamming space, MDS codes.This research supported in part by NSF grants DMS0807411, CCF0916919, CCF0830699, andCCF0635271. supports a formally self-dual association scheme whose eigenvalues form a familyof multivariate discrete orthogonal polynomials [13, 3, 2].A particular class of distributions in the unit cube U n = [0 , n , called ( t, m, n )-nets, defined by Niederreiter in the course of his studies, presently forms the subjectof a large body of literature. MDS codes in the ordered Hamming space and theirrelations to distributions and ( t, m, n )-nets have been extensively studied [18, 20,7, 11]. The ordered Hamming space was further generalized by Brualdi et al. in[4] which introduced metrics on strings defined by arbitrary partially ordered sets,calling them poset metrics.The relation between MDS and NMDS codes in the ordered metric and distri-butions is the main motivation of the present study. As was observed by Skriganov[20], MDS codes correspond to optimal uniform distributions of points in the unitcube. The notion of uniformity is rather intuitive: an allocation of M points formsa uniform distribution if every measurable subset A ⊂ U n contains a vol( A ) pro-portion of the M points (in distributions that arise from codes, this property isapproximated by requiring that it hold only for some fixed collection of subsets).Skriganov [20] observes that distributions that arise from MDS codes are optimal insome well-defined sense. In the same way, NMDS codes correspond to distributionsthat are not far from optimal (they are characterized exactly below). Although theprimary motivation is to study NMDS codes in the ordered metric, the calculationsare easily generalized to the poset metric. We will hence derive the results in thegeneral case of the poset metric, and mention the results in the ordered metric asspecific cases.The rest of the article is organized as follows. In the next section we providebasic definitions and some properties of near-MDS codes. We will also have a chanceto discuss generalized Hamming weights of Wei [22] in the poset metric case. InSection 3 we show a relationship between distribution of points in the unit cubeand NMDS codes. In Section 4 we determine the weight distribution of NMDScodes, and finally in Section 5, we provide some constructions of NMDS codes inthe ordered Hamming space.2. Definitions and basic properties
Poset metrics.
We begin with defining poset metrics on q -ary strings of afixed length and introduce the ordered Hamming metric as a special case of thegeneral definition. Entries of a string x = ( x , x , . . . ) are indexed by a finite set N which we call the set of coordinates. Let −→ P be an arbitrary partial order ( ≤ )on N. Together N and −→ P form a poset . An ideal of the poset is a subset I ⊂ N that is “downward closed” under the ≤ relation, which means that the conditions i, j ∈ N , j ∈ I and i ≤ j imply that i ∈ I . For the reasons that will become clearbelow, such ideals will be called left-adjusted (l.a.).A chain is a linearly ordered subset of the poset. The dual poset ←− P is the set N with the same set of chains as −→ P , but the order within each of them reversed.In other words j ≤ i in ←− P if and only if i ≤ j in −→ P . An ideal in the dual posetwill be termed right-adjusted (r.a.). For a subset S ⊆ −→ P we denote by h S i = h S i −→ P the smallest −→ P -ideal containing the set S (we write S ⊆ −→ P to refer to a subset S ⊆ N whose elements are ordered according to −→ P ). The support of a sequence x is the subset supp x ⊆ N formed by the indices of all the nonzero entries of x. The
EAR MDS POSET CODES AND DISTRIBUTIONS 3 set h supp x i ⊆ −→ P will be called the l.a. support of x. The r.a. support is definedanalogously.
Definition 2.1. (Brualdi et al. [4]) Let −→ P be a poset defined on N and let x, y ∈ F | N | q be two strings. Define the weight of x with respect to −→ P as w( x ) = |h supp x i| , i.e., the size of the smallest −→ P -ideal that contains the support of x. The distancebetween x and y is defined as d −→ P ( x, y ) = w( x − y ) = |h supp( x − y ) i| .A code C of minimum distance d is a subset of F | N | q such that any two distinctvectors x and y of C satisfy d −→ P ( x, y ) ≥ d. It is similarly possible to consider codeswhose distance is measured relative to ←− P . In this paper we will be concerned with linear codes over a finite field by which we mean linear subspaces of F | N | q . Given alinear code C ⊂ F | N | q its dual code C ⊥ is the set of vectors { y ∈ F | N | q : ∀ x ∈ C P i x i y i =0 } . The weights in the dual code C ⊥ are considered with respect to the dual poset ←− P . A subset of F | N | q is called an orthogonal array of strength t and index θ withrespect to −→ P if any t l.a. columns contain any vector z ∈ F tq exactly θ times. Inparticular, the dual of a linear poset code is also a linear orthogonal array.For instance, the Hamming metric is defined by the partial order −→ P which is asingle antichain of length n = | N | (no two elements are comparable). Accordingly,the distance between two sequences is given by the number of coordinates in whichthey differ. In this case, −→ P = ←− P . Ordered Hamming metric.
The ordered Hamming metric is defined by aposet −→ P which is a disjoint union of n chains of equal length r. Since we work withthis metric in later sections of the paper, let us discuss it in more detail. In thiscase N is a union of n blocks of length r , and it is convenient to write a vector(sequence) as x = ( x , . . . , x r , . . . , x n , . . . , x nr ) ∈ F r,nq . According to Definition2.1, the weight of x is given byw( x ) = n X i =1 max( j : x ij = 0) . For a given vector x let e i , i = 1 , . . . , r be the number of r -blocks of x whoserightmost nonzero entry is in the i th position counting from the beginning of theblock. The r -vector e = ( e , . . . , e r ) will be called the shape of x . For brevity wewill write | e | = X i e i , | e | ′ = X i ie i , e = n − | e | . For I = h supp x i we will denote the shape of the ideal I as shape( I )= e . By analogywith the properties of ideals in the ordered Hamming space, we use the term “leftadjusted” for ideals in general posets −→ P . An ( nr, M, d ) ordered code C ⊂ F r,nq is an arbitrary subset of M vectors in F r,nq such that the ordered distance between any two distinct vectors in C is at least d . If C is a linear code of dimension k over F q and minimum ordered distance d ,we will denote it as an [ nr, k, d ] code. The dual of C , denoted as C ⊥ , is defined as C ⊥ = { x ∈ F r,nq : ∀ c ∈ C P i,j x ij c ij = 0 } . The distance in C ⊥ is derived from thedual order ←− P , i.e., from the r.a. ideals. ALEXANDER BARG AND PUNARBASU PURKAYASTHA
The notion of orthogonal arrays in the ordered Hamming space is derived fromthe general definition. They will be called ordered orthogonal arrays (OOAs) below.We write ( t, n, r, q ) OOA for an orthogonal array of strength t in F r,nq . Combinatoricsof the ordered Hamming space and the duality between codes and OOAs was studiedin detail by Martin and Stinson [13], Skriganov [20], and the present authors [2].2-C.
NMDS poset codes.
We begin our study of NMDS codes in the posetspace with several definitions that are generalized directly from the correspondingdefinitions in the Hamming space [22, 6]. The t -th generalized poset weight of alinear [ n, k ] code C is defined as d t ( C ) , min {|h supp D i| : D is an [ n, t ] subcode of C } , where supp D is the union of the supports of all the vectors in D . Note that d ( C ) = d, the minimum distance of the code C . Generalized poset weights haveproperties analogous to the well-known set of properties of generalized Hammingweights.
Lemma 2.2.
Let C be a linear [ n, k ] poset code in F nq . Then (1) 0 < d ( C ) < d ( C ) < · · · < d k ( C ) ≤ n . (2) Generalized Singleton bound: d t ( C ) ≤ n − dim( C ) + t, ∀ t ≥ . (3) If C ⊥ is the dual code of C then { d ( C ) , d ( C ) , . . . , d k ( C ) } ∪ ( n + 1 − { d ( C ⊥ ) , d ( C ⊥ ) , . . . , d n − k ( C ⊥ ) } ) = { , . . . , n } . (4) Let H be the parity check matrix of C . Then d t ( C ) = δ if and only if (a) Every δ − l.a. columns of H have rank at least δ − t . (b) There exist δ l.a. columns of H with rank exactly δ − t .Proof. (1) Let D t ⊆ C be a linear subspace such that |h supp D t i| = d t ( C ) andrank( D t ) = t, t ≥
1. Let Ω( D t ) denote the maximal elements of the ideal h supp D t i .For each coordinate in Ω( D t ), D t has at least one vector with a nonzero componentin that coordinate. We pick i ∈ Ω( D t ) and let D it be obtained by retaining onlythose vectors v in D t which have v i = 0 . Then d t − ( C ) ≤ |h supp D it i| ≤ d t ( C ) − . (2) This is a consequence of the fact that d t +1 ≥ d t + 1 and d k ≤ n. (3) This proof is analogous to [22]. The reason for giving it here is to assureoneself that no complications arise from the fact that the weights in C ⊥ are measuredwith respect to the dual poset.We show that for any 1 ≤ s ≤ n − k − n + 1 − d s ( C ⊥ ) / ∈ { d r ( C ) : 1 ≤ r ≤ k } . Let t = k + s − d s ( C ⊥ ) . We consider two cases (one of which can be void), namely, r ≤ t and r ≥ t + 1 and show that for each of them, n + 1 − d s ( C ⊥ ) = d r ( C ) . Take an s -dimensional subcode D s ⊆ C ⊥ such that |h supp D s i ←− P | = d s ( C ⊥ ) . Forma parity-check matrix of the code C whose first rows are some s linearly independentvectors from D s . Let D be the complement of h supp D s i in the set of coordinates.Let the submatrix of H formed of all the columns in D be denoted by H [ D ]. Therank of H [ D ] is at most n − k − s and its corank (dimension of the null space) isat least | D | − ( n − k − s ) = n − d s ( C ⊥ ) − n + k + s = k + s − d s ( C ⊥ ) . EAR MDS POSET CODES AND DISTRIBUTIONS 5
Then d t ( C ) ≤ | D | = n − d s ( C ⊥ ) and so d r ( C ) ≤ n − d s ( C ⊥ ) , ≤ r ≤ t .Now let us show that d t + i ( C ) = n + 1 − d s ( C ⊥ ) for all 1 ≤ i ≤ k − t. Assumethe contrary and consider a generator matrix G of C with the first t + i rowscorresponding to the subcode D t + i ⊆ C with |h supp D t + i i −→ P | = d t + i ( C ). Let D bethe complement of h supp D t + i i in the set of coordinates. Then G [ D ] is a k × ( n − d t + i ( C )) matrix of rank k − t − i. By part (2) of the lemma, n − d t + i ( C ) ≥ k − t − i, so dim ker( G [ D ]) ≥ n − d t + i ( C ) − k + t + i = s + i − ( d s ( C ⊥ ) + n − d t + i ( C ))= s + i − , where the first equality follows on substituting the value of k and the second oneby using the assumption. Hence d s + i − ( C ⊥ ) ≤ | D | = d s ( C ⊥ ) − , which contradictspart (1) of the lemma.(4) Follows by standard linear-algebraic arguments. Definition 2.3.
A linear code C [ n, k, d ] is called NMDS if d ( C ) = n − k and d ( C ) = n − k + 2 . Closely related is the notion of almost-MDS code where we have only the con-straint that d ( C ) = n − k and there is no constraint on d ( C ). In this work, we focusonly on NMDS codes. The next set of properties of NMDS codes can be readilyobtained as generalizations of the corresponding properties of NMDS codes in theHamming space [6]. Lemma 2.4.
Let C ⊆ F nq be a linear [ n, k, d ] code in the poset −→ P . (1) C is NMDS if and only if (a) Any n − k − l.a. columns of the parity check matrix H are linearlyindependent. (b) There exist n − k l.a. linearly dependent columns of H . (c) Any l.a. n − k + 1 columns of H are full ranked. (2) If C is NMDS, so is its dual C ⊥ . (3) C is NMDS if and only if d ( C ) + d ( C ⊥ ) = n . (4) If C is NMDS then there exists an NMDS code with parameters [ n − , k − , d ] and an NMDS code with parameters [ n − , k, d ] .Proof. (1) Parts (a) and (b) are immediate. Part (c) is obtained from Lemma 2.2.(2) From Lemma 2.2 we obtain { n + 1 − d t ( C ⊥ ) , ≤ t ≤ n − k } = { , . . . , n − k − , n − k + 1 } . Hence d ( C ⊥ ) = k and d ( C ⊥ ) = k + 2.(3) Let d ( C ) + d ( C ⊥ ) = n . Then d ( C ⊥ ) ≥ d ( C ⊥ ) + 1 = n − d ( C ) + 1 , but then by Lemma 2.2(3), d ( C ⊥ ) ≥ n − d ( C ) + 2 . Next, n ≥ d n − k ( C ⊥ ) ≥ d ( C ⊥ ) + n − k − ≥ n − k − d, which implies that d ≥ n − k. This leaves us with the possibilities of d = n − k or n − k + 1 , but the latter would imply that d ( C ) + d ( C ⊥ ) = n + 2 , so d = n − k. Further, d ( C ) ≥ n − d ( C ⊥ ) + 2 = n − k + 2 , as required. The converse is immediate. ALEXANDER BARG AND PUNARBASU PURKAYASTHA (4) To get a [ n − , k − , d ] NMDS code, delete a column of the parity checkmatrix H of C preserving a set of n − k l.a. linearly dependent columns. To get a[ n − , k, d ] NMDS code, delete a column of the generator matrix G of C preservinga set of k + 1 r.a. columns which contains k r.a. linearly dependent columns. Lemma 2.5.
Let C be a linear poset code in −→ P with distance d and let C ⊥ beits dual code. Then the matrix M whose rows are the codewords of C ⊥ forms anorthogonal array of strength d − with respect to −→ P . Proof.
Follows because (1), C ⊥ is the linear span of the parity-check matrix H of C ; and (2), any d − H are linearly independent.3. NMDS codes and distributions
In this section we prove a characterization of NMDS poset codes and then usethis result to establish a relationship between NMDS codes in the ordered Hammingspace F r,nq and uniform distributions of points in the unit cube U n . In our studyof NMDS codes in the following sections, we analyze the properties of the codesimultaneously as a linear code and as a linear orthogonal array.Define the I -neighborhood of a poset code C with respect to an ideal I as B I ( C ) = [ c ∈ C B I ( c ) , where B I ( x ) = { v ∈ F nq : supp( v − x ) ⊆ I } . We will say that a linear k -dimensionalcode C forms an I - tiling if there exists a partition C = C ∪ · · · ∪ C q k − into equalparts such that the I -neighborhoods of its parts are disjoint. If in addition the I -neighborhoods form a partition of F nq , we say C forms a perfect I -tiling . Theorem 3.1.
Let C ⊆ F nq be an [ n, k, d ] linear code in the poset −→ P . C is NMDSif and only if (1) For any I ⊂ −→ P , | I | = n − k + 1 , the code C forms a perfect I -tiling. (2) There exists an ideal I ⊂ −→ P , | I | = n − k with respect to which C forms an I -tiling. No smaller-sized ideals with this property exist.Proof. Let C be NMDS and let I be an ideal of size n − k + 1. Let H [ I ] be thesubmatrix of the parity-check matrix H of C obtained from H by deleting all thecolumns not in I . Since rk( H [ I ]) = n − k, the space ker( H [ I ]) is one-dimensional.Let C = ker( H ( I )) and let C j be the j th coset of C in C , j = 2 , . . . , q k − . ByLemma 2.5 the code C forms an orthogonal array of strength k − q in ←− P . Therefore, every vector z ∈ F k − q appears exactly q times in the restrictions ofthe codevectors c ∈ C to the coordinates of J = I c . Thus, c ′ [ J ] = c ′′ [ J ] for anytwo vectors c ′ , c ′′ ∈ C i , i = 1 , . . . , q k − and c ′ [ J ] = c ′′ [ J ] c ′ ∈ C i , c ′′ ∈ C j , ≤ i EAR MDS POSET CODES AND DISTRIBUTIONS 7 d ( C ⊥ ) = k or k + 1 . If it is the latter, then C ⊥ is MDS with respect to ←− P and so is C with respect to −→ P , in violation of assumption 2. So d ( C ⊥ ) = k and d ( C ) ≤ n − k. If the inequality is strict, there exists an ideal I of size < n − k that supports a one-dimensional subcode of C . Then C forms an I -tiling which contradicts assumption2. It remains to prove that d ( C ) = n − k + 2. Assume the contrary, i.e., that thereexists a 2-dimensional subcode B ⊂ C whose l.a. support forms an ideal I ⊂ −→ P ofsize n − k + 1 . The q vectors of B all have zeros in I c which contradicts the factthat C forms an orthogonal array of index q .Next, we use this characterization to relate codes in the ordered Hamming space F r,nq to distributions. An idealized uniformly distributed point set C would satisfythe property that for any measurable subset A ⊂ U n ,1 | C | X x ∈ C x ∈ A ) = vol( A ) . Distributions that we consider, and in particular ( t, m, n )-nets, approximate thisproperty by restricting the subsets A to be boxes with sides parallel to the coordi-nate axes.Let E , ( E = n Y i =1 (cid:20) a i q d i , a i + 1 q d i (cid:19) : 0 ≤ a i < q d i , ≤ d i ≤ r, ≤ i ≤ n ) be a collection of elementary intervals in the unit cube U n = [0 , n . An arbitrarycollection of q k points in U n is called an [ nr, k ] distribution in the base q (withrespect to E ). A distribution is called optimal if every elementary interval of volume q − k contains exactly one point [20]. A related notion of ( t, m, n )-nets, introducedby Niederreiter [16], is obtained if we remove the upper bound on l i (i.e., allow that0 ≤ l i < ∞ ) and require that every elementary interval of volume q t − m containexactly q t points.An ordered code gives rise to a distribution of points in the unit cube via thefollowing procedure. A codevector ( c , . . . , c r , . . . , c n , . . . , c nr ) ∈ F r,nq is mappedto x = ( x , . . . , x n ) ∈ U n by letting(3.1) x i = r X j =1 c ij q j − r − , ≤ i ≤ n. In particular, an ( m − t, n, r, q ) OOA of index q t and size q m corresponds to adistribution in which every elementary interval of volume q t − m contains exactly q t points, and an ( m − t, n, m − t, q ) OOA of index q t and size q m gives rise to a( t, m, n )-net [12, 15]. Proposition 3.2. (Skriganov [20]) An [ nr, k, d ] MDS code in the ordered metricexists if and only if there exists an optimal [ nr, k ] distribution. Skriganov [21] also considers the concept of nearly-MDS codes whose distanceasymptotically tends to the distance of MDS codes, and shows how these codes cangive rise to distributions.The next theorem whose proof is immediate from Theorem 3.1 relates orderedNMDS codes and distributions. ALEXANDER BARG AND PUNARBASU PURKAYASTHA Theorem 3.3. Let C be a linear [ nr, k, d ] code in F r,nq and let P ( C ) be the corre-sponding set of points in U n . Then C is NMDS if and only if (1) Any elementary interval of volume q − ( k − has exactly q points of P ( C ) . (2) There exists an elementary interval Q ni =1 (cid:2) , q − l i (cid:1) of volume q − k containingexactly q points and no smaller elementary intervals of this form containingexactly q points exist. Corollary 3.4. An [ nr, k, d ] NMDS code C in the ordered Hamming space forms a ( k − , n, r, q ) OOA of index q . The corresponding distribution P ( C ) ⊂ U n forms a ( k − r, k, n ) -net for k − ≥ r .Remark . Distributions of points in the unit cube obtained from NMDS codeshave properties similar to those of distributions obtained from MDS codes. Inparticular, the points obtained from an [ nr, k, d ] MDS code in F r,nq satisfy part (1)of Theorem 3.3 and give rise to a ( k − r, k, n )-net for k ≥ r [20].4. Weight distribution of NMDS codes Let Ω( I ) be the set of maximal elements of an ideal I and let ˜ I , I \ Ω( I ).Let C be an NMDS [ n, k, d ] linear poset code. Let A I , { x ∈ C : h supp x i = I } be the number of codewords with l.a. support exactly I and let A s = P I : | I | = s A I . Theorem 4.1. The weight distribution of C has the following form: (4.1) A s = X I ∈ I s s − d − X l =0 ( − l (cid:18) | Ω( I ) | l (cid:19) ( q s − d − l − 1) + ( − s − d X I ∈ I s X J ∈ I d ( I ) ,J ⊇ ˜ I A J ,n ≥ s ≥ d, where I s , { I ⊆ −→ P : | I | = s } and I s ( I ) , { J : J ⊆ I, | J | = s } . Proof. The computation below is driven by the fact that ideals are fixed bythe sets of their maximal elements. Additionally, we use the fact that any k − C support an orthogonal array of strength k − . The number of codewords of weight s is given by A s = | ∪ I ∈ I s C ∩ S I | , where S I , { x ∈ F nq : h supp x i = I } is the sphere with l.a. support exactly I . The aboveexpression can be written as (cid:12)(cid:12)(cid:12) [ I ∈ I s C ∩ S I (cid:12)(cid:12)(cid:12) = X I ∈ I s (cid:16) | C ∩ B ∗ I | − (cid:12)(cid:12) [ J ∈ I s − ( I ) C ∩ B ∗ J (cid:12)(cid:12)(cid:17) , where B I , { x ∈ F nq : h supp x i −→ P ⊆ I } and B ∗ I , B I \ . We determine thecardinality of the last term using the inclusion-exclusion principle.(4.2) (cid:12)(cid:12)(cid:12) [ J ∈ I s − ( I ) C ∩ B ∗ J (cid:12)(cid:12)(cid:12) = X J ∈ I s − ( I ) | C ∩ B ∗ J | − X J = J ∈ I s − ( I ) | C ∩ B ∗ J ∩ B ∗ J | + · · · + ( − | Ω( I ) |− X J = ···6 = J | Ω( I ) | ∈ I s − ( I ) (cid:12)(cid:12)(cid:12)(cid:12) C ∩ (cid:16) \ i B ∗ J i (cid:17)(cid:12)(cid:12)(cid:12)(cid:12) . Since C ⊥ has minimum distance k , C forms an orthogonal array of strength k − ←− P . This provides us with an estimate for eachindividual term in (4.2) as described below. For distinct J , . . . , J l ∈ I s − ( I ), we EAR MDS POSET CODES AND DISTRIBUTIONS 9 let J , ∩ li =1 J i . Using the fact that J does not contain l maximal elements of I, weget (cid:12)(cid:12)(cid:12)n { J , . . . , J l } : J i distinct , J i ∈ I s − ( I ) , i = 1 , . . . , l o(cid:12)(cid:12)(cid:12) = (cid:18) | Ω( I ) | l (cid:19) . For any s ≥ d + 1 consider the complement I c of an ideal I ∈ I s . Since | I c | ≤ n − d − k − , the code C supports an orthogonal array of strength n − s andindex q s − d in the coordinates defined by I c . Since ∩ li =1 B ∗ J i = B ∗ J and since B ∗ J doesnot contain the vector, we obtain (cid:12)(cid:12)(cid:12) C ∩ (cid:0) l \ i =1 B ∗ J i (cid:1)(cid:12)(cid:12)(cid:12) = q s − d − l − , ≤ l ≤ s − d − . Finally, for l = s − d we obtain | C ∩ ( ∩ li =1 B ∗ J i ) | = A J , and (cid:12)(cid:12)(cid:12)(cid:12) [ J ∈ I s − ( I ) C ∩ B ∗ J (cid:12)(cid:12)(cid:12)(cid:12) = s − d − X l =1 ( − l − (cid:18) | Ω( I ) | l (cid:19) ( q s − d − l − 1) + X J ∈ I d ( I ) ,J ⊇ ˜ I ( − s − d − A J , which implies X I ∈ I s | C ∩ S I | = X I ∈ I s ( q s − d − − (cid:18) s − d − X l =1 ( − l − (cid:18) | Ω( I ) | l (cid:19) ( q s − d − l − X J ∈ I d ( I ) ,J ⊇ ˜ I ( − s − d − A J (cid:19)! . As a corollary of the above theorem, we obtain the weight distribution of NMDScodes in the ordered Hamming space F r,nq . By definition, the number of vectorsof ordered weight s in a code C ∈ F r,nq equals A s = P e : | e | ′ = s A e , where A e is thenumber of codevectors of shape e. Corollary 4.2. The weight distribution of an ordered NMDS code C ∈ F r,nq is givenby (4.3) A s = s − d − X l =0 ( − l X e : | e | ′ = s (cid:18) | e | l (cid:19)(cid:18) ne , . . . , e r (cid:19) ( q s − d − l − − s − d X e : | e | ′ = d N s ( e ) A e , s = d, d + 1 , . . . , n, where N s ( e ) , X f : | f | ′ = s (cid:18) e r − f r − e r (cid:19)(cid:18) e r − ( f r + f r − ) − ( e r + e r − ) (cid:19) · · · (cid:18) e | f | − | e | (cid:19) . Proof. Recall that the shape of an ideal I is shape( I ) = e = ( e , . . . , e r ) , where e j , j = 1 , . . . , r is the number of chains of length j contained in I . We obtain | Ω( I ) | = | e | and X I ∈ I s (cid:18) | Ω( I ) | l (cid:19) = X e : | e | ′ = s (cid:18) | e | l (cid:19)(cid:18) ne , . . . , e r (cid:19) . Figure 1. To the proof of Corollary 4.2To determine the last term in (4.1), we rewrite it as X I ∈ I s X J ∈ I d ( I ) ,J ⊇ ˜ I A J = X J ∈ I d |{ I ∈ I s : ˜ I ⊆ J ⊆ I }| A J = X e : | e | ′ = d N s ( e ) X J :shape( J )= e A J , where N s ( e ) = |{ I ∈ I s : ˜ I ⊆ J ⊆ I, J fixed, shape( J ) = e }| . Clearly, P J :shape( J )= e A J = A e , and so we only need to determine the quantity N s ( e ) in the above summation. Let J be an ideal as shown in Fig. 1. The ideals I which satisfy the constraints in the set defined by N s ( e ) have the form as shownin Fig. 1. Letting f = shape( I ), we note that the components of the shape f mustsatisfy f r ≥ e r ,f r + f r − ≥ e r + e r − ≥ f r ,...f + · · · + f r = | f | ≥ | e | = e + · · · + e r ≥ f + · · · + f s , and | f | ′ = s. It is now readily seen that the cardinality of the set { I ∈ I s : ˜ I ⊆ J ⊆ I, J fixed, shape( J ) = e } is given by the formula for N s ( e ) as described in (4.3). Remark: For r = 1 we obtain | e | = | e | ′ = e = d, | f | = f = s and N s ( e ) = (cid:0) n − ds − d (cid:1) . Thus we recover the expression for the weight distribution of an NMDS codein Hamming space [6]:(4.4) A s = s − d − X l =0 ( − l (cid:18) sl (cid:19)(cid:18) ns (cid:19) ( q s − d − l − 1) + ( − s − d (cid:18) n − ds − d (cid:19) A d . EAR MDS POSET CODES AND DISTRIBUTIONS 11 Unlike the case of poset MDS codes [11], the weight distribution of NMDS codesis not completely known until we know the number of codewords with l.a. support J for every ideal of weight J of size d. In particular, for NMDS codes in the orderedHamming space we need to know the number of codewords of every shape e with | e | ′ = d. This highlights the fact that the combinatorics of codes in the poset space(ordered space) is driven by ideals (shapes) and their support sizes, and that theweight distribution is a derivative invariant of those more fundamental quantities.As a final remark we observe that, given that d ( C ) = n − k , the assumption d ( C ⊥ ) = k (or the equivalent assumption d ( C ) = n − k + 2) ensures that the onlyunknown components of the weight distribution of C correspond to ideals of size d .If instead we consider a code of defect s, i.e., a code with d ( C ) = ( n − k +1) − s, s ≥ A J , d ≤| J | ≤ n − d ( C ⊥ ) (provided that we know d ( C ⊥ )). In the case of the Hamming metricthis was established in [8].5. Constructions of NMDS codes In this section we present some simple constructions of NMDS codes in theordered Hamming space for the cases n = 1 , , . We are not aware of any generalcode family of NMDS codes for larger n. n=1: For n = 1 the construction is quite immediate once we recognize thatan NMDS [ r, k, d ] code is also an OOA of r.a. strength k − q . Let I l denote the identity matrix of size l. Let x = ( x , . . . , x r ) be any vector of l.a. weight d = r − k , i.e. x d = 0 and x l = 0 , l = d + 1 , . . . , r . Then the following matrix ofsize k × r generates an NMDS code with the above parameters(5.1) (cid:20) x . . . x d M I k − (cid:21) , where the s are zero vectors (matrices) of appropriate dimensions and M ∈ F ( k − × dq is any arbitrary matrix. n=2: Let D l = (cid:20) ... ... ... ... ... (cid:21) be the l × l matrix with 1 along the inverse diagonaland 0 elsewhere. Let u and v be two vectors of length r in F r, q and l.a. weights r − k and r − k respectively and let K = k + k . The following matrix generatesa [2 r, K, r − K ] linear NMDS code in F r, q , u . . . u r − k − u r − k v . . . v r − k − v r − k I k − E r ( k , k ) E r ( k , k ) I k − , where E r ( i, j ) is an ( i − × ( r − j − 1) matrix which has the following form: E r ( i, j ) = " D r − j − ( i + j − r ) × ( r − j − , i + j > r, h ( i − × ( r − i − j ) D i − i , i + j ≤ r. From the form of the generator matrix it can be seen that any K − k and k columns fromthe first and the second blocks respectively are linearly dependent. This implies that it forms an OOA of r.a. strength exactly K − 1. Hence the dual of the code hasdistance K . Finally, the minimum weight of any vector produced by this generatormatrix is 2 r − K . Hence by Lemma 2.4, this matrix generates an NMDS code. n=3: For n = 3, we have an NMDS code with very specific parameters. Let u, v, w ∈ F r, q be three vectors of l.a. weight r − r, , d ] code in base q ≥ 3. It is formed of threeblocks, corresponding to the three dimensions given by n. Here is a 1 × ( r − u . . . u r − u r − u r − u r − u r − v . . . v r − v r − v r − v r − v r − w . . . w r − w r − w r − w r − w r − . References [1] T. L. Alderson, A. A. Bruen, and R. Silverman, Maximum distance separable codes and arcsin projective spaces , J. Combin. Theory Ser. A (2007), no. 6, 1101–1117.[2] A. Barg and P. Purkayastha, Bounds on ordered codes and orthogonal arrays , Moscow Math-ematical Journal (2009), no. 2, 211–243.[3] J. Bierbrauer, A direct approach to linear programming bounds for codes and tms-nets , Des.Codes Cryptogr. (2007), 127–143.[4] R. A. Brualdi, J.S. Graves, and K. M. Lawrence, Codes with a poset metric , Discrete Math. (1995), no. 1-3, 57–72.[5] M. de Boer, Almost MDS codes , Des. Codes Cryptogr. (1996), 143–155.[6] S. Dodunekov and I. Landgev, Near-MDS codes , J. of Geometry (1995), no. 1, 30–43.[7] S. T. Dougherty and M. M. Skriganov, Maximum distance separable codes in the ρ metricover arbitrary alphabets , Journal of Algebraic Combinatorics (2002), 71–81.[8] A. Faldum and W. Willems, A characterization of MMD codes , IEEE Trans. Inform. Theory (1998), no. 4, 1555–1558.[9] A. Ganesan and P. O. Vontobel, On the existence of universally decodable matrices , IEEETrans. Inform. Theory (2007), no. 7, 2572–2575.[10] G. G. G¨unther, Finite field Fourier transform for vectors of arbitrary length , Communi-cations and Cryptography: Two Sides of One Tapestry (R. E. Blahut, Jr. D. J. Costello,U. Maurer, and T. Mittelholzer, eds.), Norwell, MA, and Dordrecht, NL: Kluwer Academic,1994, pp. 141–153.[11] J. Y. Hyun and H. K. Kim, Maximum distance separable poset codes , Des. Codes Cryptogr. (2008), no. 3, 247–261. EAR MDS POSET CODES AND DISTRIBUTIONS 13 [12] K. M. Lawrence, A combinatorial characterization of ( t, m, s ) -nets in base b , J. Combin.Designs (1996), 275–293.[13] W. J. Martin and D. R. Stinson, Association schemes for ordered orthogonal arrays and ( T, M, S ) -nets , Canad. J. Math. (1999), no. 2, 326–346.[14] J. L. Massey and S. Serconek, Linear complexity of periodic sequences: a general theory ,Advances in cryptology—CRYPTO ’96 (Santa Barbara, CA), Lecture Notes in Comput. Sci.,vol. 1109, Springer, Berlin, 1996, pp. 358–371.[15] G. L. Mullen and W. Ch. Schmid, An equivalence between ( t, m, s ) -nets and strongly orthog-onal hypercubes , Journal of Combin. Theory, Ser. A (1996), 164–174.[16] H. Niederreiter, Low-discrepancy point sets , Monatsh. Math. (1986), no. 2, 155–167.[17] R. R. Nielsen, A class of Sudan-decodable codes , IEEE Trans. Inform. Theory (2000),no. 4, 1564–1572.[18] M. Yu. Rosenbloom and M. A. Tsfasman, Codes for the m -metric , Problems of InformationTransmission (1997), no. 1, 45–52.[19] R. Roth, Introduction to coding theory , Cambridge University Press, Cambridge, 2006.[20] M. M. Skriganov, Coding theory and uniform distributions , Algebra i Analiz (2001), no. 2,191–239, English translation in St. Petersburg Math. J. vol. 13 (2002), no. 2, 301–337.[21] , On linear codes with large weights simultaneously for the Rosenbloom-Tsfasman andHamming metrics , J. Complexity (2007), no. 4-6, 926–936.[22] V. Wei, Generalized Hamming weights for linear codes , IEEE Trans. Inform. Theory (1991), no. 5, 1412–1418. Department of ECE/Institute for Systems Research, University of Maryland, Col-lege Park, MD 20817 and Dobrushin Mathematical Lab., Institute for Problems ofInformation Transmission, Moscow, Russia E-mail address : [email protected] Department of ECE/Institute for Systems Research, University of Maryland, Col-lege Park, MD 20817 E-mail address ::