On the variance of average distance of subsets in the Hamming space

On the variance of average distance of subsets in the Hamming space

Discrete Applied Mathematics 145 (2005) 465 – 478 www.elsevier.com/locate/dam On the variance of average distance of subsets in the Hamming space Fan...

215KB Sizes 0 Downloads 41 Views

Discrete Applied Mathematics 145 (2005) 465 – 478 www.elsevier.com/locate/dam

On the variance of average distance of subsets in the Hamming space Fang-Wei Fua,1 , San Lingb , Chaoping Xingb a Temasek Laboratories, National University of Singapore, 5 Sports Drive 2, Singapore 117508, Singapore b Department of Mathematics, National University of Singapore, 2 Science Drive 2, Singapore 117543, Singapore

Received 13 September 2002; received in revised form 23 August 2004; accepted 31 August 2004

Abstract Let V be a finite set with q distinct elements. For a subset C of V n , denote var(C) the variance of the average Hamming distance of C. Let T (n, M; q) and R(n, M; q) denote the minimum and maximum variance of the average Hamming distance of subsets of V n with cardinality M, respectively. In this paper, we study T (n, M; q) and R(n, M; q) for general q. Using methods from coding theory, we derive upper and lower bounds on var(C), which generalize and unify the bounds for the case q = 2. These bounds enable us to determine the exact value for T (n, M; q) and R(n, M; q) in several cases. © 2004 Elsevier B.V. All rights reserved. Keywords: Hamming space; Subsets; Average distance; Variance; Codes; Distance distribution

1. Introduction Let V = {v1 , v2 , . . . , vq } be a finite set with q distinct elements, where q is a positive integer. Let V n be the set of ordered n-tuples over V. The Hamming distance between two vectors a and b is the number of components where they differ, and is denoted by dH (a, b). Let C be a subset of V n with size |C| = M. The average Hamming distance of C is defined by 1   ¯ dH (a, b). d(C) = 2 M

(1.1)

a∈C b∈C

The variance of the average distance of C is defined by var(C) =

1   2. ¯ [dH (a, b) − d(C)] M2

(1.2)

a∈C b∈C

It is easy to check that var(C) =

1   2. ¯ [dH (a, b)]2 − [d(C)] M2 a∈C b∈C

1 On leave from the Department of Mathematics, Nankai University, Tianjin 300071, P. R. China. E-mail addresses: [email protected] (F.-W. Fu), [email protected] (S. Ling), [email protected] (C. Xing).

0166-218X/$ - see front matter © 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.dam.2004.08.004

(1.3)

466

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

The minimum and maximum average Hamming distance of a subset of V n with size M are defined by ¯ (n, M; q) = min{d(C)| C is a subset of V n with size |C| = M}, ¯ (n, M; q) = max{d(C)| C is a subset of V n with size |C| = M}. The minimum and maximum variance of the average distance of a subset of V n with size M are defined by T (n, M; q) = min{var(C)| C is a subset of V n with size |C| = M}, R(n, M; q) = max{var(C)| C is a subset of V n with size |C| = M}. Ahlswede and Katona [2] first posed the problem of determining (n, M; q) on the extremal combinatorics of Hamming space. There are a number of papers (see [1–4,8–13,15,16]) dealing with this topic thereafter, and some exact values of (n, M; q) are determined. It is still an open problem to determine (n, M; q) for general n, q and 1  M  q n . Ahlswede and Althöfer [1] observed that this problem also occurs in the construction of good codes for write-efficient memories, introduced by Ahlswede and Zhang [3] as a model for storing and updating information on a rewritable medium with cost constraints. Kündgen [12] observed that this problem is equivalent to a covering problem in graph theory. Ahlswede and Katona [2] first mentioned the problem of determining (n, M; q) for q = 2 and gave a simple solution. Fu and Xing [11] gave a complete solution for the problem of determining (n, M; q) for general q. Since the variance is an important digital characteristic for the average distance, Fu and Shen [9] first posed the problem of determining T (n, M; 2). For a subset C of {0, 1}n , Fu and Shen [9] presented a lower bound and an upper bound on var(C). Moreover, they determined the exact value of T (n, 2n−1 ; 2). If the size |C| is odd, Xia and Fu [15] improved the lower and upper bounds of Fu and Shen on var(C). Furthermore, they determined the exact values of T (n, 2n − 1; 2) and T (n, 2n−1 ± 1; 2). In this paper, we study T (n, M; q) and R(n, M; q) for general q. Using methods from coding theory, we derive upper and lower bounds on var(C), which generalize and unify the bounds for the case q = 2. These bounds enable us to determine the exact value for T (n, M; q) and R(n, M; q) in several cases. Without loss of generality, below we assume that V = Zq = {0, 1, . . . , q − 1}, the abelian group under addition modulo q, since we only deal with the Hamming distance in the Hamming space V n . Furthermore, if q is a prime power, we can assume that V = Fq , the finite field of q elements. The Hamming weight wH (a) of a vector a in Znq or Fqn is the number of nonzero coordinates in a. Obviously, for a, b ∈ Znq or Fqn , dH (a, b) = wH (a − b). If q is a prime power, denote  = {(c1 , c2 , c3 , . . . , cn ) | ci ∈ Fq and c1 + c2 = 0}, +  =  ∪ {(0, 1, 0, . . . , 0)}, − = \{(0, 0, 0, . . . , 0)}. If q is a positive integer and q  2, denote × {0},  = Zn−1 q

+ =  ∪ {(0, . . . , 0, 1)},

− = \{(0, . . . , 0, 0)}.

Our main results in this paper are given as follows. Theorem 1. For 2  q  4, we have R(n, q n−1 ; q) = var(), R(n, q n−1 + 1; q) = var(+ ), R(n, q n−1 − 1; q) = var(− ).

(1.4) (1.5) (1.6)

Theorem 2. If q  2, we have T (n, q n−1 ; q) = var(), T (n, q n−1 − 1; q) = var(− ).

(1.7) (1.8)

If n  3 or 2  q  4, we have T (n, q n−1 + 1; q) = var(+ ).

(1.9)

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

467

The exact values of var(), var(+ ), var(− ), var(), var(+ ) and var(− ) will be computed in Section 3. It seems to be difficult to determine T (n, M; q) and R(n, M; q) in general. In particular, it is interesting to know whether Theorem 1 is still true for q being a prime power and q  5. This paper is organized as follows. In Section 2, in order to establish our results, we review some basic properties of distance distributions of codes. In Section 3, we compute var(C) for some subsets. In Section 4, we derive an upper bound on var(C) for 2  q  4. Theorem 1 is proved by showing that this upper bound is tight for some cases. In Section 5, we derive a lower bound on var(C) for general q. Theorem 2 is proved by showing that this lower bound is tight for some cases. 2. Preliminaries In this section, we review some basic properties of distance distributions of codes. For a subset C of V n with size |C| = M, we call C an (n, M; q) code in coding theory. The distance distribution of C is defined by Ai =

1 |{(a, b)| a, b ∈ C, dH (a, b) = i}|, M

i = 0, 1, . . . , n.

(2.1)

The dual distance distribution of C is defined by Bk =

n 1  Kk (j ; q)Aj , M

k = 0, 1, . . . , n,

(2.2)

j =0

where Kk (j ; q) are the q-ary Krawtchouk numbers defined by Kk (j ; q) =

k 

(−1)i (q − 1)k−i

i=0

   j n−j . i k−i

(2.3)

The distance enumerator of C is defined as WC (x) =

n  i=0

Ai x i

and the dual distance enumerator of C is defined as Wˆ C (x) =

n  i=0

Bi x i .

The MacWilliams–Delsarte identity (see [14]) gives the relationship between WC (x) and Wˆ C (x):   1 1−x , Wˆ C (x) = [1 + (q − 1)x]n WC M 1 + (q − 1)x   M 1−x WC (x) = n [1 + (q − 1)x]n Wˆ C . q 1 + (q − 1)x

(2.4) (2.5)

It is easy to see that WC (0) = A0 = 1,

WC (1) =

n  i=0

Ai = M.

(2.6)

By (1.1) and (1.3), the average Hamming distance of C is given by n 1  ¯ d(C) = iAi M

(2.7)

i=1

¯ and the variance of d(C) is given by var(C) =

n 1  2 2. ¯ i Ai − [d(C)] M i=1

(2.8)

468

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

Delsarte (see [6,7]) showed that Bk  0,

k = 0, 1, . . . , n.

(2.9)

Let x = 0 and 1 in (2.4), respectively, we obtain by (2.6) that Lemma 1. n 

qn . M

(2.10)

n(q − 1) B1 ¯ d(C) = − , q q

(2.11)

B0 = 1,

i=0

Bi =

Lemma 2.

var(C) =

n(q − 1) (q − 2) 1 2 + B1 − 2 (B1 )2 + 2 B2 . 2 2 q q q q

(2.12)

Proof. Eq. (2.11) is obtained by differentiating (2.5), putting x = 1 and combining with (2.7). Eq. (2.12) is obtained by differentiating (2.5) twice, putting x = 1 and using (2.8) and (2.11).  Ashikhmin and Simonis [5] showed that Lemma 3. Let C be an (n, M; q) code. The dual distance distribution of C is given by B0 , B1 , . . . , Bn . If M ≡  (mod q), then n 1 Bk  2 (q − )(q − 1)k−1 , k = 1, 2, . . . , n. (2.13) k M If q is a prime power and V = Fq , the finite field with q elements, linear codes over Fq can be introduced. A q-ary code C is called a q-ary [n, k] linear code if C is a k-dimensional subspace of Fqn . For two vectors a = (a1 , a2 , . . . , an ) ∈ Fqn ,

b = (b1 , b2 , . . . , bn ) ∈ Fqn ,

the scalar product of a and b is defined as a · b = a1 b1 + a2 b2 + · · · + an bn . Let C be a q-ary [n, k] linear code. The set C ⊥ = {x ∈ Fqn : x · c = 0 for all c ∈ C} is called the dual code of C. Let Ai be the number of codewords in C of Hamming weight i. The sequence of numbers A0 , A1 , . . . , An is called the weight distribution of C. It is well known in coding theory that for a linear code C, the distance distribution of C is equal to the weight distribution of C, and the dual distance distribution of C is equal to the weight distribution ¯ of the dual code C ⊥ . By using these facts and Lemma 2, sometimes it is more convenient for us to compute d(C) and var(C) if C is a linear code. 3. Computation of var(C) for some subsets  In this section, we compute var(C) for some subsets. In general, we cannot find a formula to compute var(C {v}) from var(C) or vice versa, but in some cases we can use (1.1), (1.3), and the following proposition to compute var(C {v}) from var(C). Proposition 1. Let C be a nonempty subset of Znq and v ∈ Znq \C. Then      dH (a, b) = dH (a, b) + 2 wH (a − v), a∈C



{v} b∈C

 {v}

a∈C b∈C

a∈C

(3.1)

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

 a∈C

 



469



2 (a, b) = 2 (a, b) + 2 2 (a − v). dH dH wH  a∈C b∈C a∈C {v} b∈C {v}

(3.2)



In this section, we will use the following results: 

wH (b) =

b∈Zm q

 b∈Zm q

m 

 j

j =0 2 (b) = wH

m 

 m (q − 1)j = m(q − 1)q m−1 , j

 j2

j =0

(3.3)

 m (q − 1)j = m(q − 1)[1 + m(q − 1)]q m−2 . j

(3.4)

Firstly, we obtain the following results by using Proposition 1. Proposition 2. For any v ∈ Znq , denote C = Znq \{v}. Then (q − 1)n (q − 1)n ¯ d(C) = − , q q(q n − 1)2 var(C) =

(3.5)

(q − 1)n (q − 1)n[(q − 1)n − 1] (q − 1)2 n2 + − . 2 2 2 n q q (q − 1) q 2 (q n − 1)4

(3.6)

In particular, we obtain T (n, q n − 1; q) = R(n, q n − 1; q) =

(q − 1)n (q − 1)n[(q − 1)n − 1] (q − 1)2 n2 + − . 2 2 2 n q q (q − 1) q 2 (q n − 1)4

Proof. By (3.3) and (3.4), we have     dH (a, b) = wH (b − a) a∈Znq b∈Znq

a∈Znq b∈Znq

= qn



wH (x) = n(q − 1)q 2n−1 ,

(3.7)

2 (x) = n(q − 1)[1 + n(q − 1)]q 2(n−1) . wH

(3.8)

x∈Znq

  a∈Znq b∈Znq

2 (a, b) = q n dH

 x∈Znq

Note that C = Znq \{v}. By (3.3) and (3.4), we have 

wH (a − v) =

wH (b) =

b∈Znq \{0}

a∈C





2 (a − v) = wH

a∈C

 b∈Znq \{0}



wH (b) = n(q − 1)q n−1 ,

(3.9)

b∈Znq 2 (b) = wH

 b∈Znq

2 (b) = n(q − 1)[1 + n(q − 1)]q n−2 . wH

Hence, by Proposition 1 and (3.7)–(3.10), we have    n(q − 1)  n (q − 1)2 − 1 , dH (a, b) = q a∈C b∈C   2 (a, b) = n(q − 1)[1 + n(q − 1)]q n−2 (q n − 2). dH

(3.10)

(3.11) (3.12)

a∈C b∈C

¯ can also be written as Note that |C| = q n − 1, we obtain (3.5) from (1.1) and (3.11). It is easy to see from (3.5) that d(C) (q − 1)nq n (q n − 2) ¯ . d(C) = q(q n − 1)2

(3.13)

470

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

Hence, by (1.3), (3.12) and (3.13), var(C) = =

1

 

(q n − 1)2

a∈C b∈C

2 ¯ [dH (a, b)]2 − [d(C)]

n(q − 1)[1 + n(q − 1)]q n−2 (q n − 2)



(q − 1)2 n2 q 2n (q n − 2)2

(q n − 1)2

n (q − 1)n[(q − 1)2 − 1] (q − 1)n = 1 + q 2 (q n − 1)2 (q n − 1)2 =

q 2 (q n − 1)4

(q − 1)2 n2 (q − 1)n (q − 1)n[(q − 1)n − 1] + − . 2 2 2 n q q (q − 1) q 2 (q n − 1)4

This completes the proof.



Secondly, we compute var(C) if C = , + , − , , + , − that are defined in Section 1. Proposition 3. Let , + , − , , + and − be the sets defined in Section 1. Then (q − 1)(n + 2) , q2 (q − 1)(n + 2) 4q n + (q − 1)(n + 2) − (q − 1)2 n2 (q − 1)2 n2 − − , var(+ ) = 2 2 2 n−1 2 q q (q + 1) q (q n−1 + 1)4 (q − 1)(n + 2) (q − 1)2 n2 − (q − 1)(n + 2) (q − 1)2 n2 var(− ) = + − , q2 q 2 (q n−1 − 1)2 q 2 (q n−1 − 1)4 (q − 1)(n − 1) , var() = q2 (q − 1)(n − 1) 2q n+1 + (q − 1)(n − 1)[(q − 1)(n − 1) − 1] + var(+ ) = q2 q 2 (q n−1 + 1)2 var() =



[2q n − (q − 1)(n − 1)]2

, q 2 (q n−1 + 1)4 (q − 1)(n − 1) (q − 1)(n − 1)[(q − 1)(n − 1) − 1] (q − 1)2 (n − 1)2 var(− ) = + − . q2 q 2 (q n−1 − 1)2 q 2 (q n−1 − 1)4

(3.14) (3.15) (3.16) (3.17)

(3.18) (3.19)

Proof. It is easy to see from the definition of  that  is an [n, n − 1] linear code over Fq and || = q n−1 . The dual code of  is given by ⊥ = {(a, a, 0, 0, . . . , 0) ∈ Fqn | a ∈ Fq }. The dual distance distribution of  is equal to the weight distribution of ⊥ , that is B0 = 1,

B1 = 0,

B2 = q − 1,

Bi = 0, i  3.

Hence, by Lemma 2, (q − 1)n ¯ , d() = q

var() =

(q − 1)(n + 2) . q2

(3.20)

Furthermore, by (1.1), (1.3) and (3.20), we have  

dH (a, b) = (q − 1)nq 2n−3 ,

(3.21)

2 (a, b) = q 2(n−2) [(q − 1)(n + 2) + (q − 1)2 n2 ]. dH

(3.22)

a∈ b∈

 

a∈ b∈

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

471

It follows from the definition of  and (3.3) that  wH (a − (0, 1, 0, . . . , 0)) a∈



=

[wH ((a1 , a2 − 1)) + wH ((a3 , . . . , an ))]

(a1 ,a2 ,a3 ,...,an )∈



=

[1 + wH ((a3 , . . . , an ))]

(a1 ,a2 )=(0,0), (−1,1), (a3 ,...,an )∈Fqn−2



+

a2 =0,1, a1 +a2 =0,

=2



[2 + wH ((a3 , . . . , an ))]

(a3 ,...,an )∈Fqn−2



[1 + wH (b)] + (q − 2)

b∈Fqn−2

= 2(q − 1)q n−2 + q



[2 + wH (b)]

b∈Fqn−2

wH (b)

b∈Fqn−2

= n(q − 1)q n−2 .

(3.23)

In the same way, by (3.3) and (3.4), we have  2 (a − (0, 1, 0, . . . , 0)) wH a∈

=2





[1 + wH (b)]2 + (q − 2)

b∈Fqn−2

[2 + wH (b)]2

b∈Fqn−2

= [(q − 1)2 n2 + (q − 1)n − 2]q n−3 .

(3.24)

Hence, by the definition of + , (3.1), (3.20) and (3.23), ¯ +) = d(

q 2(n−1) (q n−1 + 1)2

n(q − 1)q n−2 (q n−1 + 2) 2n(q − 1)q n−2 ¯ = . d() + 2 n−1 (q + 1) (q n−1 + 1)2

(3.25)

By the definition of + , (3.2), (3.22) and (3.24),   2 (a, b) = [(q − 1)(n + 2) + (q − 1)2 n2 ]q 2(n−2) dH a∈+ b∈+

+ 2[(q − 1)2 n2 + (q − 1)n − 2]q n−3 .

(3.26)

From (1.3), (3.25) and (3.26), we have var(+ ) [(q − 1)(n + 2) + (q − 1)2 n2 ]q 2(n−2) + 2[(q − 1)2 n2 + (q − 1)n − 2]q n−3 = (q n−1 + 1)2 n2 (q − 1)2 q 2(n−2) (q n−1 + 2)2 − . (q n−1 + 1)4

(3.27)

Note that [(q − 1)(n + 2) + (q − 1)2 n2 ]q 2(n−2) + 2[(q − 1)2 n2 + (q − 1)n − 2]q n−3 = q −2 ([(q − 1)(n + 2) + (q − 1)2 n2 ][(q n−1 + 1)2 − 1] − 4q n ),

(3.28)

n2 (q − 1)2 q 2(n−2) (q n−1 + 2)2 = n2 (q − 1)2 q −2 [(q n−1 + 1)4 − 2(q n−1 + 1)2 + 1].

(3.29)

Hence, we obtain (3.15) from (3.27)–(3.29).

472

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

Now we compute var(− ). Note that  is a linear code over Fq . By the definition of − ,     dH (a, b) = wH (b − a) a∈ b∈

a∈ b∈



= q n−1 = q n−1

wH (c)

c∈



wH (c).

(3.30)

In the same way, we have    2 (a, b) = q n−1 2 (c). dH wH

(3.31)

By (3.21), (3.22), (3.30) and (3.31),  wH (c) = (q − 1)nq n−2 ,

(3.32)

c∈−

a∈ b∈

c∈−



c∈



c∈−

2 (c) = q n−3 [(q − 1)(n + 2) + (q − 1)2 n2 ]. wH

By (3.1), (3.2), (3.21), (3.22), (3.32) and (3.33),   dH (a, b) = (q − 1)nq n−2 (q n−1 − 2), a∈





b∈

(3.33)

(3.34)





a∈− b∈−

2 (a, b) = [(q − 1)(n + 2) + (q − 1)2 n2 ]q n−3 (q n−1 − 2). dH

(3.35)

It follows from (1.1) and (3.34) that n−2 (q n−1 − 2) ¯ − ) = (q − 1)nq . d( n−1 (q − 1)2

(3.36)

Hence, by (1.3), (3.35) and (3.36), var(− ) =

[(q − 1)(n + 2) + (q − 1)2 n2 ]q n−3 (q n−1 − 2) −

(q n−1 − 1)2 (q − 1)2 n2 q 2(n−2) (q n−1 − 2)2 (q n−1 − 1)4

.

(3.37)

Note that q n−3 (q n−1 − 2) = q −2 [(q n−1 − 1)2 − 1],

q 2(n−2) (q n−1 − 2)2 = q −2 [(q n−1 − 1)4 − 2(q n−1 − 1)2 + 1].

(3.38) (3.39)

Hence, we obtain (3.16) from (3.37)–(3.39). Now we compute var(). From the definition of , (3.7) and (3.8), we have     dH (a, b) = dH (x, y) = (q − 1)(n − 1)q 2n−3 ,

(3.40)

a∈ b∈

 

a∈ b∈

x∈Zn−1 y∈Zn−1 q q 2 (a, b) = dH





2 (x, y) dH

x∈Zn−1 y∈Zn−1 q q

= (q − 1)(n − 1)[1 + (q − 1)(n − 1)]q 2n−4 .

(3.41)

Hence, by (1.1) and (3.40), we have (q − 1)(n − 1) ¯ . d() = q

(3.42)

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

473

By (1.3), (3.41) and (3.42), var() =

(q − 1)(n − 1) . q2

Now we compute var(+ ). From the definition of  and (3.3), we have   wH (a − (0, . . . , 0, 1)) = [wH (x) + 1] a∈

x∈Zn−1 q

= q n−1 + (q − 1)(n − 1)q n−2 .

(3.43)

In the same way, by (3.3) and (3.4),  2 (a − (0, . . . , 0, 1)) wH a∈



=

[wH (x) + 1]2

x∈Zn−1 q

= q n−1 + 2(q − 1)(n − 1)q n−2 + (q − 1)(n − 1)[1 + (q − 1)(n − 1)]q n−3 .

(3.44)

Hence, by the definition of + , Proposition 1, (3.40), (3.41), (3.43) and (3.44), we have   dH (a, b) = (q − 1)(n − 1)q 2n−3 + 2q n−1 + 2(q − 1)(n − 1)q n−2 a∈+ b∈+

= 



a∈+ b∈+

(q − 1)(n − 1) n−1 2q n − (q − 1)(n − 1) (q , + 1)2 + q q

(3.45)

2 (a, b) = (q − 1)(n − 1)[1 + (q − 1)(n − 1)]q 2n−4 + 2q n−1 dH

+ 4(q − 1)(n − 1)q n−2 + 2(q − 1)(n − 1)[1 + (q − 1)(n − 1)]q n−3 (q − 1)(n − 1)[1 + (q − 1)(n − 1)] n−1 = (q + 1)2 q2 2q n+1 + 4(q − 1)(n − 1)q n − (q − 1)(n − 1)[1 + (q − 1)(n − 1)] + . q2

(3.46)

It follows from (1.1) and (3.45) that n ¯ + ) = (q − 1)(n − 1) + 2q − (q − 1)(n − 1) . d( q q(q n−1 + 1)2

(3.47)

Hence, by (1.3), (3.46) and (3.47), we have   1 2 (a, b) − [d( ¯ + )]2 dH var(+ ) = 2 n−1 (q + 1) + + a∈

b∈

(q − 1)(n − 1) 2q n+1 + (q − 1)(n − 1)[(q − 1)(n − 1) − 1] = + q2 q 2 (q n−1 + 1)2 −

[2q n − (q − 1)(n − 1)]2 q 2 (q n−1 + 1)4

.

Now we compute var(− ). From the definitions of  and − and (3.3), we have    wH (a) = wH (a) = wH (x) = (q − 1)(n − 1)q n−2 . a∈−

a∈

In the same way, by (3.4),   2 (a) = wH a∈−

x∈Zn−1 q

(3.48)

x∈Zn−1 q

2 (x) = (q − 1)(n − 1)[1 + (q − 1)(n − 1)]q n−3 . wH

(3.49)

474

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

Hence, by the definition of − , Proposition 1, (3.40), (3.41), (3.48) and (3.49), we have 



dH (a, b) =

(q − 1)(n − 1) n−1 [(q − 1)2 − 1], q

(3.50)

2 (a, b) = dH

(q − 1)(n − 1)[1 + (q − 1)(n − 1)] n−1 [(q − 1)2 − 1]. q2

(3.51)

a∈− b∈−



a∈







b∈

It follows from (1.1) and (3.50) that ¯ − ) = (q − 1)(n − 1) − (q − 1)(n − 1) . d( q q(q n−1 − 1)2

(3.52)

Hence, by (1.3), (3.51) and (3.52), we have var(− ) =



1 (q n−1 − 1)2



a∈− b∈−

2 (a, b) − [d( ¯ − )]2 dH

(q − 1)(n − 1) (q − 1)(n − 1)[(q − 1)(n − 1) − 1] = + q2 q 2 (q n−1 − 1)2 −

(q − 1)2 (n − 1)2 q 2 (q n−1 − 1)4

This completes the proof.

.



Remark 1. There is a typographical error for T (n, 2n−1 + 1; 2) in [15]. It follows from Theorem 2 and Proposition 3 that T (n, 2n−1 + 1; 2) n − 1 2n+2 + (n − 1)(n − 2) [2n+1 − n + 1]2 + − 4 4(2n−1 + 1)2 4(2n−1 + 1)4 n−1 (2n − n − 1)(22n + 2n + n + 1) n2 + n + 2 = + . + 2 n−1 4 4(2 + 1) 4(2n−1 + 1)4

=

4. Proof of Theorem 1 In this section, we first derive a general upper bound on var(C) for 2  q  4, then we prove Theorem 1 by observing that this upper bound is tight for , + and − . Theorem 3. Let C be an (n, M; q) code. If 2  q  4 and M ≡  (mod q), then var(C) 

2 (q − )2 n2 (q − 1)n − 2 2q n−2 − + 2 M q q2M 4 (q − ) − 2 [2q n − 2 − n(q − 1)(q − 2) − n(n − 1)(q − 1)2 ]. q (q − 1)M 2

(4.1)

Proof. The dual distance distribution of C is given by B0 , B1 , . . . , Bn . By Lemmas 1 and 3, we have n

B2 =

 qn − 1 − B1 − Bk M k=3

n   (q − )  qn k−1 n (q − 1) − 1 − B1 −  k M M2 k=3 (q − ) n(n − 1)(q − 1)2 qn n q − 1 − (q − 1)n − − 1 − B1 − . = M 2 (q − 1)M 2

(4.2)

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

475

since B1  (q−2)n , by Lemmas 2 and 3 and (4.2), we have for 2  q  4, M

(q − 1)n − 2 2q n−2 (q − 4) 1 + + B1 − 2 (B1 )2 M q2 q2 q (q − ) − [2q n − 2 − 2(q − 1)n − n(n − 1)(q − 1)2 ] (q − 1)q 2 M 2 2 (q − )2 n2 (q − 1)n − 2 2q n−2 − +  2 M q q2M 4 (q − ) − 2 [2q n − 2 − n(q − 1)(q − 2) − n(n − 1)(q − 1)2 ]. q (q − 1)M 2

var(C) 

This completes the proof.



Proof of Theorem 1. Note that || = q n−1 ,

|+ | = q n−1 + 1,

|− | = q n−1 − 1.

By Theorem 3 and Proposition 3, we have for 2  q  4, var()  R(n, q n−1 ; q) 

(q − 1)(n + 2) = var(), q2

var(+ )  R(n, q n−1 + 1; q) 

(q − 1)(n + 2) 4q n + (q − 1)(n + 2) − (q − 1)2 n2 − q2 q 2 (q n−1 + 1)2 −

(q − 1)2 n2

q 2 (q n−1 + 1)4 = var(+ ), var(− )  R(n, q n−1 − 1; q) (q − 1)(n + 2) (q − 1)2 n2 − (q − 1)(n + 2) (q − 1)2 n2 + − 2 2 2 n−1 2 q q (q − 1) q (q n−1 − 1)4 − = var( ). 

Hence, Theorem 1 follows from combining these assertions.



5. Proof of Theorem 2 In this section, we first derive a general lower bound on var(C) for all q, then we prove Theorem 2 by showing that this lower bound is tight for some cases. Let C be an (n, M; q) code where M ≡  (mod q). Denote sq (n, M) =

tq (n, M) =

(q − )n qM 2

,

1 (q − )[q n − 1 − (q − 1)n] q n−1 − − M q q(q − 1)M 2

and define F (x) =

(q − 2) x − x2, q

x > 0,

rq (n, M) = min{F (sq (n, M)), F (tq (n, M))}.

476

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

Theorem 4. Let C be an (n, M; q) code with M ≡  (mod q). Then var(C) 

(q − 1)n (q − )(q − 1)n(n − 1) + + rq (n, M). q2 q2M 2

(5.1)

Moreover, if tq (n, M)  q−2 q , then rq (n, M) = F (tq (n, M)). Proof. The dual distance distribution of C is given by B0 , B1 , . . . , Bn . Denote x0 = Bq1 . By Lemmas 2 and 3, we have 2 (q − 1)n + 2 B2 + F (x0 ) q2 q (q − 1)n (q − )(q − 1)n(n − 1)  + + F (x0 ). q2 q2M 2

var(C) =

(5.2)

It follows from Lemma 3 that x0  sq (n, M). By Lemmas 1 and 3, we have n

B1 =

 qn −1− Bk M k=2

n n (q − )  qn −1−  (q − 1)k−1 2 M k M k=2

(q − )[q n − 1 − (q − 1)n] qn −1− . = M (q − 1)M 2 Hence x0  tq (n, M). Since for every interval F (x) achieves its minimum at one of its endpoints, we obtain (5.1). Moreover, since sq (n, M)  0, it follows that F (sq (n, M))  F (tq (n, M)) when tq (n, M)  q−2 q . This completes the proof.  Proof of Theorem 2. Note that || = q n−1 ,

|+ | = q n−1 + 1,

|− | = q n−1 − 1.

For M = q n−1 , we have  = 0 and tq (n, q n−1 ) =

q −1 q −2  . q q

Hence, we have rq (n, q n−1 ) = F



q −1 q

 =−

q −1 . q2

Thus, by Theorem 4 and Proposition 3, var()  T (n, q n−1 ; q) 

(q − 1)(n − 1) = var() q2

which implies (1.7). For M = q n−1 − 1, we have  = q − 1 and tq (n, q n−1 − 1) =

q − 1 (q − 1)(n − 1) + . q q(q n−1 − 1)2

It is easy to see that tq (n, q n−1 − 1)  q−2 q . Hence, by Theorem 4 and Proposition 3, we have var(− )  T (n, q n−1 − 1; q) (q − 1)(n − 1) (q − 1)(n − 1)[(q − 1)(n − 1) − 1] +  q2 q 2 (q n−1 − 1)2 −

(q − 1)2 (n − 1)2

q 2 (q n−1 − 1)4 = var(− ) which implies (1.8).

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478

477

For M = q n−1 + 1, we have  = 1 and tq (n, q n−1 + 1) =

q − 1 2q n − (q − 1)(n − 1) − . q q(q n−1 + 1)2

It is easy to check that tq (n, q n−1 + 1)  q−2 q for n  3. If n = 2, then M = q + 1 and q − 1 2q 2 − q + 1 , − q q(q + 1)2 2(q − 1) . sq (2, q + 1) = q(q + 1)2 tq (2, q + 1) =

It is easy to check that for n = 2 and q = 2, 3, tq (2, q + 1) 

q −2 q

and for n = 2 and q = 4, t4 (2, 5) = 0.46 and s4 (2, 5) = 0.06, so that r4 (2, 5) = F (t4 (2, 5)). Hence, by Theorem 4 and Proposition 3, we have for n  3 or 2  q  4, var(+ )  T (n, q n−1 + 1; q) 

(q − 1)(n − 1) 2q n+1 + (q − 1)(n − 1)[(q − 1)(n − 1) − 1] + q2 q 2 (q n−1 + 1)2 −

[2q n − (q − 1)(n − 1)]2 q 2 (q n−1 + 1)4

= var(+ )

which implies (1.9). This completes the proof.



Acknowledgements The authors would like to thank the anonymous reviewers and the Editor-in-Chief Professor Peter L. Hammer for their valuable suggestions and comments that helped to improve this paper. This research work is supported in part by the DSTA Research Grant R-394-000-011-422, the National Natural Science Foundation of China under the Grant 60172060, the Trans-Century Training Program Foundation for the Talents by the Education Ministry of China, and the Foundation for University Key Teacher by the Education Ministry of China, and the 100-Talents program of the Chinese Academy of Science.

References [1] [2] [3] [4] [5] [6] [7] [8] [9]

R. Ahlswede, I. Althöfer, The asymptotic behaviour of diameters in the average, J. Combin. Theory Ser. B 61 (1994) 167–177. R. Ahlswede, G. Katona, Contributions to the geometry of Hamming spaces, Discrete Math. 17 (1977) 1–22. R. Ahlswede, Z. Zhang, Coding for write-efficient memory, Information and Computation 83 (1994) 80–97. I. Althöfer, T. Sillke, An average distance inequality for large subsets of the cube, J. Combin. Theory Ser. B 56 (1992) 296–301. A. Ashikhmin, J. Simonis, On the Delsarte inequalities, Linear Algebra Appl. 269 (1998) 197–217. P. Delsarte, An algebraic approach to the association schemes of coding theory, Philips Res. Rep. Suppl. 10 (1973). P. Delsarte, Bounds for unrestricted codes, by linear programming, Philips Res. Rep. 27 (1972) 272–289. F.-W. Fu, On the improvements of Althöfer-Sillke inequality, J. Math. Res. Exposition 16 (3) (1996) 325–328. F.-W. Fu, S.-Y. Shen, On the expectation and variance of Hamming distance between two binary i.i.d. random vectors, Acta. Math. Appl. Sinica 13 (1997) 243–250. [10] F.-W. Fu, V.K. Wei, R.W. Yeung, On the minimum average distance for binary codes: linear programming approach, Discrete Appl. Math. 111 (2001) 263–281. [11] F.-W. Fu, C. Xing, On the minimum average distance for nonbinary codes, in: Proceedings of Fourth Shanghai International Conference on Combinatorics, Shanghai, China, May 24–28, 2002.

478 [12] [13] [14] [15] [16]

F.-W. Fu et al. / Discrete Applied Mathematics 145 (2005) 465 – 478 A. Kündgen, Covering cliques with spanning bicliques, J. Graph Theory 27 (1998) 223–227. A. Kündgen, Minimum average distance subsets in the Hamming cube, Discrete Math. 249 (2002) 149–165. F.J. MacWilliams, N.J.A. Sloane, The Theory of Error-Correcting Codes, North-Holland, New York, 1985. S.-T. Xia, F.-W. Fu, On the average Hamming distance for binary codes, Discrete Applied Math. 89 (1998) 269–276. Z.Z. Zhang, A relation between the average Hamming distance and the average Hamming weight of binary codes, J. Statist. Plann. Inference 94 (2001) 413–419.