Weighted Hamming metric structures

Weighted Hamming metric structures

Discrete Mathematics 341 (2018) 3174–3181 Contents lists available at ScienceDirect Discrete Mathematics journal homepage: www.elsevier.com/locate/d...

327KB Sizes 0 Downloads 119 Views

Discrete Mathematics 341 (2018) 3174–3181

Contents lists available at ScienceDirect

Discrete Mathematics journal homepage: www.elsevier.com/locate/disc

Weighted Hamming metric structures Bora Moon Department of Mathematics, Postech, 77 Cheongam-Ro, Nam-Gu, Pohang, Gyeongbuk, Republic of Korea

article

info

Article history: Received 4 February 2018 Received in revised form 25 June 2018 Accepted 5 August 2018

Keywords: Perfect code Weighted Hamming metric Weight distribution Hamming code Extended Hamming code

a b s t r a c t It is known that the binary generalized Goppa codes are perfect codes for the weighted Hamming metrics. In this paper, we present the existence of a weighted Hamming metric that admits a binary Hamming code (resp. an extended binary Hamming code) to be perfect code. For a special weighted Hamming metric, we also give some structures of a 2-perfect code, show how to construct a 2-perfect linear code and obtain the weight distribution of a 2-perfect code from the partial information of the code. © 2018 Elsevier B.V. All rights reserved.

1. Introduction There have been attempts to consider coding theory not only for the Hamming metric but also for other metrics [1,3,5,6]. Also, many efforts have been made to construct a good code that can correct errors. Therefore, many types of perfect codes exist [1,3,5,6]. However, many results in coding theory are codes for channels in which the error is consistent with the Hamming metric, but in some channels the distribution of errors among the codeword positions is nonuniform. In addition, nontrivial perfect binary codes are rare for the Hamming metric. The Hamming codes and the Golay codes are the only nontrivial perfect linear codes for the Hamming metric. So S. Bezzateev and N. Shekhunova [1] considered a perfect code for a weighted Hamming metric to apply codes to channels with the distribution of errors which is nonuniform. The authors gave some basic properties of a perfect code for a weighted Hamming metric. Of particular interest is that a binary generalized Goppa code is a perfect code for a certain weighted Hamming metric. Heden [2] studied a generalization of 1-perfect code for the Hamming metric. It is thus natural to study the weight structure that admits a binary Hamming code (resp. an extended binary Hamming code) to be a perfect code and find other perfect codes. In this paper, we study perfect codes in Fn2 equipped with a special metric called weighted Hamming metric. Some perfect codes are known but the information about the codes for a weighted Hamming metric is rare. In Section 2, we show that the ˜m ) is 2-perfect (resp. 2- or 3-perfect) for a particular binary Hamming code Hm (resp. the extended binary Hamming code H weighted Hamming metric. In Section 3, with a particular weighted Hamming metric, we deduce how to construct a linear 2-perfect code and give the properties of a 2-perfect code. In the next, we generalize the concept of a 2-perfect code and present a weight distribution of the code for the metric. Let F2 be a finite field of order two and Fn2 a vector space of binary n-tuples. Definition 1.1 ([1]). Let πi ∈ N be a weight of position i and π = (π1 , . . . , πn ) a weight vector of length n, respectively. The π -weight wπ of a vector x = (x1 , . . . , xn ) of Fn2 is defined by the function

wπ (x) =

n ∑

πi · x i ,

i=1

and the π -distance dπ (x, y) between vectors x and y of Fn2 is defined as dπ (x, y) = wπ (x − y). E-mail address: [email protected]. https://doi.org/10.1016/j.disc.2018.08.006 0012-365X/© 2018 Elsevier B.V. All rights reserved.

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

3175

Lemma 1.2 ([6, Lemma 1.1]). Let π be a weight vector of length n. Then, the π -distance dπ is a metric on Fn2 . For a weight vector π of length n, the π -metric dπ is also called a weighted Hamming metric with weight vector π on Fn2 . In particular, if π is the all-one vector (1, 1, . . . , 1), then the π -weight wπ and π -metric dπ become the Hamming weight wH and the Hamming distance dH in the classical coding theory, respectively. Let x be a vector of Fn2 and r a nonnegative integer. For a given weight vector π of length n, the π -sphere with center x and radius r is defined as the set Sπ (x; r) = {y ∈ Fn2 | dπ (x, y) ≤ r }. Note that Sπ (x; r) ⊆ SH (x; r). Since every 1-perfect code for the Hamming metric is known, we only consider an r-perfect code (r ≥ 2) for a weighted Hamming metric. For a subset C ⊂ Fn2 and a given weight vector π of length n, we call C a π -code of length n. For a π -code C , let the minimum π -distance dπ (C ) of C be the minimum π -distance between distinct codewords of C . We now introduce the definition of perfect code for a weighted Hamming metric and present a sufficient and necessary condition for a given code to be a perfect code. The support of a vector x of Fn2 is the set of nonzero coordinate positions of x, so the size of the support of x is also wH (x). Throughout this paper, we identify a vector x of Fn2 with its support. For vectors x, y1 , . . . , ym of Fn2 , let {y1 , . . . , ym } be a partition of x if the disjoint union of the elements of {y1 , y2 , . . . , ym } is equal to the support of x. For example, we identify x = (1, 0, 0, 1) with a set {1, 4} and have {(1, 0, 0, 0), (0, 0, 0, 1)} as a partition of x. Definition 1.3 ([6]). Let π be a weight vector of length n and C a π -code of length n. We say that a code C is an r-perfect π -code if the disjoint union of the spheres Sπ (c; r) centered at c ∈ C and with radius r is equal to Fn2 . Proposition 1.4 ([6]). Let π be a weight vector of length n and C an [n, k] binary linear π -code. Then, C is an r-perfect π -code if and only if the following two conditions are satisfied: (1) (The sphere packing condition) |Sπ (0; r)| = 2n−k , (2) (The partition condition) for any non-zero codeword c and any partition {x, y} of c, either wπ (x) ≥ r + 1 or wπ (y) ≥ r + 1.

˜m 2. Perfect π -codes Hm and H For the Hamming metric, a binary Hamming code is a 1-perfect code, but an extended binary Hamming code is not a perfect code. In this section, we introduce the weighted Hamming metric for which the binary Hamming code Hm (resp. the ˜m ) becomes a perfect code. We also give an example. extended binary Hamming code H Definition 2.1. Let ˜ Hm (m ≥ 2) be an (m + 1) × 2m binary matrix whose first row is the all-one vector (1, . . . , 1) of length m 2 and the remaining m rows of ˜ Hm form a m × 2m submatrix whose ith column corresponds to the 2-adic representation of i − 1. By deleting the first row and the first column of ˜ Hm , we have an m × (2m − 1) binary matrix Hm . Let Hm be the binary ˜m the extended binary Hamming code of length 2m − 1 with the minimum distance 3 with the parity-check matrix Hm and H Hamming code of length 2m with the minimum distance 4 with the parity-check matrix ˜ Hm for the Hamming metric. Denote the set of coordinates of π -weight i by Si and the size of Si by si for i ∈ N. We identify a weight vector π with the set of Si for i ∈ N. For example, we identify π = (1, 2, 4, 1) with {S1 = {1, 4}, S2 = {2}, S4 = {3}}.

˜m 2.1. 2-perfect π -codes Hm and H In the first part of this subsection, we give a sufficient condition for the existence of a weighted Hamming metric which admits the binary Hamming code Hm to be a 2-perfect code. In the second part, we classify all weight vectors which admit ˜m to be 2-perfect. the extended binary Hamming code H By Proposition 1.4, if the binary Hamming code Hm (m ≥ 2) is a 2-perfect π -code for a given weight vector π , then 2m = |Sπ (0; 2)| = 1 + s1 +

( ) s1 2

+ s2 .

(s )

Thus we have s2 = 2m − (1 + s1 + 21 ). (X ) For a set X and a positive integer r, we denote a set of all r-subset of X by r . We also denote a set of all natural numbers which are less than or equal to n by [n]. Theorem 2.2. For an integer m ≥ 2, there exists a weight vector π of length 2m − 1 which admits the binary Hamming code Hm (m ≥ 2) to be a 2-perfect π -code provided that

( 1+

)

s1 − 1 1

( +

)

s1 − 1 2

( +

)

s1 − 1 3

< 2m ,

where the integer s1 is the size of S1 which is the set of coordinates of π -weight 1.

(1)

3176

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

Proof. By (1) and the proof of the Gilbert–Varshamov Bound [7, p. 33], there exists an s1 -subset S1 of [2m − 1] in which no 4 or fewer elements are linearly dependent with respect to a 2-adic representation. For a given weight vector π of length 2m − 1, suppose that Hm is a( 2-perfect π -code. Proposition 1.4 implies that for (any) ) S S c ∈ Hm and any partition {x, y} of c, wπ (x) ≥ 3 or wπ (y) ≥ 3. Let φ : 21 → [2m − 1] be defined by φ (x) = c − x for x ∈ 21 and c ∈ Hm with Hamming weight 3 containing x. Then, φ must be well-defined and 1–1. Suppose that there exist distinct vectors x and x′ such that y := φ (x) = φ (x′ ). Then x ∪ y = x′ ∪ y ∈ Hm . Thus we have x ∪ x′ ∈ Hm as the code is linear. It contradicts the choice of S1 . (S ) (S ) By Proposition 1.4, ∪i≥3 Si := φ ( 21 ) and S2 = [2m − 1] − (S1 ∪ φ ( 21 )). Thus, we have a weight vector π admitting the binary Hamming code Hm to be a 2-perfect π -code. □ Theorem 2.2 gives a sufficient condition for the existence of a weight vector admitting the binary Hamming code Hm to be 2-perfect. We present an example that shows how to find a weight vector π admitting the binary Hamming code H4 to be a 2-perfect π -code. Example 2.3. Consider the binary Hamming code H4 and the codeword {1, 2, 4, 8, 15} of H4 . Then, the minimum weight of H4 is equal to 3, so we conclude that no 4 or fewer elements from the set S1 = {1, 2, 4, 8, 15} are linearly dependent with respect to a 2-adic representation. Let ∪i≥3 Si = [15] − S1 . Then,

( ) s1 2

+ s1 + 1 = 16,

so we get that the codewords of H4 constitute a 2-perfect π -code.

˜m (m ≥ 2) can be a 2-perfect code for a weighted Hamming Now we discuss whether the extended binary Hamming code H metric and find the weight vector π . ˜m (m ≥ 2) is a Lemma 2.4 ([6, Lemma 3.3]). Let π be a weight vector of length 2m . If the extended binary Hamming code H 2-perfect π -code, then there is no coordinate in {1, 2, . . . , 2m } whose π -weight is bigger than two. ˜m constitute a 2-perfect code for a weighted Hamming metric, then {1, 2, . . . , 2m } = S1 ∪ S2 and thus If the words of H 2m+1 = |Sπ (0; 2)| = 1 + 2m +

( ) s1 2

. √

If s1 = 0, then m must be 0. If s1 = 2k for some k ∈ N, then k =

1+



k=

−1+

2m+3 −7 4

m+3

∈ N. Consequently, 2

2m+3 −7 4

∈ N and if s1 = 2k + 1 for some k ∈ N, then

2

− 7 = (4s ± 1) for some s ∈ N.

Theorem 2.5 ([8], Nagell’s equation). For x, n ∈ N, the equation x2 + 7 = 2n has only solutions given by x = 1, 3, 5, 11, and 181 corresponding to n = 3, 4, 5, 7, and 15, respectively. The solutions of Nagell’s equation yield the following values. (4s ± 1)

m+3

s

m

s1

1 3 5 11 181

3 4 5 7 15

0 1 1 3 45

0 1 2 4 12

1 2 3 6 91

(i) When m = 0, C = {0} with S1 = {1} or S2 = {1}. When m = 1, C = {00} with S1 = {1, 2} and S2 = ∅. ˜2 = {0000, 1111} with S1 = {i, j, k}, S2 = {l} where {i, j, k, l} = {1, 2, 3, 4}. (ii) When m = 2, H ˜4 to be a 2-perfect π -code. First, we need (iii) When m = 4 (s1 = 6, s2 = 10), there exists a weight vector π that admits H ˜4 . to show that S1 must be in H ˜4 be a 2-perfect π -code for a given Assume that S1 = {α, β, γ , δ, ϵ, η} and let the extended binary Hamming code H weight vector π of length 24 . Let X be a maximal set among the sets of 3-subsets of S1 in which any two 3-subsets always intersect.

˜4 . Define Φ : X → S2 where A ∈ X , A ∪ Φ (A) ∈ H

(2)

To be 2-perfect, Φ must be well-defined and bijective. ˜4 , |B| ≤ 4 and 0 ≤ wπ (B) ≤ 4. Suppose there exist A and A′ such that Φ (A) = Φ (A′ ). Then B := (A \ A′ ) ∪ (A′ \ A) ∈ H This implies that A = A′ . Let X and X ′ be maximal sets with {α, β, γ } ∈ X and {δ, ϵ, η} ∈ X ′ as above. Let Φ1 and Φ2 be maps defined on X and X ′ , respectively as in (2).

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

3177

Put z1 := Φ1 ({α, β, γ }) and z2 := Φ2 ({δ, ϵ, η}). If z1 ̸ = z2 , then there exists ˜ A ∈ X ′ such that {α, β, γ } ∩ ˜ A ̸ = ∅ and ˜ ˜ ˜ ˜ Φ2 (A) = z1 . So {α, β, γ , z1 } and {z1 } ∪ A are in H4 . Then, there exists c ∈ H4 with 0 ≤ wπ (c) ≤ 4. Hence, z1 = z2 and ˜4 . this result implies that S1 ∈ H ˜4 as S1 and set S2 = {1, 2, . . . , 16}−S1 . They give a desired weight vector. Take a 6-element codeword of H ˜12 cannot be a 2-perfect π -code for any weight vector π of length 212 . (iv) When m = 12 (s1 = 91, s2 = 4005), H ˜12 is a 2-perfect π -code for a given weight vector π . For a ∈ S1 , let Ta be a set of all 2-subsets of S1 −{a}. Suppose that H Define a map τa : Ta → S2 in the following way:

˜12 . For {α, β} ∈ Ta , {a, α, β, τa ({α, β})} ∈ H Then, the map τa is well-defined and bijective. Suppose that there exist {α, β} and {α ′ , β ′ } ∈ Ta such that y := ˜12 but there is a codeword c ∈ H ˜12 such that 0 ≤ wπ (c) ≤ τa ({α, β}) = τa ({α ′ , β ′ }). Then, {a, α, β, y}, {a, α ′ , β ′ , y} ∈ H 4. This result implies that {α, β} ={α ′ , β ′ }. Thus, the map τa is 1–1 and also onto as |Ta | = |S2 | = 4005. ˜12 . Fix y ∈ S2 and choose a1 ∈ S1 . Then, by the map τa1 , there exist a2 , a3 ∈ X −{a1 } such that {a1 , a2 , a3 , y} ∈ H ˜12 . Choose a4 ∈ S1 −{ai }3i=1 . Then, by the map τa4 , there exist a5 , a6 ∈ S1 −{ai }4i=1 such that {a4 , a5 , a6 , y} ∈ H Continuing this procedure yields a1 , a2 , . . . , a90 . All ai are distinct and s1 = 91. For a91 ∈ S1 \ {ai }90 i=1 ̸ = ∅, the preimage ˜ τa−911 (y) is contained in {ai }90 i=1 . There must exist a nonzero codeword c ∈ H12 with dπ (c) ≤ 4. This is a contradiction. Thus we have proved the following theorem:

˜m (m ≥ 2) becomes a 2-perfect π -code for the weighted Hamming metric if Theorem 2.6. The extended binary Hamming code H and only if m ∈ {2, 4}. It is known that any binary linear code C with the parameters of a binary Hamming code is equivalent to a binary Hamming code for the Hamming metric. Definition 2.7. Let π and π ′ be weight vectors of length n. For a linear π -code C and a linear π ′ -code C ′ , we say that the π -code C is equivalent to the π ′ -code C ′ if the following two conditions are satisfied: (i) |C | = |C ′ |, (ii) There exists σ ∈ Sn such that π ′ = (πσ (1) , πσ (2) , . . . , πσ (n) ) and for all c = (c1 , c2 , . . . , cn ) ∈ C , cσ = (cσ (1) , cσ (2) , . . . , cσ (n) ) ∈ C ′ where Sn is the group of permutations on [n].

˜m (m = 2, 4), which is 2-perfect for the weighted Hamming metric, is unique Thus the extended binary Hamming code H up to equivalence by the proof of Theorem 2.6. ˜m 2.2. 3-perfect π -code H ˜m (m ≥ 2) to be In this subsection, we classify all weight vectors which admit the extended binary Hamming code H 3-perfect. ˜m is 3-perfect. Let M3 = For a given weighted Hamming metric, suppose that the extended binary Hamming code H {x ⊂ {1, 2, . . . , 2m } | x is a 3-subset with wπ (x) = 3}. Following similar argument in [5, Proposition 2], we can deduce the following theorem. ˜m (m ≥ 2) be a 3-perfect π -code. Theorem 2.8. For a given weight vector π of length 2m , let the extended binary Hamming code H Then there is a bijection from M3 to Y := ∪i≥4 Si . ˜m 3-perfect. Now we can make the extended binary Hamming code H ˜m (m ≥ 2) to be a Theorem 2.9. There exists a weight vector π of length 2m that admits the extended binary Hamming code H 3-perfect π -code if and only if s1 ∈ {1, 2, 3}. Furthermore we have that (i) If s1 = 1, then sk = 0 for k ≥ 3, and for i with i ∈ [2m ], S1 = {i} and S2 = [2m ] − S1 . (ii) If s1 = 2, then s2 = s3 = 2m−1 − 1. (iii) If s1 = 3, then m = 2 and s2 = s3 = 0, and S1 = {i, j, k}, Y = {l} where {i, j, k, l} = {1, 2, 3, 4}. In each of the these cases, and for each m, the 3-perfect code for the weighted Hamming metric is unique up to equivalence. Proof. By Proposition 1.4 and Theorem 2.8, 2m = s1 + s2 + s3 +

( ) s1 3

and 2m+1 = |Sπ (0; 3)| = 1 + s1 + s2 +

( ) s1 2

( ) + s3 +

s1 3

+ s1 s2 ,

3178

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

so 2m = 1 +

1

2

( ) 1+

+ s1 s2 . Note that ( ) s1 + s1 + s2 + s3 = 2m . + s1 s2 =

(s )

s1 2

(3)

3

(i) If s1 = 1, then s2 = 2m − 1 and sk = 0 for k ≥ 3. Then, for every i ∈ {1, 2, . . . , 2m }, with S1 = {i} and ˜m is a 3-perfect π -code. S2 = {1, 2, . . . , 2m } − {i}, H (ii) If s1 = 2, then s2 = s3 = 2m−1 − 1 and sk = 0 for k ≥ 4. For α, β ∈ {1, 2, . . . , 2m }, set S1 = {α, β}. For a codeword ˜m , set x ∈ S2 and y ∈ S3 . They make H ˜m a 3-perfect π -code. {α, β, x, y} ∈ H ˜m . There are (iii) When s1 = 3, arbitrarily take S1 = {α, β, γ }. Then we must have Y = {δ} where {α, β, γ , δ} ∈ H 2m−1 − 2 codewords of Hamming weight 4 containing α, β except {α, β, γ , δ}. Let the set of these codewords be denoted by D = {{α, β, νi , ηi } | i ∈ [2m−1 − 2]}. For i ∈ [2m−1 − 2], we may assume that S2 = {ν1 , . . . , νs2 } and S3 = ˜m . But ζi ̸∈ {η1 , η2 , . . . , ηs2 } for {η1 , . . . , η2m−1 −2 } ∪ {νs2 +1 , . . . , ν2m−1 −2 }. For νi ∈ S2 , i ∈ [s2 ], there is {α, γ , νi , ζi } in H ˜m . But ξi ̸∈ {η1 , η2 , . . . , ηs2 }∪{ζ1 , ζ2 , . . . , ζs2 } all i ∈ [s2 ] by Proposition 1.4. For νi ∈ S2 , i ∈ [s2 ], there is {β, γ , νi , ξi } in H for all i = 1, 2, . . . , s2 by Proposition 1.4, so S3 = {η1 , η2 , . . . , ηs2 } ∪ {ζ1 , ζ2 , . . . , ζs2 } ∪ {ξ1 , ξ2 , . . . , ξs2 } ∪ S3′ for some subset S3′ of S3 . We have s3 ≥ 3s2 . Using this inequality and (3) yields m = 2, s1 = 3, s2 = s3 = 0 and |Y | = 1. Taking ˜2 . S1 = {i, j, k}, Y = {l} where {i, j, k, l} = {1, 2, 3, 4} yields a 3-perfect π -code H (iv) When s1 (≥ )4, take S1 =( {α, β , β , . . . , β } . Similar procedures as above yield s3 ≥ (s1 − 1)s2 . From (3), we deduce 1 2 s − 1 1 ) s s that 1 + 21 + s1 s2 ≥ 31 + s1 + s2 + (s1 − 1)s2 . Then, s1 ≤ 1 or 2 ≤ s1 ≤ 3, so s1 ≥ 4 is impossible. □ 3. Binary 2-perfect π -codes In this section, we consider a particular weight vector. We show how to construct a linear 2-perfect code, and give the properties of a 2-perfect π -code, and obtain the weight distribution of a 2-perfect code from the partial information of the code for the weighted Hamming metric. Consider the vector space Fn2 of n-tuples over a finite field F2 . Let m be an integer with 1 ≤ m ≤ n − 1 and fix a weight vector π = (π1 , . . . , πn ) with

πi =

1, 2,

{

if 1 ≤ i ≤ m otherwise.

3.1. Construction of a binary 2-perfect linear π -code Now, we construct a 2-perfect linear π -code. Let n be a length of a 2-perfect π -code. It must hold that 1 + n + 2 = 2t for some positive integer t. (m) (m) For positive integers t and m with 2t − 1 − m − 2 > 0, let H be the family of all t × (2t − 1 − 2 ) matrices H having the following properties:

(m)

(i) The matrix H contains only nonzero column vectors without duplicate vectors. (ii) The sum of any two distinct columns among the first m columns do not appear in the last n − m columns. (iii) The sum of any two or three distinct columns among the first m columns do not appear in the first m columns. Theorem 3.1. Let H be a parity-check matrix of a 2-perfect linear π -code. Then H belongs to H. Furthermore, every code having H ∈ H as a parity-check matrix is a 2-perfect linear π -code. Proof. The second condition of Proposition 1.4 is equivalent with that the minimum π -distance of a code is greater than or equal to 2r + 1. By the properties of a matrix H ∈ H, the minimum π -distance is greater than or equal to 5. This proves the theorem. □ Example 3.2. For m = 2 and t = 3, consider the parity-check matrix

[ H=

1 0 0

0 1 0

0 0 1

1 0 1

0 1 1

1 1 . 1

]

Then the matrix H has no repeated column and the sum of the first two columns does not appear in the last four columns. Thus, C = {000000, 001111, 101100, 100011, 011010, 010101, 111001, 110110} is a 2-perfect linear π -code where π = (1, 1, 2, 2, 2, 2). Remark 3.3. Note that the last n − m columns of a matrix H which is considered in Theorem 3.1 cannot contain zero vector, one of the first(m)columns and the sum of any two distinct columns of the first m columns. The number of such vectors is m 2t − 1 − m − 2 = n − m. If the first m columns of the matrix H satisfying the conditions (i) and (iii) of Theorem 3.1 are decided, then the last n − m columns of the matrix H are completely determined.

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

3179

3.2. Properties of a binary 2-perfect π -code We consider a generalization of a result of Heden [2] and the weight distribution of a 2-perfect π -code. Heden [2] considered a group algebra R[x1 , x2 , . . . , xn ] whose elements are polynomials r(x1 , . . . , xn ) =

v

rv x11 · · · xvnn for rv ∈ R and v = (v1 , . . . , vn ) ∈ Fn2 ,

∑ v∈Fn2

with the addition and the multiplication of polynomials in the usual way. We may also consider R[x1 , x2 , . . . , xn ] as a vector space with dimension 2n over a real number R. A code C ⊂ Fn2 , which is not necessarily linear, can be represented by a polynomial C (x1 , x2 , . . . , xn ) =



c

x11 · · · xcnn .

c∈C

The polynomials in the set

{ yt (x1 , x2 , . . . , xn ) =

n 1 ∏

2n

} ti

(1 − xi ) (1 + xi )

1−ti

|t∈

Fn2

i=1

constitute a basis of the vector space R[x1 , x2 , . . . , xn ] by [2, Lemma 1]. Furthermore, from [2, Lemma 1] we adopt that C (x1 , . . . , xn ) =



Ad yd (x1 , x2 , . . . , xn )

d∈Fn2 c·d where Ad = . c∈C (−1) We introduce a weighted 2-perfect π -code with respect to the weighted Hamming metric dπ .



Definition 3.4. We say that a function f : Fn2 → R is a weighted 2-perfect π -code if



f (y) = 1 for all x ∈ Fn2 .

y∈Sπ (x;2)

This definition means that for all x ∈ Fn2 , a weighted 2-perfect π -code f contributes 1 on the π -sphere with center x and radius 2. A weighted 2-perfect π -code is a generalized version of a weighted 1-perfect code for the Hamming metric. For a given weighted 2-perfect π -code f , a polynomial f (x1 , . . . , xn ) can be viewed as f (x1 , . . . , xn ) =



t

f (t)x11 · · · xtnn ,

t∈Fn2

where f (t) is the function from Fn2 to R. Let u be the vector of length n with 1, 0,

{ ui =

if 1 ≤ i ≤ m otherwise.

Proposition 3.5. The following statements are equivalent: (i) A function f is a weighted 2-perfect π -code. (ii) f (x1 , . . . , xn ) = A0 y0 (x1 , . . . , xn ) +

m ∑ ∑

Ad yd (x1 , . . . , xn )

k=0 d∈Dk

where A0 =

2n

|Sπ (0;2)|

and Dk = {v ∈ Fn2 : |v ∩ u| = k, |v| =

|Sπ (x;2)| 2

Proof. Let f be a weighted 2-perfect π -code and f (x1 , . . . , xn ) = vector d,

− k(m − k)} for k = 0, . . . , m.



d∈Fn2 Ad yd (x1

Ad ̸ = 0 implies d ∈ ∪m k=0 Dk .

(4)

Note that

⎛ ∑ t∈Fn2

t x11

...

xtnn

=⎝

⎞ ⎛ ∑

d∈Fn2

, . . . , xn ). We first show that for a nonzero

Ad yd (x1 , . . . , xn )⎠ · ⎝1 +

n ∑ i=1

⎞ xi +

∑ 1≤i
xi xj ⎠ .

3180

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

As xi xi = 1, we have that xi (1 − xi ) = −(1 − xi ) and xi (1 + xi ) = (1 + xi ). Comparison of coefficients on both sides yields that for every nonzero d, 0 = Ad {1 + n − 2|d| + k = |d ∩ u|. Thus (4) is true. Now, let f (x1 , . . . , xn ) = A0 y0 (x1 , . . . , xn ) +

m ∑ ∑

(m) 2

− 2k(m − k)} where

Ad yd (x1 , . . . , xn )

k=0 d∈Dk n

with A0 = |S 2(0;2)| . π Comparison of coefficients yields that for v ∈ Fn2 , f (v) =

A0 2n

+

m ∑ ∑ (−1)d·v k=0 d∈Dk

We need to check that We have



(

y∈Sπ (x;2)

because



A0 2n



2n

y∈Sπ (x;2) f (y)

m ∑ ∑ (−1)d·y

+

k=0 d∈Dk

y∈Sπ (x;2) (

Ad .

2n

= 1 for all x ∈ Fn2 .

Ad ) = 1

−1)d·y = 0. Thus the function f is a weighted 2-perfect π -code. □

Definition 3.6. Let f be a weighted 2-perfect π -code. A vector p is called a period of a weighted 2-perfect π -code f if f (v + p) = f (v) for all v ∈ Fn2 . Every 1-perfect code has an all-one vector (1, . . . , 1) as a period for the Hamming metric. We get a generalization of a result of a 1-perfect code for the Hamming metric. The following corollary shows that every 2-perfect π -code also has at least one period. By applying [2, Proposition 2], we have the following corollary. Corollary 3.7. Let C ⊂ Fn2 be a 2-perfect π -code. Then, p + c ∈ C for all c ∈ C if p = (p1 , . . . , pn ) ∈ Fn2 has the following properties: (1) If m is odd, pi = 1 for 1 ≤ i ≤ n. (2) If m is even,

{ pi =

0, 1,

if i ≤ m otherwise.

⊥ Proof. It follows from p ∈ ⟨∪m k=0 Dk ⟩ that the vector p is a period of a 2-perfect π -code. □

For a π -code C of length n and a vector v of Fn2 , let C |v be the set of codewords of C which are contained in the vector v. We ¯ | = j by ai,j for 0 ≤ i ≤ m, 0 ≤ j ≤ n − m where denote the number of codewords c of a π -code C with |c ∩ u| = i and |c ∩ u ¯ is the complement of u. The N-tuples (a0,0 , . . . , a0,n−m , a1,0 , . . . , a1,n−m , . . . , am,0 , . . . , am,n−m ) is called the π -weight u distribution of π -code C where N = (m + 1) · (n − m + 1). The next theorem says that we can get the all values ai,j from ai,0 for i = 0, 1, . . . , m. Theorem 3.8. Let C be a 2-perfect π -code of length n. If we have the π -weight distribution of C |u , then we have the π -weight distributions of Cu¯ and C . Proof. By [4, Lemma 2.1], n ∑∏ c∈C i=1

c

xi i =

n ∏ 1 ∑∑ v·c ( − 1) (1 − xi )vi (1 + xi )1−vi . 2n n v∈F2 c∈C

i=1

It should be mentioned that it is different from that of [2] because this identity is not an element in the group algebra.

B. Moon / Discrete Mathematics 341 (2018) 3174–3181

3181

Put xi = x for i ∈ u and xi = y2 for i ∈ [n] − u. Then, m n−m ∑ ∑

ai,j xi y2j =

i=0 j=0

|C | 2n

(1 + x)m (1 + y2 )n−m +

m 1 ∑∑

2n

Ad (1 − x)k

k=0 d∈Dk

× (1 + x)m−k (1 − y2 )g(k) (1 + y2 )n−m−g(k) , where g(k) = 2t −1 − k(m − k + 1) by the proof of Proposition 3.5. If y = 0, then we get the equality xwπ (c) =

∑ c∈C |u

m ∑

ai , 0 x i =

|C |

i=0

2n

(1 + x)m +

m 1 ∑∑

2n

Ad (1 − x)k (1 + x)m−k .

(5)

k=0 d∈Dk

If x = 0, then we get the equality ywπ (c) =

∑ c∈C |u¯

n−m ∑

a0,j y2j =

j=0

|C | 2n

2 n−m−g(k)

× (1 + y )

(1 + y2 )n−m +

m 1 ∑∑

2n

Ad (1 − y2 )g(k)

k=0 d∈Dk

(6)

.

If y = x, then we get the equality



xwπ (c) =

c∈C

+

|C | 2n

(1 + x)m (1 + x2 )n−m

m 1 ∑∑

2n

(7) Ad (1 − x)k (1 + x)m−k (1 − x2 )g(k) (1 + x2 )n−m−g(k) .

k=0 d∈Dk

It is easy to see that the set of polynomials {(1 − x)k (1 + x)m−k : k = 0, 1, 2, . . . , m} constitutes a basis for the∑ (m + 1)dimensional vector space of polynomials in x of degree less than or equal to m. Consequently, the real numbers d∈Dk Ad , for k = 0, 1, . . . , m, are uniquely determined by the values of ai,0 for i = 0, . . . , m. The proof follows from Eqs. (5)–(7). □ Remark 3.9. In conclusion, we note that a perfect code for a weighted Hamming metric has similar properties of a perfect code for the Hamming metric. We expect that there may be other similar properties. For example, the reconstruction of 2-perfect codes might be possible as in [2]. Acknowledgments The author would like to express deepest gratitude to Prof. Hyun Kwang Kim for his comments. The author is also extremely grateful to the anonymous referees for their careful reading and valuable comments. References [1] S. Bezzateev, N. Shekhunova, Class of binary generalized goppa codes perfect in weighted hamming metric, Des. Codes Cryptogr. 66 (1–3) (2013) 391–399. [2] O. Heden, On the reconstruction of perfect codes, Discrete Math. 256 (2002) 479–485. [3] P. Horak, On perfect Lee codes, Discrete Math. 309 (2000) 5551–5561. [4] J.Y. Hyun, Generalized MacWilliams identities and their applications to perfect binary codes, Des. Codes Cryptogr. 50 (2) (2009) 173–185. [5] J.Y. Hyun, H.K. Kim, The poset structures admitting the extended binary Hamming code to be a perfect code, Discrete Math. 288 (2004) 37–47. [6] J.Y. Hyun, H.K. Kim, J.R. Park, The weighted poset metrics and directed graph metrics, 2017, arXiv:1703.00139. [7] F.J. MacWilliams, N.J.A. Sloane, The Theory of Error-Correcting Codes, vol. 16, first ed., North Holland, Amsterdam, 1983. [8] T. Nagell, The Diophantine equation x2 + 7 = 2n , Ark. Mat. 4 (2–3) (1961) 185–187.