 # On integral weight spectra of the MDS codes cosets of weight 1, 2, and 3

The weight of a coset of a code is the smallest Hamming weight of any vector in the coset. For a linear code of length n, we call integral weight spectrum the overall numbers of weight w vectors, 0≤ w≤ n, in all the cosets of a fixed weight. For maximum distance separable (MDS) codes, we obtained new convenient formulas of integral weight spectra of cosets of weight 1 and 2. Also, we give the spectra for the weight 3 cosets of MDS codes with minimum distance 5 and covering radius 3.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Let be the Galois field with elements, . Let be the space of -dimensional vectors over . We denote by an -linear code of length , dimension , minimum distance , and covering radius . If , it is a maximum distance separable (MDS) code. For an introduction to coding theory see [2, 16, 11, 19].

A coset of a code is a translation of the code. A coset of an code can be represented as

 V={x∈Fnq|x=c+v,c∈C}⊂Fnq (1.1)

where is a vector fixed for the given representation; see [2, 11, 16, 17, 19] and the references therein.

The weight distribution of code cosets is an important combinatorial property of a code. In particular, the distribution serves to estimate decoding results. There are many papers connected with distinct aspects of the weight distribution of cosets for codes over distinct fields and rings, see e.g.

[1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 14, 20, 15, 21], [8, Sect. 6.3], [11, Sect. 7], [16, Sections 5.5, 6.6, 6.9], [17, Sect. 10] and the references therein.

For a linear code of length , we call integral weight spectrum the overall numbers of weight vectors, , in all the cosets of a fixed weight.

In this work, for MDS codes, using and developing the results of , we obtain new convenient formulas of integral weight spectra of cosets of weight 1 and 2. The obtained formulas for weight 1 and 2 cosets, seem to be simple and expressive.

This paper is organized as follows. Section 2 contains preliminaries. In Section 3, we consider the integral weight spectrum of the weight 1 cosets of MDS codes with minimum distance . In Section 4, we obtain the integral weight spectrum of the weight 2 cosets of MDS codes with minimum distance . In Section 5, we give the spectra for the weight 3 cosets of MDS codes with minimum distance and covering radius .

## 2 Preliminaries

### 2.1 Cosets of a linear code

We give a few known definitions and properties connected with cosets of linear codes, see e.g. [2, 11, 16, 17, 19] and the references therein.

We consider a coset of an code in the form (1.1). We have . One can take as any vector of . So, there are formally distinct representations of the form (1.1); all they give the same coset . If , we have . The distinct cosets of  partition into sets of size .

We remind that the Hamming weight of the vector is the number of nonzero entries in .

###### Notation 2.1.

For an code and its coset of the form (1.1), the following notation is used:

 t=⌊d−12⌋ the number of correctable errors; Aw(C) the number of weight w codewords of the code C; Aw(V) the number of weight w vectors in the coset V; the weight of a coset the smallest Hamming weight of any vector in the coset; V(W) a coset of weight W;  Aw(V(W))=0% if w

In cosets of weight , a vector of the minimal weight is not necessarily unique. Cosets of weight have a unique leader.

The code is the coset of weight zero. The leader of is the zero vector of .

###### Definition 2.2.

Let be an code and let be its coset of weight . Let be the overall number of weight vectors in all cosets of weight . For a fixed , we call the set integral weight spectrum of the code cosets of weight .

Distinct representations of the integral weight spectra and values of are considered in the literature, see e.g. [2, Th. 14.2.2], [5, 6], [15, Lem. 2.14], [16, Th. 6.22]. For instance, in [5, Eqs. (11)–(13)], for an MDS code correcting -fold errors, the value gives .

### 2.2 Some useful relations

For , the weight distribution of an MDS code has the following form, see e.g. [11, Th. 7.4.1], [16, Th. 11.3.6]:

 Aw(C)=(nw)w−d∑j=0(−1)j(w)j(qw−d+1−j−1). (2.1)

In , the volume of a sphere of radius is

 Vn(t)=t∑i=0(q−1)i(ni). (2.2)

The following combinatorial identities are well known, see e.g. [18, Sect. 1, Eqs. (I),(IV), Problem 9(a)]:

 (nk)=(n−1k)+(n−1k−1). (2.3) (nm)(mp)=(np)(n−pm−p)=(nm−p)(n−m+pp). (2.4) m∑k=0(−1)k(nk)=(−1)m(n−1m). (2.5)

In [5, Eqs. (11)–(13)], for an MDS code correcting -fold errors, the following relations for denoted by are given:

 AΣu(V≤t)=Du=(nu)u−d+t∑j=0(−1)jNj, d−t≤u≤n, (2.6) where Nj=(uj)[qu−d+1−jVn(t)−t∑i=0(u−j)i(q−1)i]  if  0≤j≤u−d, (2.7) Nj=(uj)⎡⎣t∑w=d−u+j(n−u+jw)w−d+u−j∑i=0(−1)i(wi)(qw−d+u−j−i+1−1) (2.8) ×t∑s=w(u−js−w)(q−1)s−w]  if  u−d+1≤j≤u−d+t.

## 3 The integral weight spectrum of the weight 1 cosets of MDS codes with minimum distance d≥3

In Sections 35, we represent the values

in distinct forms that can be convenient in distinct utilizations, e.g. for estimates of the decoder error probability, see

[5, 6] and the references therein.

We use (with some transformations) the results of [5, Eqs. (11)–(13)] where, for an MDS code correcting -fold errors, the value gives the overall number of weight vectors in all cosets of weight . We cite [5, Eqs. (11)–(13)] by formulas (2.6)–(2.8), respectively.

In the rest of the paper we put that a sum is equal to zero if .

###### Lemma 3.1.

[5, Eqs. (11)–(13)] Let . For an MDS code of minimum distance , the overall number of weight vectors in all cosets of weight is as follows:

 AΣw(V≤1)=(nw)[w−d∑j=0(−1)j(wj)[qw−d+1−j(1+n(q−1))−1−(w−j)(q−1)] (3.1) −(−1)w−d(wd−1)(n−d+1)(q−1)].
###### Proof.

In the relations for of  cited by (2.6)–(2.8), we put and then use (2.2). In (2.8), we have whence in all terms. Finally, we change by to save the notations of this paper. ∎

###### Lemma 3.2.

The following holds:

 m∑j=0(−1)j(wj)(w−jv)=(−1)m(wv)(w−v−1m). (3.2)
###### Proof.

In (2.4), we put , , , and obtain

 m∑j=0(−1)j(wj)(w−jv)=(wv)m∑j=0(−1)j(w−vj).

Now we use (2.5). ∎

###### Lemma 3.3.

Let . The following holds:

 w+1−d∑j=0(−1)j(wj)qw+1−d−j=w−d∑j=0(−1)j(wj)(qw+1−d−j−1)−(−1)w−d(w−1d−2).
###### Proof.

We write the left sum of the assertion as

 w−d∑j=0(−1)j(wj)(qw+1−d−j−1+1)−(−1)w−d(wd−1).

By (2.5),

 w−d∑j=0(−1)j(wj)=(−1)w−d(w−1d−1).

Finally, we apply (2.3). ∎

For an code , we denote

 Ω(j)w(C)=(−1)w−d(n−jw−j)(w−j−1d−j−2). (3.3)

Also, we denote

 Φ(j)w=(−1)w−5[(q+1w)(w−13)−(q+1−jw−j)(w−1−j3−j)]. (3.4)
###### Theorem 3.4.

(integral weight spectrum 1)

Let . Let be an MDS code of minimum distance .

(i) For the code , the overall number of weight vectors in all weight cosets is as follows:

 AΣw(V(1))=(nw)(q−1)[nw+1−d∑j=0(−1)j(wj)qw+1−d−j+(−1)w−dw(w−2d−3)] (3.5) =n(q−1)[(nw)w+1−d∑j=0(−1)j(wj)qw+1−d−j+Ω(1)w(C)] (3.6) =n(q−1)[(nw)w−d∑j=0(−1)j(wj)(qw+1−d−j−1)−Ω(0)w(C)+Ω(1)w(C)] (3.7) =n(q−1)[Aw(C)−Ω(0)w(C)+Ω(1)w(C)] (3.8) =n(q−1)[Aw(C)−(−1)w−d((nw)(w−1d−2)−(n−1w−1)(w−2d−3))]. (3.9)

(ii) Let the code be a MDS code of length and minimum distance . For , the overall number of weight vectors in all weight cosets is as follows

 AΣw(V(1))=(q+1w)(q−1)[qw+2−d−w−d∑i=0(−1)i((wi+1)−(wi))qw+1−d−i (3.10) −(−1)w−d((wd−1)−w(w−2d−3))], d−1≤w≤q+1.

(iii) Let the code be a MDS code of length and minimum distance . For , the overall number of weight vectors in all weight cosets is as follows

 AΣw(V(1))=(q2−1)[Aw(C)−Φ(1)w], 4≤w≤q+1. (3.11)
###### Proof.

(i) By the definition of , see Notation 2.1, for the code of Lemma 3.1, we have

 AΣw(V(1))=AΣw(V≤1)−Aw(C). (3.12)

We subtract (2.1) from (3.1) that gives

 AΣw(V(1))=(nw)(q−1)[−(−1)w−d(wd−1)(n−d+1) +w−d∑j=0(−1)j(wj)(qw−d+1−jn−w+j)] =(nw)(q−1)[nw−d+1∑j=0(−1)j(wj)qw−d+1−j−w−d+1∑j=0(−1)j(wj)(w−j)].

Here some simple transformations are missed out. Now, for the 2-nd sum , we use Lemma 3.2 and obtain (3.5).

To form (3.6) from (3.5), we change by , see (2.4). To obtain (3.7) from (3.6), we apply Lemma 3.3. For (3.8), we use (2.1). Finally, (3.9) is (3.8) in detail.

(ii) We substitute to (3.5) that implies (3.10) after simple transformations.

(iii) We substitute and to (3.9) that gives (3.11). ∎

For , we give a formula alternative to (3.1).

###### Corollary 3.5.

Let be as in (2.2). Let be an MDS code of minimum distance . Then for , the overall number of weight vectors in all cosets of weight is as follows:

 AΣw(V≤1)=Aw(C)⋅Vn(1)−(−1)w−dn(q−1)1∑j=0(−1)j(n−jw−j)(w−j−1d−j−2). (3.13)
###### Proof.

We use (3.12) and (3.9). ∎

## 4 The integral weight spectrum of the weight 2 cosets of MDS codes with minimum distance d≥5

As well as in Lemma 3.1, we use the results of  with some transformations.

###### Lemma 4.1.

[5, Eqs. (11)–(13)] Let . Let be as in (2.2). For an MDS code of minimum distance , the overall number of weight vectors in all cosets of weight is as follows:

 AΣw(V≤2)=(nw)[w−d∑j=0(−1)j(wj)[qw−d+1−j⋅Vn(2)−Vw−j(2)] (4.1) −(−1)w−d(n−d+1)(q−1)2((wd−1)[2+(q−1)(n+d−2)]−(wd−2)(n−d+2))].
###### Proof.

In the relations for of  cited by (2.6)–(2.8), we put that gives, in (2.8), and , whence and , respectively. Then we do simple transformations. Finally, we change by to save the notations of this paper. ∎

For an code , we denote

 Δw(C)=(−1)w−d(nw)(wd−2)(n−d+22)(q−1); (4.2) Δ⋆w(C)=Δw(C)(n2)(q−1)2.
###### Lemma 4.2.

The following holds:

 Δ⋆w(C)=(−1)w−d(n−d+2n−w)(n−2d−2)1q−1. (4.3)
###### Proof.

By (2.4), we have

 (nw)(wd−2)=(nd−2)(n−d+2w−d−2)=(nd−2)(n−d+2n−w), (nd−2)(n−d+22)=(nd)(dd−2)=(nd)(d2)=(n2)(n−2d−2).

###### Theorem 4.3.

(integral weight spectrum 2)

Let . Let be an MDS code of minimum distance . Let and be as in (3.3) and (3.4).

(i) For the code , the overall number of weight vectors in all weight cosets is as follows:

 AΣw(V(2))=(nw)(q−1)2[(n2)w+1−d∑j=0(−1)j(wj)qw+1−d−j+(−1)w−d(w2)(w−3d−4)] (4.4) AΣw(V(2))=+Δw(C). =(n2)(q−1)2[(nw)w+1−d∑j=0(−1)j(wj)qw+1−d−j+Ω(2)w(C)]+Δw(C). (4.5) =(n2)(q−1)2[(nw)w−d∑j=0(−1)j(wj)(qw+1−d−j−1)−Ω(0)w(C)+Ω(2)w(C)]+Δw(C) (4.6) =(n2)(q−1)2[Aw(C)−Ω(0)w(C)+Ω(2)w(C)]+(n2)(q−1)2Δ⋆w(C) (4.7) =(n2)(q−1)2[Aw(C)−(−1)w−d((nw)(w−1d−2)−(n−2w−2)(w−3d−4))] (4.8) +(−1)w−d(n2)(q−1)(n−d+2n−w)(n−2d−2).

(ii) Let the code be a MDS code of length and minimum distance . For , the overall number of weight vectors in all weight cosets is as follows

 AΣw(V(2))=(q+12)(q−1)2[Aw(C)−Φ(2)w+(−1)w−513(q−2w−3)(q−22)], (4.9) AΣw(V(2))=3≤w≤q+1.
###### Proof.

(i) By the definition of , see Notation 2.1, for the code of Lemma 4.1, we have

 AΣw(V(2))=AΣw(V≤2)−AΣw(V≤1). (4.10)

We subtract (3.1) from (4.1) that gives

 AΣw(V(2))=(nw)[w−d∑j=0(−1)j(wj)(qw+1−d−j(n2)(q−1)2−(w−j2)(q−1)2) +(−1)w+1−d(wd−1)12(n−d+1)(q−1)2(n+d−2)]+Δw(C) =(nw)(q−1)2[(n2)w−d∑j=0(−1)j(wj)qw+1−d−j−w−d∑j=0(−1)j(wj)(w−j2) −(−1)w−d(wd−1)(12(n−d+1)(n+d−2)+(n2)−(n2))]+Δw(C).

Applying Lemma 3.2 to the 2-nd sum , after simple transformations we obtain

 AΣw(V(2))=(nw)(q−1)2[(n2)w+1−d∑j=0(−1)j(wj)qw+1−d−j−(−1)w−d(w2)(w−3w−d) +(−1)w−d(wd−1)(d−12)]+Δw(C).

Due to (2.4) and (2.3), we have

 (wd−1)(d−12)=(w2)(w−2d−3)=(w2)[(w−3d−4)+(w−3d−3)].

Also, . Now we can obtain (4.4). Moreover, by (2.4), we have

 (nw)(w2)=(n2)(n−2w−2)

that gives (4.5).

To obtain (4.6) from (4.5), we apply Lemma 3.3. For (4.7), we use (2.1). Finally, (4.8) is (4.7) in detail.

(ii) We substitute and to (4.8) that gives (4.9). ∎

## 5 The integral weight spectrum of the weight 3 cosets of MDS codes with minimum distance d=5 and covering radius R=3

###### Theorem 5.1.

(integral weight spectrum 3)

Let . Let be an MDS code of minimum distance and covering radius . Let , , , and be as in (2.2), (3.4), (4.1), and (4.2), respectively. Let and be as in Theorems 3.4 and 4.3, respectively.

(i) For the code , the overall number of weight vectors in all cosets of weight  is as follows:

 AΣw(V(3))=(nw)(q−1)w−AΣw(V≤2) (5.1) =(nw)(q−1)w−[Aw(C)+AΣw(V(1))+AΣw(V(2))] (5.2) =(nw)(q−1)w−[(nw)w−5∑j=0(−1)j(wj)[qw−4−j⋅Vn(2)−Vw−j(2)] (5.3) −(−1)w−5(n−4)(q−1)2((w4)[2+(q−1)(n+3)]−(w3)(n−3))].

(ii) Let the code be a MDS code of length , minimum distance , and covering radius . For , the overall number of weight vectors in all weight cosets is as follows

 AΣw(V(3))=(q+1w)(q−1)w−[(q+1w)w−5∑j=0(−1)j(wj)[qw−4−j⋅Vq+1(2)−Vw−j(2)] (5.4) −(−1)w−5(q−3)(q−1)2((w4)(q2+3q−2)−(w3)(q−2))] =(q+1w)(q−1)w−[Vq+1(2)Aw(C)−(q2−1)Φ(1)w−(q+12)(q−1)2Φ(2)w−Δw(C)]. (5.5)
###### Proof.

(i) Due to covering radius , in there are not cosets of weight ; therefore for we have (5.1) where is the total number of weight vectors in .

The relation (5.2) follows from (5.1), (3.12), and (4.10).

To form (5.3), we substitute (4.1) to (5.1) with .

(ii) We substitute to (5.3) and obtain (5.4).

To obtain (5.5) from (5.2), we use (3.11), (4.9), (4.2), and (4.3) with , . ∎

## References

•  E.F. Assmus, Jr., H.F. Mattson, Jr., The weight-distribution of a coset of a linear code, IEEE Trans. Inform. Theory 24(4), 497 (1978) https://doi.org/10.1109/tit.1978.1055903
•  R.E. Blahut, Theory and Practice of Error Control Codes, Addison Wesley, Reading, 1984
•  A. Bonnecaze, I.M. Duursma, Translates of linear codes over , IEEE Trans. Inform. Theory 43(4), 1218–1230 (1997) https://doi.org/10.1109/18.605585
•  P. Charpin, T. Helleseth, V. Zinoviev, The coset distribution of triple-error-correcting binary primitive BCH codes. IEEE Trans. Inform. Theory, 52(4), 1727–1732 (2006)