A lower bound on the undetected error probability and strictly optimal codes

14
IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997 1489 A Lower Bound on the Undetected Error Probability and Strictly Optimal Codes Khaled A. S. Abdel-Ghaffar Abstract—Error detection is a simple technique used in various communication and memory systems to enhance reliability. We study the probability that a -ary (linear or nonlinear) block code of length and size fails to detect an error. A lower bound on this undetected error probability is derived in terms of , , and . The new bound improves upon other bounds mentioned in the literature, even those that hold only for linear codes. Block codes whose undetected error probability equals the new lower bound are investigated. We call these codes strictly optimal codes and give a combinatorial characterization of them. We also present necessary and sufficient conditions for their existence. In particular, we find all values of and for which strictly optimal binary codes exist, and determine the structure of all of them. For example, we construct strictly optimal binary-coded decimal codes of length four and five, and we show that these are the only possible lengths of such codes. Index Terms—Block codes, distance enumerators, error detec- tion, optimal codes. I. INTRODUCTION E RROR detection is used extensively in communication and computer systems to combat noise. Detection is accomplished by examining the received word. If it is a codeword, the word is accepted as error-free. If it is not a codeword, the word is rejected as being erroneous. Further processing may be needed in this case to retrieve the trans- mitted information. An error-detecting scheme fails to detect an error if the received word is a codeword different from the transmitted codeword. In this paper, we derive a lower bound on the undetected error probability for linear and nonlinear block codes used solely for error detection and present codes that meet this lower bound. Let be a -ary code of length and size , where , , and , i.e., is a set of sequences of length whose components belong to an alphabet of letters, which we assume to be . Such a code is referred to as an code and the sequences are called codewords. A codeword is represented as . We assume that each codeword is transmitted with probability and that each letter is equally likely to suffer from an error that changes it into any one of the other letters with probability , independently of all other letters. Manuscript received July 24, 1995; revised January 13, 1997. This work was supported in part by the National Science Foundation under Grants NCR- 9115423 and NCR-9612354. The material in this paper was presented in part at the IEEE International Symposium on Information Theory, Whistler, BC, Canada, September 1995. The author is with the Department of Electrical and Computer Engineering, University of California, Davis, CA 95616 USA. Publisher Item Identifier S 0018-9448(97)05319-4. In most practical applications, the probability that a letter is received correctly is at least equal to the probability that it is received as any other given letter. Therefore, we assume that . For , let be the number of codewords at distance from . The numbers are called the distance enumerators with respect to the codeword . Let for , be the average distance enumerators of the code. Clearly, and (1) If the code is linear, then does not depend on and the average distance enumerators are the same as the weight enumerators of the code [25]. In general, the undetected error probability for the code is given by (2) Notice that and (3) In this paper, we are interested in optimal codes for error detection, i.e., codes whose undetected error probability is minimal over all codes. The following is a motivat- ing example that considers binary-coded decimal codes, i.e., binary codes whose ten codewords can be used to represent the ten decimal numbers. Example 1: The two-out-of-five code [8] has ten codewords given by the ten binary sequences of length five with exactly two ones in each sequence. This code was used extensively in the early Bell Laboratories relay computers for error detection [3], [7]. Its average distance enumerators are , , , , , for respectively. From (2), its undetected error probability equals . We may wonder whether or not this code is optimal for error detection, i.e., if its undetected error probability is minimal over all codes. The answer is no. Consider the binary code consisting of the five sequences of length five containing exactly a single one and the five sequences of length five containing exactly four ones. This “one-or-four-out-of-five” code has the average distance enumerators , , , , , for respectively, and its undetected error probability 0018–9448/97$10.00 1997 IEEE

Transcript of A lower bound on the undetected error probability and strictly optimal codes

IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997 1489

A Lower Bound on the Undetected ErrorProbability and Strictly Optimal Codes

Khaled A. S. Abdel-Ghaffar

Abstract—Error detection is a simple technique used in variouscommunication and memory systems to enhance reliability. Westudy the probability that a q-ary (linear or nonlinear) block codeof length n and sizeM fails to detect an error. A lower boundon this undetected error probability is derived in terms of q, n,and M . The new bound improves upon other bounds mentionedin the literature, even those that hold only for linear codes.Block codes whose undetected error probability equals the newlower bound are investigated. We call these codes strictly optimalcodes and give a combinatorial characterization of them. We alsopresent necessary and sufficient conditions for their existence.In particular, we find all values of n and M for which strictlyoptimal binary codes exist, and determine the structure of all ofthem. For example, we construct strictly optimal binary-codeddecimal codes of length four and five, and we show that these arethe only possible lengths of such codes.

Index Terms—Block codes, distance enumerators, error detec-tion, optimal codes.

I. INTRODUCTION

ERROR detection is used extensively in communicationand computer systems to combat noise. Detection is

accomplished by examining the received word. If it is acodeword, the word is accepted as error-free. If it is not acodeword, the word is rejected as being erroneous. Furtherprocessing may be needed in this case to retrieve the trans-mitted information. An error-detecting scheme fails to detectan error if the received word is a codeword different from thetransmitted codeword. In this paper, we derive a lower boundon the undetected error probability for linear and nonlinearblock codes used solely for error detection and present codesthat meet this lower bound.

Let be a -ary code of length and size , where, , and , i.e., is a set of sequences

of length whose components belong to an alphabet ofletters, which we assume to be . Such a codeis referred to as an code and the sequences arecalled codewords. A codewordis represented as .We assume that each codeword is transmitted with probability

and that each letter is equally likely to suffer from anerror that changes it into any one of the other letterswith probability , independently of all other letters.

Manuscript received July 24, 1995; revised January 13, 1997. This workwas supported in part by the National Science Foundation under Grants NCR-9115423 and NCR-9612354. The material in this paper was presented in partat the IEEE International Symposium on Information Theory, Whistler, BC,Canada, September 1995.

The author is with the Department of Electrical and Computer Engineering,University of California, Davis, CA 95616 USA.

Publisher Item Identifier S 0018-9448(97)05319-4.

In most practical applications, the probability that aletter is received correctly is at least equal to the probability

that it is received as any other given letter. Therefore,we assume that .

For , let be the number of codewordsat distance from . The numbers are calledthe distance enumerators with respect to the codeword. Let

for , be the average distance enumerators of thecode. Clearly,

and (1)

If the code is linear, then does not depend on andthe average distance enumerators are the same as the weightenumerators of the code [25]. In general, the undetected errorprobability for the code is given by

(2)

Notice that

and (3)

In this paper, we are interested in optimal codes for errordetection, i.e., codes whose undetected error probability isminimal over all codes. The following is a motivat-ing example that considers binary-coded decimal codes, i.e.,binary codes whose ten codewords can be used torepresent the ten decimal numbers.

Example 1: The two-out-of-five code [8] has ten codewordsgiven by the ten binary sequences of length five with exactlytwo ones in each sequence. This code was used extensively inthe early Bell Laboratories relay computers for error detection[3], [7]. Its average distance enumerators are, , , , ,

for respectively. From (2), its undetectederror probability equals . We maywonder whether or not this code is optimal for error detection,i.e., if its undetected error probability is minimal over all

codes. The answer is no. Consider the binary codeconsisting of the five sequences of length five containingexactly a single one and the five sequences of length fivecontaining exactly four ones. This “one-or-four-out-of-five”code has the average distance enumerators, , , , , for

respectively, and its undetected error probability

0018–9448/97$10.00 1997 IEEE

1490 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

Fig. 1. The undetected error probabilitiesPud(C; �) of the two-out-of-five code and the one-or-four-out-of-five code (Example 1).

equals . Fig. 1 shows the undetected errorprobabilities of the two codes. Clearly, the one-or-four-out-of-five code is better than the two-out-of-five code. In fact, wewill show that for all , the one-or-four-out-of-fivecode is optimal for error detection.

As can be seen from (2), a code has smaller undetectederror probability, for small values of, than any other codewith smaller minimum distance. Thus solving the problem ofdetermining the minimum undetected error probability attainedby codes implies solving the problem of determiningthe maximum–minimum distance attained by such codes.Actually, the first problem is much more difficult than thesecond one since two codes may have the same minimumdistance but different undetected error probabilities, as shownin Example 1. In fact, for a given, the undetected errorprobability of a code may be larger than that of another codewith smaller minimum distance.

Most, but not all, of the work reported in the literatureregarding the undetected error probability is restricted tobinary linear codes. Korzhik [19] derived a lower bound on theundetected error probability of linear codes and demonstratedthat linear codes whose nonzero codewords have weight

attain this bound. These codes only exist ifis divisible by . Levenshtein [24] presented two lower

bounds on the undetected error probability of linear or nonlin-ear binary codes. Wolf, Michelson, and Levesque [32] deriveda lower bound for binary linear codes that was generalizedrecently by Kløve [15] to nonbinary linear codes. Asymptoticresults on the undetected error probability of optimal binarylinear codes can be found in [19], [21], and [24].

Upper bounds on the undetected error probability for opti-mal linear codes are studied in [10], [12], [19], [24], and [32].

These bounds imply the existence of linear codes withundetected error probability of at most . In fact,it was believed that this upper bound holds for all codes sinceit was assumed that, for any code , isnondecreasing asincreases from to and therefore

attains its maximum of at ,as given in (3) [9]. However, this assumption was shown to bewrong by exhibiting codes that do not obey the above upperbound (see, e.g., [20] and [23]). An code is said tobe “proper” if is nondecreasing asincreases from

to [22]. Proper codes are nice to use to ensurean acceptable undetected error probability in case the exactvalue of in the range is not known.(Bounds on the worst case undetected error probabilities arestudied in [16].)

Example 2: Let be the code consisting of allbinary sequences of length and weight one. Since any twodistinct codewords differ in exactly two indices

ifotherwise

where . From (2), . Itcan be shown that is proper if and only if

Although the upper bounds derived in [10], [12], [19], [24],and [32] are actually stronger than the bound , theproofs used to derive these bounds are all existence proofs.Surprisingly, only a few classes of codes are known to obeythe bound . The known classes of proper binarycodes include perfect codes and their duals, single-parity codesand their duals, extended Hamming codes (with an overall par-ity check), and some Bose–Chaudhuri–Hocquenghem (BCH)codes [18], [22]. For nonbinary codes, Kasami and Lin [11]

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1491

proved that MDS codes are proper. Necessary and sufficientconditions for a code to be proper are presented in [6], [13],[26], and [27].

Next, we briefly review the literature related to optimalcodes for error detection. All results consider only linearcodes. One result by Korzhik [19] in this direction has beenmentioned already. Leont’ev [21] and Padovani and Wolf [26]have shown that a binary code is optimal for error detectionfor all if and only if its dual code is optimalfor error detection for all . Based on this andthe result of Korzhik, they concluded that Hamming codes areoptimal. Kløve [14] specified optimal binary linearcodes for and . Other interesting results canbe found in [14]. In general, for an excellent up-to-date sourceof information regarding the theory and applications of errordetection, the reader may refer to [18].

In Section II, we derive a new lower bound on the un-detected error probability of block codes. We show that thisbound improves upon the previously known bounds. The newbound is also more general than other bounds in the sensethat it holds for linear and nonlinear codes over any alphabet.In Section III, we study codes that meet the lower bound.These codes, which we call strictly optimal codes, do not existfor all choices of , , and . We show that a necessarycondition for an code to be strictly optimal is thatits minimum distance equals . Althoughthis condition is not sufficient in general for a code to bestrictly optimal, we show that it is sufficient in case isan integer power of and, in particular, if is linear. Thusif is an integer power of , is strictly optimal if andonly if it is a maximum-distance-separable code. We alsodetermine all values of and for which strictly optimalbinary codes exist, and characterize all such codes.For example, the one-or-four-out-of-five code of length fiveintroduced in Example 1 is strictly optimal. We show thatfour and five are the only possible lengths of strictly optimalbinary-coded decimal codes. We then prove that all strictlyoptimal codes are proper. Section IV summarizes the resultsof this paper.

II. L OWER BOUND

A. Preliminaries

We derive an expression for in terms of certainparameters related to the average distanceenumerators of the code . Define

(4)

where , , and. Clearly,

(5)

Furthermore, define for

(6)

and

(7)

Lemma 1: Let be an code. For

Proof: The result follows from (1) and (7) in case .Therefore, we assume in the following that . Fora given codeword , let us form an

array as follows. The rows are labeledby codewords different from and the columns are labeledby subsets of indices in . If is suchcodeword and is such set, then the entry in therow labeled by and the column labeled byequals one if

and zero if otherwise. There are exactly

codewords in different from .Hence, the column labeled by has exactly thatmany ones. On the other hand, if differs from in exactly

indices, then

if and only if the set does not include any ofthe indices in which and differ. There are exactlysubsets of of indices that do not include anygiven indices. Hence, the row labeled byhas exactly thatmany ones. Summing the total number of ones in the arrayin two different ways depending on whether rows or columnsare considered first, we get

The lemma follows by averaging over all codewordsin .The system of equations given in Lemma 1 can be solved

for , where , as shown in the followinglemma.

Lemma 2: The system of equations

(8)

holds for if and only if the system of equations

(9)

holds for .

1492 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

Proof: Notice that (8) maps tolinearly, and this map is invertible. Hence, it suffices to showthat (8) implies (9). Clearly, (8) for implies that

, which agrees with (9). We will complete the proofby induction on . Suppose that are as givenin (9), where . Then, (8) implies that

as given in (9).Based on the parameters , we will derive

an expression for the undetected error probability ofthe code .

Theorem 1: The undetected error probability for thecode is given by

Proof: From (2) and Lemmas 1 and 2, we have

The proof is completed using the binomial theorem.

B. Derivation

We derive a lower bound on based on the expres-sion given in Theorem 1. We will make use of the followingresult.

Lemma 3: Given nonnegative integers thatsum to

where equality holds if and only iffor .

Proof: First, suppose that .Without loss of generality, we may assume that .Define , , andfor . Then, the integers arenonnegative and they sum to . Furthermore,

Hence, the minimum of is attained only if. If this is the case, then let of the

’s equal , where , and the remainingof them equal . Then

Hence, , , and theinequality stated in the lemma becomes an equality.

Define

(10)

The following lemma gives a bound on for anycode in terms of .

Lemma 4: Let be an code. Then for

with equality in case . Equality holds in caseif and only if

for all and.

Proof: The result holds for from (7) and (10).Therefore, assume in the following that . Let

be fixed integers such that. Furthermore, let be equal to

as each of runsover . Then, (5) implies that ,where . Applying Lemma 3 to the inner sumin (6) and noticing that there are exactly choices for

, we obtain

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1493

The lower bound is precisely equal to as definedin (10).

Let

(11)

The following is the main result of this section. It presents alower bound on for any code .

Theorem 2: Let be an code and. Then, the undetected error probability of the code

satisfies the bound

with equality whenever or . For, equality holds if and only if there are at least

and at most codewords that agree on anygiven indices, where .

Proof: The cases and followeasily from (3), (10), and (11). Assume in the following that

. From Theorem 1, Lemma 4, and (11),it follows that , with equality if andonly if

for all , , and. From (4), this condition is

equivalent to the condition that there are at leastand at most codewords that agree on any given

indices, where . Clearly, this holdsalso if for any code.

In the special case when , where is a nonnegativeinteger, which covers the case of linear codes, (10) gives

ifif

and (11) gives

(12)

The bound given in Theorem 2 depends only on the lengthof the code , its size , and the size of its alphabet. Inthe following, we compare this bound with similar boundsreported in the literature.

C. Comparison with the Kløve–Wolf–Michelson–LevesqueBound

A lower bound that holds for linear codes was recentlyderived by Kløve [15], [17] and stated in the followingproposition.

Proposition 1: Let be an linear code and. Then

This lower bound generalizes a bound derived by Wolf,Michelson, and Levesque [32] in case . Proposition 1 isbased on inequalities between the probabilities of the cosetsof a linear code and the probability of the code itself [2],[28], [31]. We will call the bound in Proposition 1 the KWMLbound and denote it by , i.e.,

(13)

We show that the new bound derived in this paper is not onlymore general than the KWML bound, in the sense that it holdsfor linear and nonlinear codes while the KWML bound holdsonly for linear codes, but it is also tighter.

Proposition 2: For and

and equality holds if and only if , , ,or .

Proof: Expressing the sum in (12) overas the difference between the sum over

and the sum over , we obtain

Using (13), we obtain

(14)

We notice that

if , , , or . In the following,we assume that and . For

1494 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

such

if and only if the expression in brackets (14) is positive. Letdenote this expression, where , i.e.,

Since , is an increasing function ofif is fixed. Therefore,

(15)

Since , i.e., andis an increasing function of, we have

and

This and (15) imply that which provesthat

where and .

D. Comparison with Levenshtein’s Extended Bound

Levenshtein [24] deduced the following lower bound onthe undetected error probability for any code, where

. This bound is called the extended bound as it extendsprevious bounds that hold for binary linear codes.

Proposition 3: Let be an code and .Then, for any number such that

we have

where

We mention some interesting consequences of Proposition 3that were pointed out by Levenshtein [24]. Substituting

in case this number is nonnegativegives the bound

(16)

which follows from results obtained by Leont’ev [21] for linearcodes. On the other hand, in the limit astends to ,

tends to and Proposition 3 gives the bound

(17)which was derived by Korzhik [9] in case of linear codes.

Next, we compare our bound presented in Theorem 2 withthe extended bound. The following result shows that our boundimplies (16).

Proposition 4: For and ,we have

and equality holds if and only if or .Proof: First we notice by substituting

where , that

(18)

and equality holds if and only if is divisible by . Sincethe left-hand side equals zero whenever ,we have from (10) and (11) that

and equalities hold if and only if or .

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1495

Fig. 2. The boundP (12; 256; 2; �), the best extended bound, and the minimum-distance (MD) bounds for linear and nonlinear codes in casen = 12,M = 256, and q = 2 (Example 3).

Hence, our bound is tighter than (16). In comparing betweenthe Korzhik bound (17) and the bound of Theorem 2 in case

, we notice the following.

• The bound of Theorem 2 is tighter than the Korzhikbound (17) for sufficiently small whenever

. On the otherhand, if , then theKorzhik bound is tighter for sufficiently small .

• If and is odd, then the bound of Theorem 2is tighter than the Korzhik bound for sufficiently large

. This can be verified as follows. Both boundsequal when . On the other hand, itcan be shown using (18) that the derivative with respectto of is less than the derivative of theKorzhik bound at .

• If , then the bound of Theorem 2 is tighterthan the Korzhik bound for sufficiently large .This can be verified as follows. If is odd, then thisfollows from the previous remark. Therefore, assume that

is even. Then, the two bounds are equal atand their first derivatives with respect toare also equalat . However, it can be shown using (18) thatthe second derivative of is larger than thesecond derivative of the Korzhik bound at .

Of course, in order to obtain the best extended bound fromProposition 3, we have to substitute a value forsuch that

is minimum. The minimum is at most equal to, which is the value used to derive the Korzhik

bound. Furthermore, astends to , the value of used inProposition 3 has to approach and therefore the bestbound obtained from this proposition approaches the Korzhikbound. Hence, in comparing between the best extended bound

and the bound of Theorem 2, we can use the comparison withthe Korzhik bound to deduce the following.

• The best extended bound is tighter than the boundof Theorem 2 for sufficiently small whenever

.• If and is odd, then the bound of Theorem 2 is

tighter than the best extended bound for sufficiently large.

• If , then the bound of Theorem 2 istighter than the best extended bound for sufficiently large

.

Example 3: Let and . It can be shownthat the optimal value of , where

that minimizes of Proposition 3 is given by

ifif

Fig. 2 shows the bound of Theorem 2 and theextended bound of Proposition 3 using the optimal value of. Clearly, the bound of Theorem 2 improves upon the best

extended bound.

E. Comparison with Levenshtein’s Minimum-Distance Bound

Levenshtein [24] derived the following lower bound, calledthe minimum-distance bound, on the undetected error proba-bility of any code, where . Let be themaximum–minimum distance attained by an code and

be the maximum–minimum distance attained by anlinear code.

1496 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

Proposition 5: Let be an code and .Then

If is linear, then

The functions and are not known ingeneral. Therefore, some upper bounds on these functions areused instead [24].

In comparing between the minimum-distance bound and thelower bound of Theorem 2, we notice the following generalobservations.

• The minimum-distance bound is tighter than the boundof Theorem 2 for sufficiently small whenever

or

in case of linear codes.• The bound of Theorem 2 is tighter than the minimum-

distance bound for sufficiently large whenever.

Example 3 (continued):From [25] and [4], we haveand , respectively. Fig. 2

shows the minimum-distance bound for linear and nonlinearcodes in case and as a function of , where

. The bound of Theorem 2 improves upon theminimum-distance bound if and upon theminimum-distance bound of linear codes if

III. STRICTLY OPTIMAL CODES

We say that an code is strictly optimal if it hasat least and at most codewords that agree onany given indices, i.e., if

(19)

for all , , and.

The following result shows that a codeis strictly optimalif and only if its undetected error probability equalsthe lower bound presented in Theorem 2 for

.Theorem 3: Let be an code. The following are

equivalent.

i) is strictly optimal.ii) For all , where

iii) For some , where

iv) For .

v) For

Proof: Theorem 2 implies the equivalence of i) and ii)and of i) and iii). The equivalence of i) and iv) follows fromLemma 4. The equivalence of iv) and v) follows from Lemmas1 and 2, and (10).

In particular, strictly optimal codes are optimal for errordetection. This section is devoted to the study of these codes.

Let be an code, where . Recall that theminimum distance of is the maximum integer such thatany two distinct codewords in differ in at least indices. Forconvenience, we define the minimum distance of anycode to be . First we give a well-known upper bound onthe minimum distance of any code.

Lemma 5: Let be an code of minimum distance. Then, .

Proof: The case is obvious. For , notwo distinct codewords agree on indices. Hence,

, i.e., .Next, we give a necessary condition for a code to be strictly

optimal in terms of its minimum distance.Lemma 6: Let be a strictly optimal code. Then,

its minimum distance is .Proof: Strict optimality implies that no two distinct code-

words agree on indices. Hence, .The result now follows from Lemma 5.

The condition stated in Lemma 6 on the minimum distanceis necessary for a code to be strictly optimal but it is notsufficient, as can be seen by considering the two-out-of-fivecode of Example 1. However, we show that if is an integerpower of , then the condition is also sufficient.

Lemma 7: Let be an code of minimum distance, where is an integer power of. Then,

is strictly optimal.Proof: We show that (19) is satisfied. Since no two

distinct codewords agree on any given indices, itfollows that (19) holds for . Next, suppose that

and . If

then has two distinct codewords thatagree on any given indices, in addition tothe indices . Hence, these two codewords differ inat most indices, which contradicts the definition of.Therefore,

for all . Since

it follows that

and (19) holds.

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1497

An code , where is an integer power of ,is called maximum-distance-separable (MDS) if its minimumdistance equals [25], [30]. Combining Lemmas6 and 7 with the fact that an linear code exists onlyif is an integer power of, we obtain the following result.

Theorem 4: If is an integer power of, then ancode is strictly optimal if and only if it is MDS. In particular,an linear code is strictly optimal if and only if it isMDS.

We give a necessary condition for the existence of strictlyoptimal codes.

Proposition 6: A necessary condition for the existence ofa strictly optimal code, where , is theinequality at the bottom of this page.

Proof: Let be a strictly optimal code. Thenequals the sum given in part v) of Theorem 3. Notice

that all terms for which in this sumare zero. In particular, is the sum of thetwo terms corresponding to and

. Since the average distance enumeratorsof any code are nonnegative, we have ,which gives the condition stated in the proposition.

Example 4: Proposition 6 shows that there is no strictlyoptimal code if . The bound presented for thisexample is tight since

is a strictly optimal code.Notice that in case is a power of , the condition in

Proposition 6 reduces to . This is awell-known necessary condition for the existence of MDScodes [25], [30]. Our derivation generalizes the derivation ofRobillard for the special case of MDS codes [29].

The next two lemmas describe techniques to constructstrictly optimal codes from a given strictly optimal code. Letbe an code, where . For , define

i.e., the sequences in are obtained by deleting the last letter,which is , from the sequences in .

Lemma 8: If is a strictly optimal code where, then for

and is a strictly optimal code. Furthermore,

Proof: Clearly,

Furthermore, since and is strictly optimal,then (19) implies that satisfies the stated bounds. To showthat is strictly optimal, we verify that (19) holds. Supposethat and . Since

and is strictly optimal, then eitherequals or . In particular

where

Let be the number of sequences , where, such that .

Hence

Since , we have

and

From the definition of , we conclude that there aresequences such that

and sequences such that

If is not divisible by , thenand (19) holds for the code . On the other hand, if isdivisible by , then

for all , and again (19) holds.Let be an code, where .

Define the set-theoretic complement of, denoted by , tobe the code consisting of all sequences of

letters in that do not belong to , i.e.,. The following lemma follows readily

from the definition of strict optimality.

1498 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

TABLE ICODEWORD WEIGHTS OF STRICTLY OPTIMAL (n;M)2 CODES.

Lemma 9: An code , where , isstrictly optimal if and only if its set-theoretic complementis a strictly optimal code.

The following theorem, whose proof is provided in theAppendix, determines all values ofand for which strictlyoptimal binary codes exist, and specify the structureof all of them. First, we need some definitions. Letand betwo codes. We say that is a shift of if there existsa binary sequence such that ,where

and denotes the sum reduced modulo two. Inthis case, we say that and are equivalent up to a shift.Clearly, is strictly optimal if and only if is strictly optimal.

Theorem 5: A strictly optimal code, where andare positive integers and , exists if and only if one

of the following conditions holds:

• .• and .• is odd and

• is even and

Furthermore, any strictly optimal code is equivalentup to a shift to the code consisting of all binary sequences oflength with weights as specified in Table I.

Recall that an code is called a binary-coded decimal(BCD) code as it provides a binary representation for the

decimal numbers. As a direct application of Theorem 5, wecharacterize all strictly optimal BCD codes.

Corollary 1: A strictly optimal BCD code of length existsif and only if or . The BCD code consisting of allbinary sequences of lengthexcept those of weight two is astrictly optimal code. The BCD code consisting of all binarysequences of length of weights one or four is a strictlyoptimal code. Any strictly optimal BCD code is equivalentto one of these two codes up to a shift.

We end this section by showing that strictly optimal codesare “proper.” Recall that a code is said to be proper if itsundetected error probability is nondecreasing asincreases from to .

Theorem 6: Any strictly optimal code is proper.Proof: Let be a strictly optimal code. Define

where is given in (10), i.e.,

(20)

From (11), we get

Differentiating with respect to, we get

since and as . Therefore, we have

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1499

It suffices to show that . Since

we have from (20)

which completes the proof of the theorem.

IV. CONCLUSION

This paper is concerned with the undetected error prob-ability of block codes. First, we define certain parameters

that are related to the average distanceenumerators of an code . Wethen derive an expression for the undetected error proba-bility of the code in terms of the parameters

(Theorem 1). Using a lower bound on theseparameters, we deduce a new lower bound on interms of , , and (Theorem 2). We show that this boundimproves upon other bounds reported in the literature. Codesthat achieve this lower bound are called strictly optimal codes.We characterize such codes (Theorem 3) and derive necessaryand sufficient conditions for a code to be strictly optimal. Inparticular, we show that if is a power of , then isstrictly optimal if and only if it is MDS (Theorem 4). We alsodetermine all values of and for which strictly optimalbinary codes exist and determine their structure (Theorem 5).We finally show that all strictly optimal codes are proper(Theorem 6).

The new lower bound on the undetected error probabilityis based on expressing in terms of the parameters

rather than the average distance enumerators. For , the probability

is an increasing function of and. However, unlike , each

of the parameters can be independentlylower-bounded by a simple tight bound (Lemma 4). The pa-rameters are related to the average responsetime to partial match queries in distributed databases [5]. Infact, the notion of strict optimality of codes introduced in thispaper is influenced by a similar notion used to characterizeoptimal disk allocation methods that minimize the responsetimes to partial match queries [1], [5].

APPENDIX

In this appendix we prove Theorem 5. The followingnotation is very useful for this purpose. If is a positiveinteger and is a set of nonnegative integers not greaterthan , then denotes the set of all binary sequencesof length whose weights belong to the set. We start withfew obvious observations that follow from Lemmas 6 and 7.

Lemma 10: If , is theunique strictly optimal code.

Lemma 11: If , is a strictlyoptimal code. Furthermore, any strictly optimalcode is equivalent to up to a shift.

Lemma 12: If

is a strictly optimal code. Furthermore, any strictlyoptimal code is equivalent to up to a shift.

Lemma 13: If , there are neither norstrictly optimal codes.

Lemma 14: If ,is a strictly optimal code. Furthermore, any strictlyoptimal code is equivalent to

up to a shift.Lemma 15: If ,

is a strictly optimal code. Furthermore, anystrictly optimal code is equivalent to

up to a shift.Proof: We use induction on . The lemma follows in

case from Lemma 11. Therefore, we assume in thefollowing that and that the lemma holds for smallervalues of . Suppose that

Clearly, is an code as it consists of allsequences of length whose weights are even and nonzero.To show that is strictly optimal, we verify that (19) holds.Since the code is invariant under any permutation of indices,we may assume that . Notice that consists of allsequences of even and nonzero weights whileconsists ofall sequences of odd weights. By the induction hypothesis,is a strictly optimal code and, by Lemma14, , which is a shift of the set of even-weight sequences,is a strictly optimal code. Since

ifif

in case , and

ifif

in case . Since and are strictly optimaland codes, respectively, it follows

from (19) that

It can be verified that the lower and upper bounds equaland , respectively. Thus (19)

holds and is strictly optimal.

1500 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

Next, suppose that is a strictly optimalcode. We show that it is a shift of

From Lemma 8, it follows that, up to a shift, and arestrictly optimal and codes,respectively. By the induction hypothesis, is a shift of

and, by Lemma 14, is a shift of

Therefore, up to a shift, we may assume that

and

for some . Since is strictly optimal,then by Lemma 6 its minimum distance is two. Hence,and

are disjoint. This implies that the sequenceis of odd weight and that consists all odd-weight sequencesof length . Thus

Lemma 16: If is even

is a strictly optimal code. Furthermore, anystrictly optimal code is equivalent to

up to a shift. If is odd, there are no strictly optimalcodes.

Proof: Using an argument similar to the one used inthe first part of the previous proof, it can be shown that

, where iseven, is a strictly optimal code. Next, supposethat is a strictly optimal code. We show thatit is equivalent to

if is even and we obtain a contradiction if is odd.From Lemma 8, it follows that and are strictly optimal

codes. By Lemma 15, and are shifts of

Therefore, up to a shift, we may assume that

and

for some . Since is strictly optimal,(19) implies that for

which is odd and, therefore, i.e., .Thus consists of all sequences of length and weightscongruent to except for the all-ones sequence, i.e.,

if is evenif is odd.

If is even, consists of all sequences of lengthof evenweights except for the all-zeros and the all-ones sequences, i.e.,

If is odd, then and have a sequence in common,which implies that the minimum distance ofis one and nottwo as given in Lemma 6.

Lemma 17: If , there are neither norstrictly optimal codes.

Proof: Suppose that is a strictly optimalcode. From Lemma 8, we may assume, up to a shift, thatand are strictly optimal andcodes. Based on Lemmas 15 and 16, it follows thatis oddand that, up to a shift, we may assume that

and

where . Since , for some. By the symmetry and strict optimality

of , we have

The above lower and upper bounds equal and ,respectively. Thus

or

Since

Noticing that for all

we have

or

Since

ABDEL-GHAFFAR: LOWER BOUND ON THE UNDETECTED ERROR PROBABILITY AND STRICTLY OPTIMAL CODES 1501

it follows that

or

for some , which contradicts (19) and the strictoptimality of . Using a similar argument, it can be shownthat there are no strictly optimal codes.

Using induction on and arguments similar to that em-ployed in the first part of the proof of Lemma 15, we obtainthe following result.

Lemma 18: If is even, then

and

are strictly optimal and codes,respectively. If is odd, then

and

are strictly optimal and codes,respectively.

Lemma 19: If is even then, up to a shift

and

are the unique strictly optimal andcodes, respectively. If is odd

then, up to a shift

and

are the unique strictly optimal andcodes, respectively.

Proof: By Lemma 18, we know that the specified codesare strictly optimal. We use induction onto prove the lemma.The lemma follows in case from Lemmas 11 and 12.In the following, we assume that and that the lemmaholds for smaller values of. We consider four cases. For eachcase, we assume that is a strictly optimal code and provethat it is a shift of one of the codes specified in the lemma.We will only prove the case in which is odd and is an

code. The case in which is even and isan code is similar. The other two cases canbe proved using an argument similar to that employed in theproof of Lemma 16.

Hence, in the following assume thatis a strictly optimalcode where is odd. From Lemma 8, we

may assume, up to a shift, that and are strictly optimaland codes,

respectively. By the induction hypothesis, is a shift of

and is a shift of

Therefore, up to a shift, we may assume that

for some , and

Since is strictly optimal, Lemma 6 implies that the minimumdistance of is two. In particular, and are disjoint. Weprove that this implies that is either all-zerosor all-ones, i.e., or , where is the weightof . Suppose that . It sufficesto show that there exists a binary sequenceof weight such that the sequence

, which belongs to , hasweight congruent to , i.e., it belongs also to

. In general, the resulting sequence is of weight ,where is the number of indices such that

. The sequence can be constructedby taking , , ,and . For example, if and

is of weight , thenis chosen such that and , i.e.,for some distinct and such that and

for some such that . This is possible sinceimplies that and therefore suchand

exist, and implies that such exists. In general,it follows that and are disjoint only if or . If

, i.e., , or , i.e.,, then consists of all sequences

of weights congruent to . Since consistsof all sequences of weights congruent to , itfollows that consists of all sequences of weights congruentto . Hence,

is the unique strictly optimal code up to ashift.

Lemma 20: If is even, there are no strictly optimalcodes. If is odd, there are no strictly

optimal codes.Proof: Using Lemmas 8 and 19, we can give an argument

similar to the one used to prove Lemma 17.

1502 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 43, NO. 5, SEPTEMBER 1997

We are now in a position to prove Theorem 5.

Proof of Theorem 5

From Lemma 10, we know that is theunique strictly optimal code for all . FromLemma 9, it suffices to consider the cases .If and satisfy any of the stated conditions, Lemmas 11,12, 14–16, 18, and 19 demonstrate the existence of a strictlyoptimal code, which is necessarily equivalent up to ashift to the code consisting of all binary sequences of length

whose weights are as given in Table I. It remains to provethat no strictly optimal codes exist if otherwise. FromLemma 13, there are neither nor strictly optimalcodes if , which proves the result in case . Tocomplete the proof, we assume and use inductionon . Suppose that and the theorem holds for smallervalues of . Assume is odd. If a strictly optimalcode exists, where or

, then by Lemma 8, there exist strictly optimaland codes. This contradicts

the induction hypothesis which implies the nonexistence ofcodes where

or . The nonexistence ofstrictly optimal codes where or

follows from Lemmas 20, 17, and16. This demonstrates that the induction hypothesis holds for

. A similar argument is applicable in case is even.

ACKNOWLEDGMENT

The author wishes to thank Prof. T. Kløve for his interestin the results and for pointing out several relevant references.Thanks are also due to the anonymous referees for theirconstructive comments.

REFERENCES

[1] K. A. S. Abdel-Ghaffar and A. E. Abbadi, “Optimal disk allocation forpartial match queries,”ACM Trans. Database Syst., vol. 18, no. 1, pp.132–156, Mar. 1993.

[2] T. C. Ancheta, “An upper bound on the ratio of the probabilities ofsubgroups and cosets,”IEEE Trans. Inform. Theory, vol. IT-27, pp.646–647, Sept. 1981.

[3] E. G. Andrews, “Telephone switching and the early Bell Laboratoriescomputers,”Bell Syst. Tech. J., vol. 42, no. 2, pp. 341–353, Mar. 1963.

[4] A. E. Brouwer and T. Verhoeff, “An updated table of minimum-distancebounds for binary linear codes,”IEEE Trans. Inform. Theory, vol. 39,pp. 662–677, Mar. 1993.

[5] T. Fujiwara, M. Ito, T. Kasami, M. Kataoka, and J. Okui, “Performanceanalysis of disk allocation method using error-correcting codes,”IEEETrans. Inform. Theory, vol. 37, pp. 379–384, Mar. 1991.

[6] T. Fujiwara, T. Kasami, and S. Feng, “On the monotonic property ofthe probability of undetected error for a shortened code,”IEEE Trans.Inform. Theory, vol. 37, pp. 1409–1411, Sept. 1991.

[7] R. W. Hamming, “Error detecting and error correcting codes,”Bell Syst.Tech. J., vol. 29, pp. 147–160, Apr. 1950.

[8] , Coding and Information Theory. Englewood Cliffs, NJ:Prentice-Hall, 1986.

[9] M. E. Hellman, “Error detection made simple,” inInt. Conf. on Commu-nication, ICC’74(Minneapolis, MN, June 17–19, 1974), pp. 9A1–A4.

[10] T. Kasami, T. Kløve, and S. Lin, “Linear block codes for errordetection,”IEEE Trans. Inform. Theory, vol. IT-29, pp. 131–136, Jan.1983.

[11] T. Kasami and S. Lin, “On the probability of undetected error forthe maximum distance separable codes,”IEEE Trans. Commun., vol.COM-32, pp. 998–1006, Sept. 1984.

[12] T. Kløve, “Generalizations of the Korzhik bound,”IEEE Trans. Inform.Theory, vol. IT-30, pp. 771–773, Sept. 1984.

[13] , “Using codes for error correction and detection,”IEEE Trans.Inform. Theory, vol. IT-30, pp. 868–870, Nov. 1984.

[14] , “Optimal codes for error detection,”IEEE Trans. Inform. Theory,vol. 38, pp. 479–489, Mar. 1992.

[15] , “The weight distribution of cosets,”IEEE Trans. Inform. Theory,vol. 40, pp. 911–913, May 1994.

[16] , “Bounds on the worst case probability of undetected error,”IEEE Trans. Inform. Theory, vol. 41, pp. 298–300, Jan. 1995.

[17] , “Bounds on the weight distribution of cosets,”IEEE Trans.Inform. Theory, vol. 42, pp. 2257–2260, Nov. 1996.

[18] T. Kløve and V. I. Korzhik,Error Detecting Codes. Norwell, MA:Kluwer, 1995.

[19] V. I. Korzhik, “Bounds on undetected error probability and optimumgroup codes in a channel with feedback,”Radioteknika, vol. 20, no. 1,pp. 27–33, 1965. (English translation:Telecommun. Radio Eng., vol. 20,no. 1, pp. 87–92, Jan. 1965.)

[20] V. I. Korzhik and L. M. Fink,Noise-Stable Coding of Discrete Messagesin Channels with a Random Structure. (in Russian). Moscow, Svyaz:1975.

[21] V. K. Leont’ev, “Error-detecting encoding,”Probl. Pered. Inform., vol.8, no. 2, pp. 6–14, 1972. (English translation:Prob. Inform. Transm.,vol. 8, no. 2, pp. 86–92, 1972.)

[22] S. K. Leung-Yan-Cheong, E. R. Barnes, and D. U. Friedman, “On someproperties of undetected error probability of linear codes,”IEEE Trans.Inform. Theory, vol. IT-25, pp. 110–112, Jan. 1979.

[23] S. K. Leung-Yan-Cheong and M. E. Hellman, “Concerning a bound onundetected error probability,”IEEE Trans. Inform. Theory, vol. IT-22,pp. 235–237, Mar. 1976.

[24] V. I. Levenshtein, “Bounds on the probability of undetected error,”Probl. Pered. Inform., vol. 13, no. 1, pp. 3–18, 1977. (English trans-lation: Probl. Inform. Transm., vol. 13, no. 1, pp. 1–12, 1978.)

[25] F. J. MacWilliams and N. J. A. Sloane,The Theory of Error-CorrectingCodes. Amsterdam, The Netherlands: North-Holland, 1977.

[26] R. Padovani and J. K. Wolf, “Data transmission using error detectioncodes,” in GLOBECOM’82, IEEE Global Telecommunications Conf.(Miami, FL, Nov. 29–Dec. 2, 1982), pp. C6.2.1–6.

[27] P. Perry, “Necessary conditions for good error detection,”IEEE Trans.Inform. Theory, vol. 37, pp. 375–378, Mar. 1991.

[28] G. R. Redinbo, “Inequalities between the probability of a subspace andthe probabilities of its cosets,”IEEE Trans. Inform. Theory, vol. IT-19,pp. 533–536, July 1973.

[29] P. Robillard, “Optimal codes,”IEEE Trans. Inform. Theory, vol. IT-15,pp. 734–735, Nov. 1969.

[30] R. C. Singleton, “Maximum distanceq-n ary codes,” IEEE Trans.Inform. Theory, vol. IT-10, pp. 116–118, Apr. 1964.

[31] D. D. Sullivan, “A fundamental inequality between the probabilities ofbinary subgroups and cosets,”IEEE Trans. Inform. Theory, vol. IT-13,pp. 91–94, Jan. 1967.

[32] J. K. Wolf, A. M. Michelson, and A. H. Levesque, “On the probabilityof undetected error for linear block codes,”IEEE Trans. Commun., vol.COM-30, pp. 317–324, Feb. 1982.