[ieee 2012 information theory and applications workshop (ita) - san diego, ca, usa...

6
On some linear codes that are proper for error detection Torleiv Kløve Department of Informatics, University of Bergen, N-5020 Bergen, Norway Abstract—It is shown that, for all prime powers q and all k 3, if n (k - 1)q k - 2 q k -q q-1 , then there exists an [n, k; q] code that is proper for error detection. Index Terms—Linear codes, minimum distance. error detec- tion, proper codes. I. I NTRODUCTION We start by defining P ue (C, p), the undetected error proba- bility for an [n, k; q] code C when used on the q-ary symmetric channel with error probability p: P ue (C, p)= n i=1 A i p q - 1 i (1 - p) n-i , (1) where A i is the number of codewords having Hamming weight i, see e.g. [1, Section 2.1.2]. If P ue (C, p) is an increasing function on 0, q-1 q , the code C is called proper for error detection. Let P q,k denote the set of integers n for which a proper [n, k; q] code exists. It is believed that proper [n, k; q] codes exist for all n k 1 and prime powers q, that is, P q,k = {n | n k}, but this has not been proved. However, it is known that for a given k, proper [n, k; q] codes exist for n sufficiently large. The best general bound on ”sufficiently large” is [1, Theorem 2.64]: if n (q k - 1)(q k - 1 - q) q - 1 , then n P q,k . For q =2, this bound was recently improved in [2] to the following: if k 5 and n 2 k-1 ( 2 k-5 +2 (k-5)/2 ) , then n P 2,k . In [3] a further improvement for q =2 was given: if k 6 and n 2 2k-6 - 3 · 2 k-3 +2, then n P 2,k . Moreover, the [n, k] codes given in [3] are probably proper for n 2 2k-6 /k, but this has not been proved. Let D q,k be the set of [n, k, d; q] codes with dq n(q - 1). These codes are interesting in our context because of the following result (see e.g. [1, Theorem 2.15]). Lemma 1: If C ∈D q,k , then C ∈P q,k . To determine further ranges of values where proper [n, k; q] codes exist, one may therefore consider subsets of D q,k . We do this next. Further, we show that for each [n, k; q] code in this set, there exists a proper [n +1,k; q] code. In particular, we use these results to prove a substantial improvement of the bounds quoted above: Theorem 1: If k 3 and n (k - 1)q k - 2 q k - q q - 1 , then n P q,k . II. ON q - ARY MACDONALD CODES A class of codes in D 2,k [n, k, d; 2] was given by Mac- Donald [4]. A corresponding construction of codes in D q,k for any prime power q was given by MacWilliams [5]. These codes may be concatenated to produce further codes in D q,k , this was done by Solomon and Stiffler [6]. These codes have been called q-ary MacDonald codes. Let M q,k denote the set of q-ary MacDonald codes [n, k, d; q] codes, and let M q,k denote the set of values n such that there exists an [n, k, d; q] MacDonald code. We now describe the codes in M q,k . Let G k,0 be an k×(q k -1)/(q-1) matrix whose columns are non-zero and non-proportional. The code generated by G k,0 is the [(q k - 1)/(q - 1),k,q k-1 ; q] simplex code. For 1 i k - 1, let G k,i be the k × (q k - q i )/(q - 1) matrix G k,0 \ 0 G i,0 . This generates the [(q k - q i )/(q - 1),k,q k-1 - q i-1 ; q] code given by MacWilliams [5]. For a sequence (a 0 ,a 1 ,...,a k-1 ) of non-negative integers, not all zero, let G (a0,a1,...,a k-1 ) = a0 G k,0 |···|G k,0 | a1 G k,1 |···|G k,1 |··· ···| a k-1 G k,k-1 |···|G k,k-1 , and let C (a0,a1,...,a k-1 ) be the code generated by G (a0,a1,...,a k-1 ) . This is an [n, k, d; q] code where n = k-1 i=0 a i q k - q i q - 1 , (2) d = a 0 q k-1 + k-1 i=1 a i ( q k-1 - q i-1 ) . (3) Example 1: G 3,0 = 0000111111111 0111000111222 1012012012012 , G 3,1 = 000111111111 111000111222 012012012012 , G 3,2 = 111111111 000111222 012012012 ,

Upload: torleiv

Post on 01-Mar-2017

212 views

Category:

Documents


0 download

TRANSCRIPT

On some linear codes that are proper for errordetectionTorleiv Kløve

Department of Informatics, University of Bergen, N-5020 Bergen, Norway

Abstract—It is shown that, for all prime powers q and allk ! 3, if n ! (k " 1)qk " 2 qk!q

q!1, then there exists an [n, k; q]

code that is proper for error detection.Index Terms—Linear codes, minimum distance. error detec-

tion, proper codes.

I. INTRODUCTIONWe start by defining Pue(C, p), the undetected error proba-

bility for an [n, k; q] code C when used on the q-ary symmetricchannel with error probability p:

Pue(C, p) =n!

i=1

Ai

" p

q ! 1

#i(1! p)n!i, (1)

where Ai is the number of codewords having Hamming weighti, see e.g. [1, Section 2.1.2].If Pue(C, p) is an increasing function on

$

0, q!1q

%

, the codeC is called proper for error detection. Let Pq,k denote theset of integers n for which a proper [n, k; q] code exists. It isbelieved that proper [n, k; q] codes exist for all n " k " 1 andprime powers q, that is, Pq,k = {n | n " k}, but this has notbeen proved. However, it is known that for a given k, proper[n, k; q] codes exist for n sufficiently large. The best generalbound on ”sufficiently large” is [1, Theorem 2.64]:

if n "(qk ! 1)(qk ! 1! q)

q ! 1, then n # Pq,k.

For q = 2, this bound was recently improved in [2] to thefollowing:

if k " 5 and n " 2k!1&

2k!5 + 2"(k!5)/2#'

, then n # P2,k.

In [3] a further improvement for q = 2 was given:

if k " 6 and n " 22k!6 ! 3 · 2k!3 + 2, then n # P2,k.

Moreover, the [n, k] codes given in [3] are probably properfor n " 22k!6/k, but this has not been proved.Let Dq,k be the set of [n, k, d; q] codes with dq " n(q!1).These codes are interesting in our context because of the

following result (see e.g. [1, Theorem 2.15]).Lemma 1: If C # Dq,k, then C # Pq,k.To determine further ranges of values where proper [n, k; q]

codes exist, one may therefore consider subsets of Dq,k. Wedo this next. Further, we show that for each [n, k; q] code inthis set, there exists a proper [n+ 1, k; q] code. In particular,we use these results to prove a substantial improvement of thebounds quoted above:

Theorem 1:

If k " 3 and n " (k ! 1)qk ! 2qk ! q

q ! 1, then n # Pq,k.

II. ON q-ARY MACDONALD CODES

A class of codes in D2,k [n, k, d; 2] was given by Mac-Donald [4]. A corresponding construction of codes in Dq,k

for any prime power q was given by MacWilliams [5]. Thesecodes may be concatenated to produce further codes in Dq,k,this was done by Solomon and Stiffler [6]. These codes havebeen called q-ary MacDonald codes. Let Mq,k denote theset of q-ary MacDonald codes [n, k, d; q] codes, and let Mq,k

denote the set of values n such that there exists an [n, k, d; q]MacDonald code. We now describe the codes in Mq,k.LetGk,0 be an k$(qk!1)/(q!1) matrix whose columns are

non-zero and non-proportional. The code generated by Gk,0

is the [(qk ! 1)/(q ! 1), k, qk!1; q] simplex code.For 1 % i % k ! 1, let Gk,i be the k $ (qk ! qi)/(q ! 1)

matrixGk,0 \

(

0Gi,0

)

.

This generates the [(qk ! qi)/(q ! 1), k, qk!1 ! qi!1; q] codegiven by MacWilliams [5].For a sequence (a0, a1, . . . , ak!1) of non-negative integers,

not all zero, let

G(a0,a1,...,ak!1) =$

a0* +, -

Gk,0| · · · |Gk,0 |

a1* +, -

Gk,1| · · · |Gk,1 | · · ·

· · · |

ak!1* +, -

Gk,k!1| · · · |Gk,k!1

%

,

and let C(a0,a1,...,ak!1) be the code generated byG(a0,a1,...,ak!1). This is an [n, k, d; q] code where

n =k!1!

i=0

aiqk ! qi

q ! 1, (2)

d = a0 qk!1 +

k!1!

i=1

ai&

qk!1 ! qi!1'

. (3)

Example 1:

G3,0 =

.

/

000011111111101110001112221012012012012

0

1 ,

G3,1 =

.

/

000111111111111000111222012012012012

0

1 , G3,2 =

.

/

111111111000111222012012012

0

1 ,

G(0,2,1) =

.

/

000111111111 000111111111 111111111111000111222 111000111222 000111222012012012012 012012012012 012012012

0

1 .

We see that C(0,2,1) is a [33, 3, 22; 3] code.Patel [7] analysed the set Dq,k. There are codes in

Dq,k that are not equivalent to any code in Mq,k. Anexample is the [qk, k, qk!1(q ! 1); q] code generated by[G(q!1,0,0,...,0)|(0, 0, . . . , 0)

T ]. However, in this case there is acode in Mq,k with the same parameters, namely C(0,0,...,0,q).

We will show that the integers inMq,k have a representationof a particular form.Lemma 2: Let q " 2 and k " 2 be integers. An integer n

belongs to Mq,k if and only if it has the representation

n = !qk!1 +k!2!

i=0

!iqk ! qi

q ! 1, (4)

where 0 % !i % q ! 1 for 0 % i % k ! 2 and ! " 0.Proof: We note that qk!qk!1

q!1 = qk!1. The “if” part isobvious by the definition of Mq,k. We will show the “only if”part. We have

qqk ! qi

q ! 1= q · qk!1 +

qk ! qi+1

q ! 1. (5)

Let

n =k!1!

i=0

aiqk ! qi

q ! 1# Mq,k. (6)

Let "0 = 0, and for j = 0, 1, 2, . . . , k ! 2, let

aj + "j = "j+1q + !j where 0 % !j % q ! 1. (7)

Then, using (5), (7), and induction, we get

n =j!1!

i=0

!iqk ! qi

q ! 1+ (aj + "j)

qk ! qj

q ! 1+

k!2!

i=j+1

aiqk ! qi

q ! 1

+"

ak!1 + qj

!

i=0

"i#

qk!1, (8)

for j = 0, 1, . . . , k ! 2 and

n =k!2!

i=0

!iqk ! qi

q ! 1+"k!1q

k!1+"

ak!1+qk!1!

i=0

"i#

qk!1. (9)

We see that (8) is (6) with j = 0, and (9) is (4) where

! = "k!1 + ak!1 + qk!1!

i=0

"i " ak!1 " 0.

For our further analysis below, we have to consider thecodewords of smallest weight in a code in Mq,k.First, consider the code C generated by Gk,m, where

1 % m % k ! 1. Any non-zero codeword which is somelinear combination of the first k ! m rows in Gk,m hasweight qk!1. The remaining qk ! qk!m non-zero codewordshave weight qk!1 ! qm!1. Moreover, qk!1 ! qk!m!1 of

these codewords are zero in the least position, the remaining(qk!1 ! qk!m!1)(q ! 1) are non-zero in the least position.Lemma 3: If n # Mq,k, then n+ 1 # Pq,k.Proof: Let C be an [n, k, d; q] code in Mq,k. If n is

represented by (6) where ai = 0 for 0 % i < j and aj > 0,then we see, from the discussion above, that C has qk ! qk!j

non-zero codewords of minimum weight d, and qk!1!qk!1!j

of these have a zero in the last position. Let C1 be the [n +1, k, d; q] code obtained by duplication of the last element ineach codeword of C. Then C1 has qk!1 ! qk!1!j codewordsof minimum weight d and (qk!1! qk!1!j)(q!1) codewordsof weight d + 1 obtained from codewords of weight d in C.Let Bi denote the number of the remaining qk!j !1 non-zerocodewords in C1 of weight i (note that i " d+ 1). Then

Pue(C1, p) =n+1!

i=d+1

Bi

& p

q ! 1

'i(1! p)n+1!i

+&

qk!1 ! qk!1!j'& p

q ! 1

'd(1! p)n+1!d

+&

qk!1 ! qk!1!j'

(q ! 1)& p

q ! 1

'd+1(1! p)n!d

=n+1!

i=d+1

Bi

(q ! 1)ipi(1! p)n+1!i

+qk!1 ! qk!1!j

(q ! 1)d&

pd(1! p)n+1!d + pd+1(1! p)n!d'

.

For i " d+ 1 we havei

n+ 1"

d+ 1

n+ 1"

d

n"

q ! 1

q,

and sod

dppi(1! p)n+1!i = pi!1(1! p)n!i

&

i! (n+ 1)p'

" 0

for p # [0, (q ! 1)/q]. Further,d

dp

&

pd(1! p)n+1!d + pd+1(1! p)n!d'

= pd!1(1! p)n!d!1(d! np) " 0

for p # [0, (q ! 1)/q]. Hence, Pue(C1, p) is increasing on[0, (q ! 1)/q], that is, C1 is proper.

III. ON THE INTEGER REPRESENTATION

We will now determine which integers n have a represen-tation of the form (4).Lemma 4: Let q " 2 and k " 2 be integers. Every integer

n has a unique representation of the form

n = ! qk!1 +k!2!

i=0

!iqk ! qi

q ! 1where 0 % !i % q ! 1, (10)

! = !(n) may be positive or negative.Proof: Let

A =2n(q ! 1)

qk!1

3

and B = Aqk!1 ! n(q ! 1).

Since 0 % B % qk!1 ! 1, we can write

B =k!2!

i=0

!iqi where 0 % !i % q ! 1.

Then

n(q ! 1) ="

A! qk!2!

i=0

!i

#

qk!1 +k!2!

i=0

!i

&

qk ! qi'

. (11)

In particular, A! q4k!2

i=0 !i & 0 (mod q ! 1). Let

! =A! q

4k!2i=0 !i

q ! 1.

Then ! is an integer and (11) implies (10).Suppose that

n = # qk!1 +k!2!

i=0

#iqk ! qi

q ! 1where 0 % #i % q ! 1.

Then #0 & n & !0 (mod q), and so #0 = !0. Hence we seethat

! qk!2 +k!2!

i=1

!iqk!1 ! qi!1

q ! 1= # qk!2 +

k!2!

i=1

#iqk!1 ! qi!1

q ! 1,

and so #1 & !1 (mod q), which implies that #1 = !1.Repeating the argument, we see that #i = !i for i =0, 1, . . . , k ! 2 and so ! = #, that is, the representation (10)is unique.

IV. PROOF OF THEOREM 1Lemma 5: Let k " 3. For all

n " (k ! 1)qk !2qk ! 2

q ! 1,

n # Mq,k, except for

n = njdef= (k ! 1)qk !

2qk ! qj ! 1

q ! 1for 0 % j % k ! 2.

Proof: The largest n where ! < 0 in the representation(10) is clearly

n = !qk!1+k!2!

i=0

(q!1)qk ! qi

q ! 1= (k!1)qk!

qk ! 1

q ! 1. (12)

For n " (k! 1)qk ! 2qk!2q!1 , we have the following additional

values of n with ! < 0:

nj = !qk!1 +k!2!

i=0

(q ! 1)qk ! qi

q ! 1!

qk ! qj

q ! 1

for j = 0, 1, . . . , k ! 2.We can now prove Theorem 1. From Lemma 5 we can

conclude that all

n " (k ! 1)qk ! 2qk ! 1

q ! 1

belong to Pq,k, except possibly nj for 0 % j % k ! 1. Forj " 2, we have

nj ! nj!1 =qj ! qj!1

q ! 1= qj!1 " q " 2.

Hence, nj !1 # Mq,k and so nj # Pq,k by Lemma 3. We canconclude that if n " n1 + 1, then n # Pq,k. Since

n1 + 1 = (k ! 1)qk !2qk ! 2q

q ! 1,

this proves Theorem 1.

We note that since none of n1 and n0 belong to Mq,k andn1 = n0+1, the results given in this paper can not determineif n1 # Pq,k or not.We see that Lemmas 2 and 3 give proper codes also for

many n less than the bound in Theorem 1.Let Xq,k = {n " 1 | n '# Mq,k} and xq,k =

55Xq,k

55. We

saw above that the largest element of Xq,k is given by (12).The number of n # Mq,k less than or equal to this value is

(k ! 1)qk !qk ! 1

q ! 1! xq,k.

In the next section, we determine xq,k.

V. A FORMULA FOR xq,k

Lemma 6: We have

xq,k = !qk!1!1!

m=1

!(m)

Proof: By Lemmas 2 and 4, n # Xq,k if and only if!(n) < 0. By (10), !(n+ qk!1) = !(n) + 1. Hence, for anym # [1, qk!1 ! 1], we have55{n " 1 | !(n) < 0 and n & m (mod qk!1)}

55 = !!(m).

Summing over all m # [1, qk!1!1], the lemma follows. Notethat !(0) = 0.Lemma 7: For B # [1, qk!1 ! 1], let

B =k!2!

i=0

!iqi where 0 % !i % q ! 1.

Further, let

b =k!2!

i=0

!i,

t & b (mod q ! 1), t # [1, q ! 1],

andn =

tqk!1 !B

q ! 1.

Then n runs through [1, qk!1 ! 1] when B does, and

!(n) = !qb! t

q ! 1. (13)

Proof: First, we observe that

B & b & t (mod q ! 1),

and so n is an integer. We see that if B '= B$, then n '= n$.Further

n =tqk!1 !B

q ! 1"

qk!1 ! (qk!1 ! 1)

q ! 1> 0

and

n =tqk!1 !B

q ! 1%

(q ! 1)qk!1 ! 1

q ! 1< qk!1.

Hence, n # [1, qk!1 ! 1] and so n runs through [1, qk!1 ! 1]when B does. Finally,

n =tqk!1 ! bqk

q ! 1+

bqk !B

q ! 1

= !qb! t

q ! 1qk!1 +

k!2!

i=0

!iqk ! qi

q ! 1,

and so !(n) is as given in (13).For t # [1, q ! 1], let

"(q, k, t) =!

1"B"qk!1!1B#t (mod q!1)

qb! t

q ! 1.

By Lemmas 6 and 7, we get

xq,k =q!1!

t=1

"(q, k, t). (14)

We will use this to get a recursion for xq,k and in turn solvethis to get an explicit expression for xq,k.Lemma 8: For k " 1 we have

"(q, k+1, t) = t+xq,k+"(q, k, t)+qk!1 ! 1

q ! 1

"q(q + 1)

2!t

#

.

Proof: We consider B # [1, qk], and the correspondingvalues b and t. For B$ # [1, qk!1], we denote the correspond-ing values by b$ and t$. Any B is of the form B = qB$ + #,where 0 % # % q ! 1. We get b = b$ + # and t & t$ + #(mod q ! 1). We get one B when B$ = 0 and # = t. Thecorresponding contribution to "(q, k+1, t) is t. The remainingB are obtained when B$ runs through [1, qk!1 ! 1] and # isdetermined by b = b$ + #. Hence, for a given #, we considerthe B$ for which

t$ =

6

t! # if t! # " 1,t! # + (q ! 1) if t! # % 0.

(15)

We get

qb! t

q ! 1=

7qb$!t$

q!1 if t! # " 1,qb$!t$

q!1 + 1 if t! # % 0.(16)

We note that there are #(qk!1 ! 1)/(q ! 1) such B$. Hence

"(q, k + 1, t)

= t+t!1!

!=0

8

"(q, k, t! #) + #qk!1 ! 1

q ! 1

9

+q!1!

!=t

8

"(q, k, t! # + (q ! 1)) + (# + 1)qk!1 ! 1

q ! 1

9

= t+q!1!

i=1

"(q, k, i) + "(q, k, t)

+qk!1 ! 1

q ! 1

"q(q + 1)

2! t

#

.

Lemma 9: For k " 2 we have

xq,k = q xq,k!1 +qk ! q

2.

Proof: By Lemma 8 we have

xq,k =q!1!

t=1

"(q, k, t)

=q!1!

t=1

8

t+ xq,k!1 + "(q, k ! 1, t)

+qk!2 ! 1

q ! 1

"q(q + 1)

2! t

#9

=q(q ! 1)

2+ (q ! 1)xq,k!1 + xq,k!1

+qk!2 ! 1

q ! 1

" (q ! 1)q(q + 1)

2!

q(q ! 1)

2

#

.

Simplifying this expression, the lemma follows.Since xq,1 = 0, Lemma 9 and induction gives the followingtheoremTheorem 2: For k " 1 we have

xq,k =kqk

2!

qk+1 ! q

2(q ! 1).

We showed above that all n " (k!1)qk! qk!1q!1 +1 belong

to Mq,k. Theorem 2 shows that exactly half of the smaller nalso belongs to Mq,k.We can also determine "(q, k, t).Theorem 3: For k " 1 and 1 % t % q ! 1 we have

"(q, k, t) = (k! 1)qk ! q2

2(q ! 1)! t

8qk!1 ! 1

(q ! 1)2! (k! 1)

q

q ! 1

9

.

Proof: For 1 % t % q ! 2, let

$(q, k, t) = "(q, k, t)! "(q, k, t+ 1).

We have $(q, 1, t) = 0 for all t. From Lemma 8 we get

$(q, k + 1, t) = !1 + $(q, k, t) +qk!1 ! 1

q ! 1

for k " 1. Hence, induction on k proves that

$(q, k, t) =!1

q ! 1

8

(k ! 1)q !qk!1 ! 1

q ! 1

9

. (17)

In particular, $(q, k, t) is independent of t. Therefore, we willwrite just $(q, k). We get

"(q, k, t) = "(q, k, 1)! (t! 1)$(q, k). (18)

Hence

xq,k =q!1!

t=1

"(q, k, t) = (q!1)"(q, k, 1)!(q ! 1)(q ! 2)

2$(q, k),

and so"(q, k, 1) =

xq,k

q ! 1+

(q ! 2)$(q, k)

2.

From (17) we get

"(q, k, 1) =xq,k

q ! 1!

q ! 2

2(q ! 1)

8

(k ! 1)q !qk!1 ! 1

q ! 1

9

.

Combining this and the expression for xq,k given in Theorem2 we get, after simplification, that

"(q, k, 1) = (k! 1)qk ! q2

2(q ! 1)!8qk!1 ! 1

(q ! 1)2! (k! 1)

q

q ! 1

9

.

Substituting this in (18) and simplifying, we get the theorem.

VI. THE GAIN FROM LEMMA 3Next, let

Yq,k = {n # Xq,k | n! 1 # Mq,k} (19)

and yq,k =55Yq,k

55.

Lemma 3 gives proper codes outsideMq,k in yq,k cases. Bydefinition, n contributes to yq,k if n '# Mq,k and n!1 # Mq,k.We will determine the set Yq,k defined by (19).Let n # Yq,k. By Lemma 2,

n! 1 = ! qk!1 +k!2!

i=0

!iqk ! qi

q ! 1,

where 0 % !i % q ! 1 and ! " 0. By Lemma 4,

n = # qk!1 +k!2!

i=0

#iqk ! qi

q ! 1,

where 0 % #i % q ! 1. Moreover, n # Mq,k if and only if# " 0. We consider a number of cases.

• If !0 = q ! 1, then !0qk!1q!1 + 1 = q · qk!1. Hence

# = !+ q > 0, and so n '# Yq,k.• If !0 < q ! 1 and !1 > 0, then

!0qk ! 1

q ! 1+ !1

qk ! q

q ! 1+ 1

= (!0 + 1)qk ! 1

q ! 1+ (!1 ! 1)

qk ! q

q ! 1.

Hence # = ! " 0 and so n '# Yq,k.

• If !0 % q ! 2 and !i = 0 for all i " 1, then

n = ! qk!1 + !0qk ! 1

q ! 1+ 1

=&

!! 1! (k ! 2)q'

qk!1 + (!0 + 1)qk ! 1

q ! 1

+k!2!

i=1

(q ! 1)qk ! qi

q ! 1.

Hence, # = ! ! 1 ! (k ! 2)q % !1 if and only if0 % ! % (k ! 2)q. Moreover, if !0 = 0, then we musthave ! " 1. In all, this gives

&

(k ! 2)q + 1'

(q ! 1)! 1elements in Yq,k.

• If !0 % q! 2, !i = 0 for 1 % i % j ! 1, and !j > 0 forsome j, where 2 % j % k ! 2, then

n = ! qk!1 + !0qk ! 1

q ! 1+

k!2!

i=j

!iqk ! qi

q ! 1+ 1

=&

!! (j ! 1)q'

qk!1 + (!0 + 1)qk ! 1

q ! 1

+j!1!

i=2

(q ! 1)qk ! qi

q ! 1+ (!j ! 1)

qk ! qj

q ! 1

+k!2!

i=j+1

!iqk ! qi

q ! 1.

Hence, can choose ! in (j ! 1)q ways, !0 and !j in(q ! 1) ways, and !i in q ways for j + 1 % i % k ! 2.This gives (j ! 1)q(q ! 1)2 qk!2!j elements in Yq,k.

Theorem 4: For q " 2 and k " 2, we have yq,k = qk!1!2.Proof: From the description of Yq,k above, we see that

yq,k =&

(k ! 2)q + 1'

(q ! 1)! 1

+k!2!

j=2

(j ! 1)(q ! 1)2 qk!1!j

= qk!1 ! 2.

VII. SUMMARY

We have studied codes with large minimum distance toproduce codes that are proper for error detection. We haveshown that for all n " (k!1)qk!2 qk!q

q!1 there exists a proper[n, k; q] code. This is a substantial improvement over previoussuch results. Further, we have produced proper codes also formore than half of smaller values of n.

ACKNOWLEDGEMENT

This work is supported by the Norwegian Research Councilby grant 191104/V30.

REFERENCES[1] T. Kløve, Codes for Error Detection, World Scientific Publishing Com-

pany, 2007.[2] T. Kløve and S. Yari, “Proper self-complementary codes”, Proceed-

ings, 2010 Int. Symposium on Information Theory and its Applications,Taichung, Taiwan, October 17-20, 2010, pp. 118–122.

[3] M. Baldi, M. Bianchi, F. Chiaraluce, T. Kløve, “A class of puncturedsimplex codes which are proper for error detection”, arxiv.org/1111.5484[cs.IT], November 24, 2011.

[4] J. E. MacDonald, “Design methods for maximum minimum-distance errorcorrecting codes”, IBM J. Res. Develop., vol. 4, pp. 34–37, 1960.

[5] J. MacWilliams, “Error-correcting codes for multiple-level transmission”,Bell System Tech. J., vol. 40, pp. 281–308, 1961. Bell System Tech. J.40 (1961), 281-308

[6] G. Solomon and J. J. Stiffler, “Algebraically punctured cyclic codes”,Inform. Contr., vol. 8, pp. 170–179, 1965.

[7] A. Patel, “Maximal q-nary linear codes with large minimum distance”,IEEE Trans. Inform. Theory, vol. 21, pp. 106–110, 1975.