Two classes of ternary codes and their weight distributions Cunsheng Ding, Torleiv Kløve, and Francesco Sica Abstract In this paper we describe two classes of ternary codes, determine their minimum weight and weight distribution, and prove their properties We also present four classes of 1-designs that are based on the classes of ternary codes Keywords Group character codes, ternary codes, designs 1 Introduction Ternary codes have been studied by many authors, see, for example, Bogdanova and Boukliev [2], Hamada, Helleseth and Ytrehus [5], Hill and Newton [, 7], van Eupen [1, 14, 15], and van Eupen and van Lint [1] Much of the study was concentrated on ternary codes of small dimensions A class of [2 n, k i=0 ( n i), 2 n r ] group character codes C q (r, n) over GF (q), where q is odd, is described and analyzed by Ding, Kohel and Ling [] This class of codes contains the ternary codes C (1, n) In this paper, we describe a new class of [2 n, n + 1] ternary codes and a class of [2 n, n + 2] ternary codes, and determine their weight distributions The supports of the minimum weight codewords of these codes give 1-designs under certain conditions The supports of all codewords of some other weight also give 1-designs As byproducts we present here four classes of 1-designs that are based on the ternary codes C Ding is with the Department of Computer Science, National University of Singapore, Lower Kent Ridge Road, Singapore 11920 dingcs@compnusedusg T Kløve is with the Department of Informatics, University of Bergen, HIB, N-5020 Bergen, Norway torleiv@iiuibno F Sica is with the Department of Computer Science, National University of Singapore, Lower Kent Ridge Road, Singapore 11920 sica@compnusedusg 1
2 The class of ternary codes C (r, n) Note that (GF (2) n, +) is an additive Abelian group of exponent 2 and order N = 2 n, with 0 as the identity element From now on we assume that n 2 Let M denote the multiplicative group of characters from GF (2) n to GF () The group M is isomorphic non-canonically to GF (2) n [12, Chapter VI] In particular we have M = GF (2) n = N = 2 n The set GF (2) n may be identified with the set of integers {i : 0 i 2 n 1}: the element (i 0, i 1,, i n 1 ) of GF (2) n is identified with i = i 0 + i 1 2 + + i n 1 2 n 1, where each i j is 0 or 1 We also say that (i 0, i 1,, i n 1 ) is the binary representation of i We define f i (y) = ( 1) i 0y 0 +i 1 y 1 + +i n 1 y n 1, (1) where y = (y 0, y 1,, y n 1 ) GF (2) n, and (i 0, i 1,, i n 1 ) is the binary representation of i It is easy to check that, for all i with 0 i 2 n 1, this gives all the 2 n characters from GF (2) n to GF () with f 0 as the trivial character, so M = {f 0, f 1,, f 2 n 1} Since we identify i and y with their respective binary representation, we have f i (y) = f y (i) For any subset X of GF (2) n, the group character code C X over GF () described by Ding, Kohel and Ling [] is: C X = { (c 0, c 1,, c N 1 ) GF () N : N 1 i=0 } c i f i (x) = 0 for all x X Let X = {x 0, x 1,, x t 1 } be a subset of GF (2) n and let X c be the complement of X in GF (2) n, indexed such that GF (2) n = {x 0, x 1,, x N 1 } Proposition 1 [] Let X be as above For 0 i N 1, let v i denote the vector (f 0 (x i ), f 1 (x i ),, f N 1 (x i )) Then the set {v 0, v 1,, v N 1 } is linearly independent In particular, H = [ ] f j 1 (x i 1 ) 1 i t, 1 j N has rank t and is a parity check matrix of C X, [ ] G = f j 1 (x t 1+i ) 1 i N t, 1 j N has rank N t and is a generator matrix for C X, so C X is an [N, N t] linear code over GF () Moreover, H is a generator matrix for C X c and C X C X c = GF () N 2
The Hamming weight of a vector a of GF (2) n, denoted wt(a), is defined to be the number of its nonzero coordinates For 1 r n, let X(r, n) = {a GF (2) n : wt(a) > r}, and let C (r, n) denote the code C X(r,n) over GF () For a word c = (c 0,, c 2 n 1) in GF () 2n, let the support of c be defined as Supp(c) = {i : 0 i < 2 n, and c i 0} By convention we define the minimum distance of the zero code to be, which we represent by any integer larger than the block length of the code Proposition 2 [] The following properties of the codes C (r, n) are known: (A) C (r, n) is a [2 n, r j=0 ( n j), 2 n r ] ternary code (B) The minimum nonzero weight codewords generate C (r, n) (C) The dual code C (r, n) is equivalent to C (n r 1, n) In the sequel we define v 0 = (1, 1,, 1) GF () n and v i = (f 0 (e i ), f 1 (e i ),, f N 1 (e i )) for all 1 i n, where e i is the vector of GF (2) n whose ith coordinate is 1 and other coordinates are all zero Proposition [4] For any integer 1 m n + 1, in the code C (1, n) there are ( n+1) m 2 m codewords of the form m 1 j=0 a jv ij which have the same Hamming weight w(m) := 2 n m+1 2m ( 1) m, (2) where all a j GF (), and 0 i 0 < i 1 < < i m 1 n The n weights w(m) in (2) are pairwise distinct and satisfy w(2) < w(4) < w() < < w(2 n/2 ) < w(2 (n 1)/2 + 1) < < w(2 (n 1)/2 1) < < w(5) < w() < w(1) For a ternary [N, K] code C, let A i = A i (C), i = 0, 1,, N, be its weight distribution and let N A C (x) = A i (C)x i i=0 be its weight distribution function Then A C (x) and A C (x) are related by the MacWilliams identity (see eg [11, p 88]) A C (x) = 1 K N i=0 A i (C) (1 x) i (1 + 2x) N i = 1 ( 1 x ) K (1 + 2x)N A C () 1 + 2x
From Proposition we get A C (1,n)(x) = 1 + n+1 m=1 ( ) n + 1 2 m x w(m) m Combining this with () we get A C (1,n) (x) The explicit expressions for A i (C (1, n) ) are quite complicated in general However, we get A i (C (1, n) ) = 0 for 1 i (as we should since the code has minimum distance 4 by Proposition ) and A 4 (C (1, n) ) = n 2 4 n + 2 n (4) 4 In the rest of this section, we prove some auxiliary results for later sections and present a class of new 1-designs The following lemma is a well-known result, known as the orthogonality relations in character theory [12, Chapter VI, Proposition 4] Lemma 4 Let A be a finite additive Abelian group of order N and let M be the group of characters of A For characters f, g in M and elements x, y in A, we have: 1 x A f(x)g(x) = { N if f = g 1 0 if f g 1 2 f M f(x)f(y) = { N if x = y 0 if x y Define e 0 to be the zero vector of GF (2) n For each i with 1 i n, e i is defined as before Let e n+1, e n+2,, e 2 n 1 denote the elements of GF (2) n \ {e 0, e 1,, e n } with any order Define v i = (f 0 (e i ), f 1 (e i ),, f N 1 (e i )) for all 0 i 2 n 1 By Lemma 4, the vectors v 0, v 1,, v 2 n 1 are linearly independent over GF () Take any n+1 vectors v j0, v j1,, v jn, where 0 j 0 < j 1 < < j n 2 n 1, we use T j0,j 1,,j n to denote the ternary code generated by v j0, v j1,, v jn Proposition 5 If 1 j 1 < j 2 < < j n 2 n 1 and e j1, e j2,, e jn are linearly independent, then T 0,j1,,j n is equivalent to C (1, n) and has thus the same parameters and weight distribution as C (1, n) That is, for any integer 1 m n + 1, in the code T 0,j1,j 2,,j n there are ( n+1) m 2 m codewords of the form m 1 l=0 a lv jil which have the same Hamming weight w(m), where 1 i 0 < i 1 < < i m 1 n 4
Proof: Note that C (1, n) = T 0,1,,n To prove the equivalence, we will show that by some column permutations a generator matrix of T 0,j1,,j n gives a generator matrix of T 0,1,,n Consider the following matrices and M(j 1,, j n ) := [e l e ji ] 1 i n, 0 l 2 n 1 G(j 1,, j n ) := [( 1) e le ji ]0 i n, 0 l 2 n 1, where e j1, e j2,, e jn are linearly independent, and e 0 e j1 denotes the standard inner product Since e j1, e j2,, e jn are linearly independent over GF (2), every vector of GF (2) n appears exactly once as column vectors of the matrix M(j 1,, j n ) Hence by some column permutations, M(j 1,, j n ) can be rearranged into M(1,, n) Therefore the generate matrix G(j 1,, j n ) of T 0,j1,,j n can be rearranged into the generator matrix G(1,, n) of T 0,1,,n by the same column permutations This proves the equivalence Example 1 Consider the case n = We take e j1 = (1, 0, 0), e j2 = (0, 1, 0), and e j = (1, 1, 1) The three vectors are linearly independent Then the code T 0,j1,j 2,j has parameters [8, 4, 4] and generator matrix 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 2 1 1 2 1 2 1 2 2 1 2 2 2 1 1 1 2 The weight enumerator of this code is 1 + 24x 4 + 1x 5 + 2x + 8x 8 This code is one of the best possible codes of this length and dimension Remark: The condition that e j1, e j2,, e jn are linearly independent in Proposition 5 is necessary to ensure that the minimum weight of the code T 0,j1,,j n is 2 n 1 For example, in the case n = if we take e j1 = (0, 1, 0), e j2 = (0, 0, 1), and e j = (0, 1, 1) The three vectors are linearly dependent Then the code T 0,j1,j 2,j has parameters [8, 4, 2] and generator matrix 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 2 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 1 The weight enumerator of this code is 1 + 8x 2 + 24x 4 + 2x + 1x 8 minimum distance is less than 2 n 1 So the 5
Proposition The set of supports of the minimum nonzero weight codewords of T 0,j1,j 2,,j n in Proposition 5 is a 1-(2 n, 2 n 1, n(n + 1)/2) design Proof: This can be proved similarly as Corollary 17 in [] It is interesting to note that the code T 0,j1,j 2,,j n in Proposition 5 has only one odd weight w(n + 1) Only codewords of form n i=0 a i v i have this odd weight, where each a i 0 We now prove that the supports of these codewords give 1-designs First we quote an old result of C Ramus from 184 which will be needed in the proof and also later Lemma 7 [10, p 70] Let m and µ be positive integers and 0 i < µ Then µ,i (m) def = 0 j m j i mod µ ( ) m = 1 j µ µ 1 ( l=0 2 cos lπ ) m l(m 2i)π cos µ µ Proposition 8 The set of supports of all the codewords n i=0 a i v i, where each a i 0, in the code T 0,j1,j 2,,j n of Proposition 5, is a 1-(2 n, (2 n+1 ( 1) n+1 )/, λ) design, where λ = 2 n+1 +( 1) n/ 2 if n 0 (mod ), 2 n+1 ( 1) (n 1)/ if n 1 (mod ), 2 n+1 +( 1) (n 2)/ if n 2 (mod ) Proof: A codeword covers another one if and only if the set of supports of the former contains that of the latter We first prove that a codeword x := n i=0 a i v i covers another one y := n i=0 b i v i if and only if one is a nonzero multiple of the other, where each a i and b i are nonzero We need only to prove one direction of this claim as the other is obvious Assume now that x covers y Then x covers both x ± y Let h denote the Hamming distance between (a 0,, a n ) and (b 0,, b n ) If h = n + 1 or h = 0, then x is a multiple of y Suppose that h 0 and h n + 1 Then x y is a linear combination of h vectors v i and x + y is a linear combination of n h vectors v i If n is odd, one of h and n h is odd If h is odd, by Proposition 5 the weight of x y is larger than that of x, so x cannot cover x y If h is even, then x cannot cover x + y If n is even, similarly we can prove that x cannot cover at least one of x ± y This leads to a contradiction So h must be equal to one of 0 and n + 1 and x must be a nonzero multiple of y Hence all the codewords of the form n i=0 a i v i, where a 0 = 1, give 2 n different supports The weight of such a codeword is w(n + 1) = 2n+1 ( 1) n+1 We now
consider the function F d1,,d n (x) := 1 + d 1 x 1 + d 2 x 2 + + d n x n from (GF () ) n to GF (), where each d i is a nonzero element of GF () and x = (x 1,, x n ) The weight of F d1,,d n (x) is defined to be the number of nonzero elements of GF () this function takes on when x ranges over all elements of (GF () ) n Since each d i and x i can be written in the form ( 1) y, where y GF (2), the weight of F d1,,d n (x) does not depend on d i It then follows from the definition of these v i that the set of supports of all these codewords is a 1-(2 n, w(n + 1), λ) design It remains to determine λ To this end, we need to consider the weight of F 1,,1 (x) It is seen that the weight of this function is 2 n {z GF (2) n : wt(z) 2n 1 (mod )} = 2 n,i (n) where i 2n 1 (mod ) Then the λ, which is the weight of the function F 1,,1 (x), is given by Lemma 7 This completes the proof of this proposition Another class of [2 n, n + 1] ternary codes Let e 2 n 1 denote the all-one vector (1, 1,, 1) of GF (2) n, and let v 2 n 1 = (f 0 (e 2 n 1), f 1 (e 2 n 1),, f 2 n 1(e 2 n 1)) Let e 1, e 2,, e n be the n vectors as before We use T 1,2,,n,2 n 1 to denote the linear code generated by v 1, v 2,, v n and v 2 n 1 By Lemma 4, T 1,2,,n,2 n 1 has dimension n + 1 We now determine the minimum weight and the weight distribution of this code Proposition 9 The code T 1,2,,n,2 n 1 is a [2 n, n + 1, d] ternary code, where d is given below If n is even, then the minimum weight d of this code is 2 n 1, and the weight distribution in this code is given in Table 1 weight frequency codewords ( w(m) n+1 ) m 2 m m 1 l=0 a lv jl, where 1 m n where j l {1,, n, 2 n 1}, 2 n+1 +1 2 n+1 ni=1 a i v i + av 2 n 1, a i 0, a 0 Table 1: Weight distribution in T 1,2,,n,2 n 1 when n is even If n is odd, then the minimum weight d of this code is { [ min 2 n 1, 2 n+1 1 (n+1)/2] } /, and the weight distribution in this code is given in Table 2 7
weight frequency codewords ( w(m) n+1 ) m 2 m m 1 l=0 a lv jl, where 1 m n where j l {1,, n, 2 n 1}, 2 n+1 1 ( ) (n+1)/2 2 n ni=1 a i v i + av 2 n 1 where wt(h) even, a i 0, a 0 2 n+1 1+( ) (n+1)/2 2 n ni=1 a i v i + av 2 n 1 where wt(h) odd, a i 0, a 0 Table 2: Weight distribution in T 1,2,,n,2 n 1 when n is odd Case I Since u and au have the same Hamming weight if a 0, we consider the weight of the following codeword u := m 2 l=0 where j l {1, 2,, n}, m 1 n, and each a l 0 Subcase I1 a l v jl + v 2 n 1, (5) We consider the vector u of (5) under the condition that m 1 < n a l = ( 1) h l, where h l = {0, 1} We now consider the following matrix e 0 e j0 + h 0 e 1 e j0 + h 0 e 2 n 1e j0 + h 0 e 0 e j1 + h 1 e 1 e j1 + h 1 e 2 L := n 1e j1 + h 1 e 0 e jm 2 + h m 2 e 1 e jm 2 + h m 2 e 2 n 1e jm 2 + h m 2 Each Since e j0, e j1,, e jm 2 are linearly independent, each vector of GF (2) m 1 appears exactly 2 n (m 1) times as column vectors of L Let j m 1, j m,, j n 1 be the elements of {1, 2,, n} \ {j 0, j 1,, j m 2 } Consider now the following matrix 8
L 1 := e 0 e j0 + h 0 e 1 e j0 + h 0 e 2 n 1e j0 + h 0 e 0 e j1 + h 1 e 1 e j1 + h 1 e 2 n 1e j1 + h 1 e 0 e jm 2 + h m 2 e 1 e jm 2 + h m 2 e 2 n 1e jm 2 + h m 2 e 0 e jm 1 e 1 e jm 1 e 2 n 1e jm 1 e 0 e jn 1 e 1 e jn 1 e 2 n 1e jn 1 Since e j0, e j1,, e jn 1 are linearly independent, each vector of GF (2) m 1 appears exactly once as a column vector of L 1 Let s 0, s 1,, s 2 m 1 1 be all the vectors of GF (2) m 1, and we let t 0, t 1,, t 2 n (m 1) 1 be all the vectors of GF (2)n (m 1) By permutations on columns, L 1 can be rearranged into the following matrix L 2 : [ ] s0 s 1 s 2 m 1 1 s 0 s 1 s 2 m 1 1 t 0 t 0 t 0 t 2 n (m 1) 1 t 2 n (m 1) 1 t 2 n (m 1) 1 The weight of the codeword u in (5) can be determined by looking at the first m 1 rows of the matrix L 2 However, all the vectors s i and t i are needed to determine the corresponding coordinates of v 2 n 1 This is because by definition f x (e 2 n 1) = ( 1) x 0+x 1 + +x n 1, where (x 0, x 1,, x n 1 ) is the binary representation of the integer x Define r = m mod We use y to denote one of the vectors s i and x to denote one of the vectors t i Then (y T, x T ) T ranges over all column vectors of L 2 when y and x run over all vectors of GF (2) m 1 and GF (2) n (m 1) respectively, where y T denotes the transpose of y Let w be the Hamming weight of y Suppose that y and x are in the ith column of L 2, then (m 1 2w) mod is the corresponding entry of the codeword m 2 l=0 a lv jl, and (m 1 2w + ( 1) w+wt(x) ) mod is the corresponding entry of the codeword m 2 l=0 a lv jl + v 2 n 1 It is then seen that Table gives the distribution of the elements {r, r 1, r 2} of GF () in the codeword u of (5) By Table, we have the following frequency of appearance of the elements of GF () in the codeword u: r GF () frequency r r 1 [,0 (m 1) +,5 (m 1) +,2 (m 1) +, (m 1)]2 n m [,1 (m 1) +,2 (m 1) +,4 (m 1) +,5 (m 1)]2 n m () r 2 [, (m 1) +,4 (m 1) +,0 (m 1) +,1 (m 1)]2 n m By Lemma 7 and (), the frequency of appearance of the elements of GF () in the codeword u is given in Table 4 9
w := wt(y) g entries of u entries of u frequency wt(x) even wt(x) odd w 0 (mod ) r 1 r r 2 2 n m,0 (m 1) w 1 (mod ) r r 1 r 2 2 n m,1 (m 1) w 2 (mod ) r 2 r 1 r 2 n m,2 (m 1) w (mod ) r 1 r 2 r 2 n m, (m 1) w 4 (mod ) r r 2 r 1 2 n m,4 (m 1) w 5 (mod ) r 2 r r 1 2 n m,5 (m 1) Table : Distribution of elements of GF () in u, where g := (m 1 2w) mod m 1 = k m 1 = k + 1 m 1 = k + 2 r r 1 r 2 2 m +( 1) k 2 n m 2 m ( 1) k 2 2 n m 2 m +( 1) k 2 n m 2 m ( 1) k 2 n m 2 m ( 1) k 2 n m 2 m +( 1) k 2 2 n m 2 m ( 1) k 2 2 n m 2 m +( 1) k 2 n m 2 m +( 1) k 2 n m Table 4: The frequency distribution of the elements of GF () in u With Table 4, we obtain that wt(u) = 2m+1 +( 1) k 2 2 n m if m 1 = k, wt(u) = 2m+1 ( 1) k 2 2 n m if m 1 = k + 1, wt(u) = 2m+1 +( 1) k 2 2 n m if m 1 = k + 2 It is then easy to check that wt(u) = w(m) Subcase I2 We consider the codeword u of (5) under the condition that m 1 = n Let a l = ( 1) h l, where h l {0, 1} Define h = (h 0, h 1,, h m 2 ) To determine the weight of u, we need the values of some,i (n) +,j (n) given in Lemma 7 With an argument similar to that in Subcase I1, we obtain the weight of u given in Table 5 Case II For any codeword u := m 1 l=0 a l v jl, (7) 10
wt(u) (wt(h) even) 2 n even n+1 +1 n odd 2 n+1 1 ( ) (n+1)/2 wt(u) (wt(h) odd) 2 n+1 +1 2 n+1 1+( ) (n+1)/2 Table 5: The weight of u in Subcase I2 where j l {1, 2,, n}, the weight of u is w(m) as described in Proposition 5 Summarizing the discussion in the two cases proves the conclusion of this proposition Lemma 10 If n 1 and n is odd, then [ 2 n 1 < 2 n+1 1 (n+1)/2] / If n 8 and n is even, then 2 n 1 < [ 2 n+2 1 (n+2)/2] / Proof: The two inequalities can be easily proved by induction on n Remark: If n is even, then A T1,2,,n,2 n 1 (x) = A C (1,n)(x) In particular, the minimum weight of the code T 1,2,,n,2 n 1 is 2 n 1 and the minimum weight of the dual code is 4 When n is odd, the minimum weight of the code T 1,2,,n,2 n 1 is { { [ d = min 2 n 1, 2 n+1 1 (n+1)/2] } < 2 n 1 if n 11, / = = 2 n 1 if n 1 Using MacWilliams identity, we get A 1 (T 1,2,,n,2 n 1) = 0, A 2 (T 1,2,,n,2 n 1) = 2 n In particular, the minimum weight of the dual code is 2 Proposition 11 If n is even or if n 1 is odd, then the minimum weight codewords of T 1,2,,n,2 n 1 generate this code 11
Proof: By Proposition 9 and Lemma 10, in both cases the minimum weight codewords are of the form av i + bv j, where i < j Thus it suffices to prove that v 2 n 1 + v j1, v 2 n 1 + v j2,, v 2 n 1 + v jn, and v 2 n 1 v jn are linearly independent This can be easily proved as v 2 n 1, v 0, v 1,, v n are linearly independent Proposition 12 The set of supports of the minimum nonzero weight codewords of T 1,2,,n,2 n 1 is a 1-(2 n, 2 n 1, n(n + 1)/2) design when n is even or n 1 is odd Proof: Note that the minimum weight codewords of T 1,2,,n,2 n 1 must be of the form av i + bv i, where i j, a 0, and b 0, when n is even or n 1 is odd This proposition can then be proved similarly as Corollary 17 in [] Example 2 Consider the case n = 4 We take e ji = e i for i = 1, 2,, 4 The four vectors are linearly independent Then the code T j1,j 2,j,j 4,2 4 1 has parameters [1, 5, 8] and generator matrix 1 2 1 1 1 2 2 2 1 1 1 2 2 2 1 2 1 1 2 1 1 2 1 1 2 2 1 2 2 1 2 2 1 1 1 2 1 1 2 1 2 1 2 2 1 2 2 2 1 1 1 1 2 1 1 2 1 2 2 1 2 2 2 2 1 2 2 2 2 1 1 1 1 1 1 2 2 2 2 1 The weight enumerator of this code is 1 + 40x 8 + 80x 10 + 2x 11 + 80x 12 + 10x 1 The best ternary codes of length 1 and dimension 5 have minimum distance 9 So this is almost the best code of these parameters 4 A class of [2 n, n + 2] ternary codes Let T 0,1,2,,n,2 n 1 denote the code generated by v 0, v 1,, v n and v 2 n 1 Clearly, it has dimension n + 2 The minimum distance and weight distribution of this code is given in the following proposition Proposition 1 The code T 0,1,2,,n,2 n 1 is a [2 n, n + 2, d] ternary code, where d is given below If n is even, then the minimum weight d of this code is { min 2 n 1, 1 [2 n+2 1 () (n+2)/2]} and the weight distribution in this code is given in Table 12
weight frequency codewords ( w(m) n+2 ) m 2 m m 1 l=0 a lv jl, where 1 m n where j l {0, 1,, n, 2 n 1}, w(n + 1) (n + 1)2 n+1 nl=0 a l v jl, j 0 = 0, j l {0, 1,, n, 2 n 1} 2 n+1 +1 2 n+1 ni=1 a i v i + av 2 n 1 2 n+2 1+( ) n/2 2 n+1 nl=0 a l v l + av 2 n 1 2 n+2 1 ( ) n/2 2 n+1 nl=0 a l v l + av 2 n 1 Table : Weight distribution in T 0,1,2,,n,2 n 1 when n is even, where all a i and a are nonzero If n is odd, then the minimum weight d of this code is { } min 2 n 1, (2 n+1 1 (n+1)/2 )/, and the weight distribution in this code is given in Table 7 weight frequency codewords ( w(m) n+2 ) m 2 m m 1 l=0 a lv jl, where 1 m n where j l {0, 1,, n, 2 n 1}, w(n + 1) (n + 1)2 n+1 nl=0 a l v jl, j 0 = 0, j l {0, 1,, n, 2 n 1} 2 n+1 1 ( ) (n+1)/2 2 n ni=1 a i v i + av 2 n 1 2 n+1 1+( ) (n+1)/2 2 n ni=1 a i v i + av 2 n 1 2 n+2 +1+( ) (n+1)/2 2 n+1 nl=0 a l v l + av 2 n 1 2 n+2 +1 ( ) (n+1)/2 2 n+1 nl=0 a l v l + av 2 n 1 Table 7: Weight distribution in T 0,1,2,,n,2 n 1 when n is odd, where all a l and a are nonzero Proof: Note that T 0,1,2,,n,2 n 1 contains both T 0,1,2,,n and T 1,2,,n,2 n 1 as subcodes We need only to consider the codewords m 2 u := a 0 v 0 + a l v l + av 2 n 1, l=1 where a l 0 and a 0 If m 2 < n, with an argument similar to Subcase I1 of Section, we can prove that wt(u) = w(m) If m 2 = n, similarly we can prove the following: 1
(1) If n is even, wt(u) takes on 2n+2 1+( ) n/2 for 2 n+1 codewords u respec- (2) If n is odd, wt(u) takes on 2n+2 +1+( ) (n+1)/2 tively for 2 n+1 codewords u and 2n+2 1 ( ) n/2 respectively and 2n+2 +1 ( ) (n+1)/2 Combining these two conclusions and Propositions 5 and 9 proves this proposition Remarks: 1 Combining Proposition 1 and MacWilliams identity we get that the code (T 0,1,2,,n,2 n 1) has minimum weight 4 and A 4 ((T 0,1,2,,n,2 n 1) ) = { ( n 8 4 n + 5 2 n )/1 if n is even, ( n 8 4 n + 7 2 n )/1 if n is odd 2 By Lemma 10, if n 8 and n is even or if n 1 and n is odd, T 0,1,2,,n,2 n 1 has minimum distance d = 2 n 1 Thus the code T 0,1,2,,n,2 n 1 is better than T 1,2,,n,2 n 1 and T 0,1,2,,n except for a few n s Proposition 14 If n 8 is even or if n 1 is odd, then the minimum weight codewords of T 0,1,2,,n,2 n 1 generate this code Proof: The proof of Proposition 11 applies here Proposition 15 The set of supports of the minimum nonzero weight codewords of T 0,1,2,,n,2 n 1 is a 1-(2 n, 2 n 1, (n + 2)(n + 1)/2) design when n 8 is even or n 1 is odd Proof: Note that all the minimum weight codewords of T 0,1,2,,n,2 n 1 must be of the form av i + bv j, where i j, a 0, and b 0, when n 8 is even or n 1 is odd Then this proposition can be proved similarly as Corollary 17 in [] 5 Using the codes for error detection Let C be a ternary [N, K, d] code The probability of undetected error when the code is used purely for error detection on a ternary symmetric channel is given by N ( p ) i(1 P ue (C, p) = A i (C) p) N i, 2 i=d 14
where p is the symbol error probability, see eg Kløve and Korzhik [9] In particular, P ue (C, 2/) = ( K 1)(1/) N < K N (8) The error probability threshold of C, introduced in Kløve [8], is defined by θ(c) = max { p [0, 2/] P ud (C, p) P ud (C, 2/) for all p [0, p ] } A code C is called good for error detection (in the technical sense) if and only if θ(c) = 2/ However, for practical applications the important things are that P ue (C, 2/) is small (that is, N K is large) and that θ(c) is above the range of actual values of p It is therefore of interest to estimate θ(c) It turns out that the performances on error detection of the codes described in this paper are very similar Therefore, we will only discuss C = C (1, n) in detail For this code we have N = 2 n, K = n + 1 and d = 2 n 1 Proposition 1 For all n 2 we have 1 < θ(c (1, n)) < 1 + n 2 n 2 Proof: First we note that for fixed p (0, 2/), the expression ( 2(1 p) )i decreases with increasing i Hence P ue (C, p) = (1 p) N N i=d < (1 p) N N = i=d ( p ) i A i (C) 2(1 p) ( p ) d A i (C) 2(1 p) ( p(1 p) ) N/2( K 1) 2 Further, we note that p(1 p) is increasing on the interval (0, 1/2) Hence, if p 1/, then ( P ue (C, p) P ue C, 1 ) ( 1 ) N/2( ( 1 N( ( < K 1) = 9 ) K 1) = P ue C, 2 ) p Hence θ(c) > 1 A direct calculation of θ(c) for n 9 gives the following values: n 2,, 4, 5 7 8 9 θ(c) 2/ 049 0852 019 0427 1/ + n/2 n > 2/ 108 07708 058 0759 15
In particular, the upper bound is true for n 9 To prove the upper bound for n 10, we first note that A d (C) Let p be the root in the interval (0, 1/2) of the equation ( ) p(1 p) 2 n 1 = n, 2 2n that is Then p = 9 8 n/2n 1 P ue (C, p) A d ( p 2 ) 2 n 1(1 p) 2n 1 Hence Simple calculus shows that ( p(1 p) > 2 ) 2 n 1 = n+1 2n > P ue (C, 2/) θ(c) < p for 1 < x < 112 Hence for n 10 9 8x p < 1 + < 1 + 4 log (x) n 2 n Proposition 1 shows that C (1, n) is good for practical error detection (even if it is not good in the technical sense) A similar proof shows that also the other codes have a threshold close to 1/ (for most n) Now, consider the dual codes Proposition 17 For all n 1 we have Proof: We have Let θ(c (1, n) ) < 18 n/4 P ue (C, 2/) = 2n n 1 1 2n < 1 n+1 p = 18 n/4 1
We have p < 2/ for n 4 By (4) we have for all n 1 P ue (C, p) P ue (C, 2/) ( p ) 4(1 > A 4 (C ) p) 2 n 4 n+1 2 = 24 ( ( 2 ) n ( 1 1 2 + 1 ))(1 ) 2n 4 > 1 18 n/4 Proposition 17 shows that C (1, n) is not very useful for error detection except possibly for some very moderate values of n The upper bound on θ(c (1, n) ) can be improved by some factor by the same method, eg θ(c (1, n) ) < for n 28 18n/4 However, it is of less interest to determine precise bounds on θ(c (1, n) ) since it is very small in any case Concluding remarks The code T 1,2,,n,2 n 1 can not be equivalent to T 0,1,,n when n is odd This is because T 1,2,,n,2 n 1 has only even weights when n is odd, while T 0,1,,n has always one odd weight w(n + 1) The class of codes T 1,2,,n,2 n 1 described here have the same codeword length, dimension and minimum weight as the firstorder binary Reed-Muller codes [1], [8], if and only if n is even However, their weight distributions are quite different The first-order Reed-Muller codes are two-weight codes, while T 1,2,,n,2 n 1 has many weights w(m) When n 1, the minimum weight of T 1,2,,n,2 n 1 is still 2 n 1 When n 8 is even or n 1 is odd, the ternary code T 0,1,2,,n,2 n 1 has length 2 n and minimum weight 2 n 1 But its dimension is n+2 So T 0,1,2,,n,2 n 1 is better than the first-order binary Reed-Muller code as the former has one more dimension while they have the same codeword length and minimum weight References [1] I F Blake and R C Mullin, The Mathematical Theory of Coding New York: Academic Press, 1975 [2] G T Bogdanova and I G Boukliev, New linear codes of dimension 5 over GF (), in Proc 4th Int Workshop on Algebraic and Combinatorial Coding Theory, 1994, pp 41 4 17
[] C Ding, D R Kohel and S Ling, Elementary 2-group character codes, Preprint [4] C Ding, D R Kohel and S Ling, Secret sharing with a class of ternary codes, submitted manuscript, May 1999 [5] N Hamada, T Helleseth and Ø Ytrehus, The nonexistence of [51, 5, ; ]- codes, Ars Combinatoria, Vol 25, pp 25 2, 199 [] R Hill and D E Newton, Some optimal ternary linear codes, Ars Combinatoria, Vol 25-A, pp 1 72, 1988 [7] R Hill and D E Newton, Optimal ternary linear codes, Designs, Codes, and Cryptography, Vol 2, pp 17 157, 1992 [8] T Kløve, Reed-Muller codes for error detection, the good, the bad, and the ugly, IEEE Trans Inform Theory, Vol 42, pp 225 2272, 199 [9] T Kløve and V Korzhik, Error Detecting Codes, General Theory and their Application in Feedback Communication Systems Boston: Kluwer Acad Publ, 1995 [10] D E Knuth, The Art of Computer Programming, Vol 1, Second ed Reading: Addison-Wesley, 197 [11] V S Pless and W C Huffman, Handbook of Coding Theory, Vol 1 Amsterdam: North-Holland, 1998 [12] J-P Serre, A Course in Arithmetic, Graduate Texts in Mathematics 7 New York: Springer, 197 [1] M van Eupen, Five new optimal ternary linear codes, IEEE Trans Inform Theory, Vol 40, No 1, p 19, 199 [14] M van Eupen, Four nonexistence results for ternary linear codes, IEEE Trans Inform Theory, Vol 41, No, pp 800 805, 1995 [15] M van Eupen, Some new results for ternary linear codes of dimension 5 and, IEEE Trans Inform Theory, Vol 41, No, pp 2048 2051, 1995 [1] M van Eupen and J H van Lint, On the minimum distance of ternary cyclic codes, IEEE Trans Inform Theory, Vol 9, No 2, pp 409 422, 199 18
List of Tables 1 Weight distribution in T 1,2,,n,2 n 1 when n is even 7 2 Weight distribution in T 1,2,,n,2 n 1 when n is odd 8 Distribution of elements of GF () in u, where g := (m 1 2w) mod 10 4 The frequency distribution of the elements of GF () in u 10 5 The weight of u in Subcase I2 11 Weight distribution in T 0,1,2,,n,2 n 1 when n is even, where all a i and a are nonzero 1 7 Weight distribution in T 0,1,2,,n,2 n 1 when n is odd, where all a l and a are nonzero 1