# On the weight distribution of second order Reed-Muller codes and their relatives

The weight distribution of second order q-ary Reed-Muller codes have been determined by Sloane and Berlekamp (IEEE Trans. Inform. Theory, vol. IT-16, 1970) for q=2 and by McEliece (JPL Space Programs Summary, vol. 3, 1969) for general prime power q. Unfortunately, there were some mistakes in the computation of the latter one. This paper aims to provide a precise account for the weight distribution of second order q-ary Reed-Muller codes. In addition, the weight distributions of second order q-ary homogeneous Reed-Muller codes and second order q-ary projective Reed-Muller codes are also determined.

## Authors

• 5 publications
06/20/2018

### Weight distribution of cyclic codes with arbitrary number of generalized Niho type zeroes with corrigendum

Cyclic codes are an important class of linear codes, whose weight distri...
03/20/2017

### SORT: Second-Order Response Transform for Visual Recognition

In this paper, we reveal the importance and benefits of introducing seco...
09/03/2018

### Minimum Description Length codes are critical

Learning from the data, in Minimum Description Length (MDL), is equivale...
08/29/2019

### A New Method for Employing Feedback to Improve Coding Performance

We introduce a novel mechanism, called timid/bold coding, by which feedb...
05/20/2019

### On the Second-Order Asymptotics of the Partially Smoothed Conditional Min-Entropy & Application to Quantum Compression

Recently, Anshu et al. introduced "partially" smoothed information measu...
04/22/2021

### Second order Expansions for Extreme Quantiles of Burr Distributions and Asymptotic Theory of Record Values

In this paper we investigate the Burr distributions Family which contain...
08/17/2020

### Whitening and second order optimization both destroy information about the dataset, and can make generalization impossible

Machine learning is predicated on the concept of generalization: a model...
##### 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 a prime power. Due to their elegant algebraic properties and connections to finite geometry, -ary Reed-Muller codes are long-standing research objects in coding theory, see [7, Chapters 13,14,15] for and [1, Section 5] for general . Moreover, second order -ary Reed-Muller codes are of particular interest, since they contain some famous subcodes such as Kerdock codes [7, Chapter 15, Section 5] and the well-rounded theory of quadratic forms over finite fields can be applied.

The weight distribution is a fundamental parameter of Reed-Muller codes. For second order -ary Reed-Muller codes, their weight distributions have been computed in [11] for and in [8] for general . Unfortunately, as observed in [5, p. 2559], there are some errors and typos in the computation of [8] (some essential errors are spotted in Tables 4,8,10 and typos in Tables 3,6). Hence, in this paper, we aim to provide a precise account for the weight distribution of second order -ary Reed-Muller codes, with being a prime power. An outline is as follows, where the second order -ary Reed-Muller is denoted by .

• Observe that is a disjoint union of cosets of the repetition code (when ) or cosets of the first order Reed-Muller code (when ), where the coset representatives are exactly all quadratic forms from to (see (3.2)).

• When , the weight distribution of each coset follows from the number of zeroes to a quadratic form (Proposition 2.9). When , the weight distribution of each coset can be derived from the results in [5] (Propositions 2.62.72.8 and 3.1). In both cases, the weight distribution of each coset depends only on the rank and type of the quadratic form, which is the coset representative. We remark that the canonical quadratic forms and related terminologies used in [5] are different from those in this paper. Thus, in order to employ the results in [5], we need to build the correspondence between different canonical quadratic forms and terminologies at first (Table 2.1).

• The number of quadratic forms from to , with given rank and type, has been obtained by McEliece [8], following which we can compute the frequency of each weight in .

In addition, using a similar idea, the weight distributions of second order -ary homogeneous Reed-Muller codes and second order -ary projective Reed-Muller codes are also computed.

Below, we recall some basic knowledge about quadratic forms over finite fields in Section 2. In Section 3, we compute the weight distributions of second order Reed-Muller codes, second order homogeneous Reed-Muller codes and second order projective Reed-Muller codes. Section 4 concludes the paper.

## 2 Quadratic forms over finite fields

The mathematical mechanism behind second order Reed-Muller codes is the theory of quadratic forms over finite fields. In this section, we introduce some background knowledge about quadratic forms over finite fields.

Let be an

-dimensional vector space over

. A quadratic form defined on is a function from to , such that

• For each and , .

• For each , , where is a symmetric bilinear form associated with .

For a symmetric bilinear form defined on , the radical of is defined to be

which is a vector space over . For a quadratic form defined on , the radical of is a vector space over , namely,

where is the symmetric bilinear form associated with . The rank of is defined to be

Let be a quadratic form defined on , then has the following unique representation

 Q={∑1≤i≤j≤mcijxixj,cij∈Fqif q is even,∑1≤i,j≤mcijxixj,cij=cji∈Fqif% q is odd.

Let and be two quadratic forms defined on . They are equivalent if there exists an invertible matrix over , such that for each ,

 Q1(x)=Q2(Ax).

Thus, two quadratic forms are equivalent, if one can be transformed into the other, by applying an invertible linear transformation on the variables.

Quadratic forms over finite fields have been classified in the sense that each quadratic form is equivalent to a canonical one. Following

[8, Table 1], we describe the canonical quadratic forms over finite fields with even and odd characteristic in the next two propositions. Note that we use Tr to denote the absolute trace function defined on a finite field.

###### Proposition 2.1.

Let be an even prime power. For , each quadratic form from to with rank is equivalent to one of the following canonical quadratic forms.

If is odd,

• .

If is even,

• .

• , where is a nonzero element of and satisfies .

###### Proposition 2.2.

Let be an odd prime power. For , each quadratic form from to with rank is equivalent to one of the following canonical quadratic forms.

If is odd,

• .

• , is a nonsquare of .

If is even,

• .

• , is a nonsquare of .

Now, we are ready to define the type of a quadratic form.

###### Definition 2.3.

Let be a quadratic form over .

• When is even and has even rank, is of type 1 if it is equivalent to the canonical quadratic form in Proposition 2.1(2) and of type -1 if it is equivalent to the canonical quadratic form in Proposition 2.1(3).

• When is odd, is of type 1 if it is equivalent to the canonical quadratic form in Proposition 2.2(1) or 2.2(3), and of type -1 if it is equivalent to the canonical quadratic form in Proposition 2.2(2) or 2.2(4).

A zero quadratic form, whose rank is , is defined to be of type .

Combining Propositions 2.1 and 2.2, we can see that up to equivalence, a quadratic form over finite field is determined by its rank and type, except when is even and has odd rank, in which the rank solely determines the quadratic form.

Next, we introduce more notations. For and , we use to denote the number of quadratic forms from to , with rank and type . We use to denote the number of quadratic forms from to , with rank and type . Moreover, for , we use to denote the number of quadratic forms from to with rank . Considering the action of orthogonal groups on quadratic forms over finite fields, the numbers and have been obtained in [8].

###### Proposition 2.4 ([8, Table 3]).

For quadratic forms from to , we have the following.

• and

 v2j+1=qj2+j∏mi=m−2j(qi−1)∏ji=1(q2i−1),3≤2j+1≤m.
• . For and ,

 v2j,τ=qj2(qj+τ)2∏mi=m−2j+1(qi−1)∏ji=1(q2i−1).
###### Remark 2.5.

Let be an odd prime power. For and , the number of quadratic forms from to with rank and type was also obtained in [8, Table 3]. We only list in Proposition 2.4, which is sufficient for our computation below.

Let be a function from to . Define

 N(f)=|{x∈Fmq∣f(x)=0}|.

Let be the set of all linear functions from to . For each , define to be a constant function from to , which sends each element of to . Let be a quadratic form from to . For each , the multiset

 {N(f)∣f∈{Q+L+¯¯c∣L∈L}}

has been computed in [5, Appendix A]. Consequently, we can determine the multiset

 {N(f)∣f∈{Q+L+¯¯c∣L∈L,c∈Fq}},

which will be used in the computation of weight distributions. It is worthy noting that when is odd, we used different canonical quadratic forms in [5]. Thus, in order to exploit Proposition 2.4 and the results in [5, Appendix A], we have to establish the correspondence between the canonical quadratic forms in [5, Proposition 3.8] and those in Propositions 2.1 and 2.2. Indeed, the relation is summarized in Table 2.1. The proof of this relation is technical and included in the Appendix.

When is odd, we use to denote the set of nonzero squares in and the set of nonsquares in . Following Table 2.1, we can rephrase [5, Lemmas A.2, A.4] in the next two propositions.

###### Proposition 2.6.

Let be an even prime power and a quadratic form from to . Let be the set of all linear functions from to and . Suppose ranges over . Then the following holds.

(1) Let have odd rank . If , then

 N(f)=⎧⎪⎨⎪⎩qm−1qm−qr+qr−1 times,qm−1±qm−r+12(q−1)qr−1±qr−122 times.

If , then

 N(f)=⎧⎪⎨⎪⎩qm−1qm−qr+qr−1 times,qm−1±qm−r+12qr−qr−1∓qr−122 times.

(2) Let have even rank and type . If , then

 N(f)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−1qm−qr times,qm−1+τqm−r+22(q−1)qr−1+τqr−22(q−1) times,qm−1−τqm−r+22(q−1)(qr−1−τqr−22) times.

If , then

 N(f)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−1qm−qr times,qm−1+τqm−r+22(q−1)qr−1−τqr−22 times,qm−1−τqm−r+22(q−1)qr−1+τqr−22 times.
###### Proposition 2.7.

Let be an odd prime power and a quadratic form from to . Let be the set of all linear functions from to and . Suppose ranges over . Then the following holds.

(1) Let have odd rank and type . If , then

 N(f)={qm−1qm−qr+qr−1 times,qm−1±τqm−r+12(q−1)2(qr−1±τqr−12) times.

If , then

 N(f)=⎧⎪ ⎪ ⎪ ⎪⎨⎪ ⎪ ⎪ ⎪⎩qm−1qm−qr+qr−1+τqr−12 times,qm−1+τqm−r+12q−12qr−1−τqr−12 times,qm−1−τqm−r+12q−12qr−1 times.

If , then

 N(f)=⎧⎪ ⎪ ⎪ ⎪⎨⎪ ⎪ ⎪ ⎪⎩qm−1qm−qr+qr−1−τqr−12 times,qm−1+τqm−r+12q−12qr−1 times,qm−1−τqm−r+12q−12qr−1+τqr−12 times.

(2) Let have even rank and type . If , then

 N(f)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−1qm−qr times,qm−1+τqm−r+22(q−1)qr−1+τqr−22(q−1) times,qm−1−τqm−r+22(q−1)(qr−1−τqr−22) times.

If , then

 N(f)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−1qm−qr times,qm−1+τqm−r+22(q−1)qr−1−τqr−22 times,qm−1−τqm−r+22(q−1)qr−1+τqr−22 times.

Let be a quadratic form from to and , Propositions 2.6 and 2.7 describe the multiset

 {N(f)∣f∈{Q+L+¯¯c∣L∈L}}.

Now we are ready to determine the multiset . The following result follows from Propositions 2.6 and 2.7.

###### Proposition 2.8.

Let be a quadratic form from to . Suppose ranges over . Then the following holds.

• If has odd rank , then

 N(f)={qm−1qm+1−qr+1+qr times,qm−1±qm−r+12q−12qr times.
• If has even rank and type , then

 N(f)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−1qm+1−qr+1 times,qm−1+τqm−r+22(q−1)qr times,qm−1−τqm−r+22(q−1)qr times.

Note that when has odd rank, the multiset does not depend on the type of .

We finally mention the following well known result concerning , where is a quadratic form from to .

###### Proposition 2.9.

Let be a quadratic form from to . We have

 N(Q)={qm−1if Q has odd rank,qm−1+τqm−r+22(q−1)if Q has even rank r and type % τ.
###### Proof.

The conclusion is a direct consequence of [6, Theorems 6.26, 6.27, 6.32] and Table 2.1. ∎

## 3 The weight distribution of second order Reed-Muller codes and their relatives

In this section, we compute the weight distributions of second order Reed-Muller codes and their relatives. For this purpose, a brief introduction to Reed-Muller codes, homogeneous Reed-Muller codes and projective Reed-Muller codes is also included. For a more detailed treatment, see [1, Section 5], [7, Chapters 13,14,15] for Reed-Muller codes, [9] for homogeneous Reed-Muller codes and [3, 4, 10] for projective Reed-Muller codes. For the basic knowledge of coding theory, please refer to [7]. We only mention a few notations below.

Let be a code of length . For , is the Hamming weight of the codeword . For , we use to denote the number of codewords in with Hamming weight . The sequence is called the weight distribution of . The weight enumerator of is a polynomial , which gives a compact expression of the weight distribution.

### 3.1 Reed-Muller codes

Let be a prime power. Let be an -dimensional vector space over . We use to denote the vector space of all polynomials over with variables and degree at most . Let , the -th order -ary Reed-Muller code of length is defined as

 {(f(vi))qm−1i=0∣f∈Pq(r,m)},

which is denoted by . In particular, when , the second order -ary Reed-Muller code has the following parameters [1, Theorem 5.4.1, Corollary 5.5.4]:

 [n,k,d]={[2m,m2+m+22,2m−2]if q=2, m≥2,if q>2. (3.1)

We use and to denote the all-zero and all-one vector of length over . Let be the set of all quadratic forms from to . By definition, the second order Reed-Muller code can be decomposed into a disjoint union of cosets:

 RMq(2,m)={⋃Q∈Q((Q(vi))qm−1i=0+{0,1})if q=2, m≥2⋃Q∈Q((Q(vi))qm−1i=0+RMq(1,m))if q>2. (3.2)

Note that when , we have for each . Thus, each linear function from to is actually a quadratic form. This explains the distinct decompositions in (3.2) for and , as well as the different dimensions in (3.1).

Thus, to compute the weight distribution of , it suffices to compute the weight distribution of or , for each . The following proposition says the weight distribution of depends only on the rank and type of .

###### Proposition 3.1.

Let be a quadratic form from to . Suppose ranges over . Then the following holds.

• If has odd rank , then

 wt(c)={qm−qm−1qm+1−qr+1+qr times,qm−qm−1±qm−r+12q−12qr times.
• If has even rank and type , then

 wt(c)=⎧⎪ ⎪ ⎪⎨⎪ ⎪ ⎪⎩qm−qm−1qm+1−qr+1 times,qm−qm−1−τqm−r+22(q−1)% qr times,qm−qm−1+τqm−r+22(q−1)qr times.
###### Proof.

Recall that is the set of all linear functions from to . By definition, the first order Reed-Muller code

 RMq(1,m)={(g(vi))qm−1i=0∣g∈{L+¯¯c∣L∈L,c∈Fq}}.

Thus, the weight distribution of is the multiset

 {qm−N(f)∣f∈{Q+L+¯¯c∣L∈L,c∈Fq}}.

Therefore, the conclusion follows from Proposition 2.8. ∎

Now we are ready to compute the weight distribution of second order Reed-Muller codes.

###### Theorem 3.2.

The weight distribution of the second order Reed-Muller code is listed in Table 3.1 for and in Table 3.2 for , where , , are defined in Proposition 2.4 and if .

###### Proof.

When , the conclusion follows from (3.2) and Propositions 2.4 and 2.9. When , the conclusion follows from (3.2) and Propositions 2.4 and 3.1. ∎

###### Remark 3.3.

Table 3.1 reproduces the results in [11] (see also [7, Chapter 15, Theorem 8]). Still, we do not have a compact formula on the frequency of codewords with weight . Similarly, in Table 3.2, no compact formula on the frequency of codewords with weight is available.

###### Example 3.4.

Numerical experiment shows that the second order binary Reed-Muller code has weight enumerator

 1 +10668Z32+5291328Z48+112881664Z56+300503590Z64+ 112881664Z72+5291328Z80+10668Z96+Z128,

which is consistent with Table 3.1.

###### Example 3.5.

Numerical experiment shows that the second order ternary Reed-Muller code has weight enumerator

 1 +240Z27+14040Z36+519480Z45+1705860Z48+2729376Z51+4062720Z54+ 3411720Z57+1364688Z60+533520Z63+7020Z72+242Z81,

which is consistent with Table 3.2.

### 3.2 Homogeneous Reed-Muller codes

Some variations of Reed-Muller codes were discussed in the literature. As an attempt to find subcodes of Reed-Muller codes with large minimum distances, the concept of homogeneous Reed-Muller codes was proposed [8, 9]. Let be an -dimensional vector space over . We use to denote the vector space of all homogeneous polynomials over with variables and degree . Let , the -th order -ary homogeneous Reed-Muller code of length is defined as

 {(f(vi))qm−1i=0∣f∈Phq(r,m)},

which is denoted by . Without loss of generality, suppose that is the zero vector in . Then by definition, the first coordinate of is always . Thus, in some literature, the homogeneous Reed-Muller code is defined to be the punctured code of with the first coordinate deleted (see [2, 8] for instance). When , the second order -ary homogeneous Reed-Muller code has the following parameters [2, Proposition 4]:

 [n,k,d]={[q,1,q−1]if q>2, m=1,otherwise.

Note that

 HRMq(2,m)={(Q(vi))qm−1i=0∣Q∈Q},

where is the set of all quadratic forms from to . The weight distribution of follows easily from Propositions 2.4 and 2.9.

###### Theorem 3.6.

The weight distribution of the second order homogeneous Reed-Muller code is listed in Table 3.3.

###### Remark 3.7.

The weight distribution of has essentially been obtained in [8, Table 6], in which the punctured code of was considered. Thus, the above theorem is not new. We list the weight distribution in Table 3.3, where a few typos in [8, Table 6] are corrected.

###### Example 3.8.

Numerical experiment shows that the second order ternary homogeneous Reed-Muller code has weight enumerator

 1+1560Z36+21060Z48+18800Z54+16848Z60+780Z72,

which is consistent with Table 3.3.

### 3.3 Projective Reed-Muller codes

Another variation of Reed-Muller codes adopts a geometric viewpoint, in which the Reed-Muller codes are regarded as codes defined on an affine space. As a natural projective analogue of Reed-Muller codes, the concept of projective Reed-Muller codes was proposed by Lachaud [3, 4]. Consider an -dimensional vector space over , where is the zero vector. We introduce an equivalence relation among nonzero elements of as follows. For nonzero and in , we define if and only if there exists a nonzero , such that . It is easy to see that this relation is indeed an equivalence relation partitioning all nonzero elements of . Without loss of generality, for each , , assume that and belong to distinct equivalence classes. Thus, is a set of representatives of the equivalence classes in . Let , the -th order -ary projective Reed-Muller code of length is defined as

 {(f(wi))(qm+1−1)/(q−1)i=1∣f∈Phq(r,m+1)},

which is denoted by . When , we know that is identical to the punctured code of , in which the coordinate associated with the zero vector is deleted. When , the second order -ary projective Reed-Muller code has the following parameters [10, Theorem 1]:

 [n,k,d]=[qm+1−1q−1,(m+1)(m+2)2,(q−1)qm