on relative constant-weight codes

18
Des. Codes Cryptogr. DOI 10.1007/s10623-013-9896-2 On relative constant-weight codes Zihui Liu · Xin-Wen Wu Received: 9 March 2013 / Revised: 21 September 2013 / Accepted: 6 November 2013 © Springer Science+Business Media New York 2013 Abstract In this paper, relative two-weight and three-weight codes are studied, which are both called relative constant-weight codes. A geometric approach is introduced to construct and characterize relative constant-weight codes, using the finite projective geometry. A suffi- cient and necessary condition is derived for linear codes to be relative constant-weight codes, based on the geometric approach. A family of infinite number of relative constant-weight codes are constructed, which includes dual Hamming codes and subcodes of punctured Reed–Muller codes as special instances. It is well known that determining all the minimal codewords is a hard problem for an arbitrary linear code. For relative constant-weight codes, minimal codewords are completely determined in this paper. Based on the above-mentioned results, applications of relative constant-weight codes to wire-tap channel of type II and secret sharing are discussed. A comparative study shows that relative constant-weight codes form a new family. They are not covered by the previously well-known three-weight codes or linear codes for which minimal codewords can be determined. Keywords Relative two-weight code · Relative three-weight code · Minimal codeword · Finite projective geometry · Wire-tap channel of type II · Secret sharing Mathematics Subject Classification 94B05 Communicated by C. Carlet. This work was supported by The National Science Foundation of China ( No. 11171366). The material of this paper was presented in part at the IEEE International Symposium on Information Theory, MIT, Cambridge, Boston, USA, July 2012. Z. Liu (B ) Department of Mathematics, Beijing Institute of Technology, Beijing 100081, China e-mail: [email protected]; [email protected] X.-W. Wu School of Information and Communication Technology, Griffith University, Gold Coast, QLD 4222, Australia 123

Upload: xin-wen

Post on 23-Dec-2016

215 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: On relative constant-weight codes

Des. Codes Cryptogr.DOI 10.1007/s10623-013-9896-2

On relative constant-weight codes

Zihui Liu · Xin-Wen Wu

Received: 9 March 2013 / Revised: 21 September 2013 / Accepted: 6 November 2013© Springer Science+Business Media New York 2013

Abstract In this paper, relative two-weight and three-weight codes are studied, which areboth called relative constant-weight codes. A geometric approach is introduced to constructand characterize relative constant-weight codes, using the finite projective geometry. A suffi-cient and necessary condition is derived for linear codes to be relative constant-weight codes,based on the geometric approach. A family of infinite number of relative constant-weightcodes are constructed, which includes dual Hamming codes and subcodes of puncturedReed–Muller codes as special instances. It is well known that determining all the minimalcodewords is a hard problem for an arbitrary linear code. For relative constant-weight codes,minimal codewords are completely determined in this paper. Based on the above-mentionedresults, applications of relative constant-weight codes to wire-tap channel of type II and secretsharing are discussed. A comparative study shows that relative constant-weight codes form anew family. They are not covered by the previously well-known three-weight codes or linearcodes for which minimal codewords can be determined.

Keywords Relative two-weight code · Relative three-weight code · Minimal codeword ·Finite projective geometry · Wire-tap channel of type II · Secret sharing

Mathematics Subject Classification 94B05

Communicated by C. Carlet.

This work was supported by The National Science Foundation of China ( No. 11171366). The material ofthis paper was presented in part at the IEEE International Symposium on Information Theory, MIT,Cambridge, Boston, USA, July 2012.

Z. Liu (B)Department of Mathematics, Beijing Institute of Technology, Beijing 100081, Chinae-mail: [email protected]; [email protected]

X.-W. WuSchool of Information and Communication Technology, Griffith University,Gold Coast, QLD 4222, Australia

123

Page 2: On relative constant-weight codes

Z. Liu, X.-W. Wu

1 Introduction

Motivated by the work in [9], where a geometric approach was used to study the relativegeneralized Hamming weights, and the results in [10], where a class of two-weight codeswere investigated, we study relative two-weight and three-weight codes in this paper. Wecall these codes relative constant-weight codes, as they can be partitioned into two or threeconstant-weight subcodes.

A geometric approach is introduced first to study relative constant-weight codes, basedon the finite projective geometry. A sufficient and necessary condition is derived, whichfully characterizes the linear codes that are relative three-weight codes. This generalizesthe result on relative two-weight codes in [10]. Making use of the geometric approach, afamily of infinite number of relative constant-weight codes are constructed. It is showed thatthe relative constant-weight codes include the well-known dual Hamming codes as well assubcodes of punctured Reed–Muller codes as special instances.

It is well known that determining minimal codewords is a hard problem for an arbitrarylinear code (cf. [1,13]). In this paper, the minimal codewords of relative two-weight andthree-weight codes are completely determined. Based on the code construction and completedetermination of minimal codewords, applications of relative constant-weight codes to wire-tap channel of type II and secret sharing are discussed.

As it has been proved in [13], for a secret sharing scheme that is based on a linear code C,the problem of determining the minimal access sets is reduced to the problem of finding theminimal codewords of the dual code C⊥. An elegant sufficient condition was presented in [1],which says that for a linear code if its minimum nonzero weight and maximum weight satisfythe sufficient condition, then all the nonzero codes are minimal codewords (see the detailgiven by (11) in Sect. 5). Also, a lot of research results have been published (see [5,6,8,16])which attempted to construct linear codes for which minimal codewords can be determined.

A comparative study shows that the relative constant-weight codes are a new family ofcodes. For relative constant-weight codes, while the sufficient condition of [1] is not satisfied,minimal codewords are completely determined. It is also showed that the relative constant-weight codes are not covered by the previously well-known three-weight codes or linearcodes for which minimal codewords can be determined [1,3,5,6,8,16,17].

The rest of this paper is organized as follows. Section 2 defines relative two-weight andthree-weight codes, introduces a geometric approach making use of finite projective geometry,as well as presents some preliminary results. A sufficient and necessary condition for linearcodes to be relative three-weight codes is derived in Sect. 3. In this section, we also presenta construction of relative constant-weight codes; and we prove that the relative constant-weight codes include the well-known dual Hamming codes as well as subcodes of puncturedReed–Muller codes as special instances. An application of relative constant-weight codesto wire-tap channel of type II is presented in Sect. 4. Section 5 completely determines theminimal codewords of relative two-weight and three-weight codes; and application of relativeconstant-weight codes to secret sharing is given in this section. In Sect. 6, a comparative studyis given to compare relative constant-weight codes with well-known linear codes for whichminimal codewords can be determined as well as existing three-weight codes. The conclusionwill be given in Sect. 7.

2 Definitions and geometric approaches

Let G F(q) be a finite field with q elements. A k-dimensional linear code, C, of length nis a k-dimensional linear subspace of G F(q)n . Let C1 be any subcode of C. Denote C\C1

123

Page 3: On relative constant-weight codes

Constant-weight codes

= {c | c ∈ C, c /∈ C1}. Note that C\C1 is a block code, but not necessarily a linear code. Inthe following definitions, we call a block code C a constant-weight code, if all the codewordsof C (except the all-zero codeword, if the all-zero codeword is in the code) have the sameHamming weight.

Definition 1 ([10]) C is called a relative two-weight code with respect to a subcode C1,provided that C1 and C\C1 are both constant weight codes. If these two constant weightcodes have weights w1 and w, respectively, then the relative two-weight code C is denotedby C(w1, w).

We may generalize relative two-weight codes as follows.

Definition 2 Let C1 be a k1-dimensional subcode of C, and C2 a k2-dimensional subcode,satisfying C1 ⊂ C2 ⊂ C. Then C is called a relative three-weight code with respect to C1 andC2, provided that C1, C2\C1 and C\C2 are all constant weight codes. If these three constantweight codes have weights w1, w2 and w, respectively, then the relative three-weight codeC is denoted by C(w1, w2, w).

Remark 1 Obviously, if w1 = w2 = w, then C(w1, w2, w) becomes a constant weight code.If w1 = w2, then C is a relative two-weight code with respect to C2. If w2 = w, then C is arelative two-weight code with respect to C1. Thus, relative three-weight codes generalize bothconstant weight codes and relative two-weight codes. As relative two-weight and three-weightcodes are partitioned into two and three constant-weight subcodes, respectively, we use theterm, relative constant-weight codes, to include both relative two-weight and three-weightcodes.

Finite projective geometry has been extensively applied to coding theory (see [2,4,15],for example). In this paper, we study relative constant-weight codes making use of finiteprojective geometry. Consider C, a k-dimensional linear code over G F(q). Let G be a gener-ator matrix of C. Without loss of generality, we assume that G does not contain any all-zerocolumn. (Note that this assumption does not affect the weight of any codeword). Making useof finite projective geometry, we introduce a number of parameters to characterize C and Gas follows.

Denote by PG(k − 1, q) the (k − 1)-dimensional projective space over G F(q). Thenthe columns of G can be viewed as points of PG(k − 1, q). We then define a map m fromPG(k−1, q) to the set of nonnegative integers as follows (the map is called a value assignmentin [4]):

m : PG(k − 1, q) → N

where N = {0, 1, . . .}, and for any point p ∈ PG(k − 1, q), m(p) is defined as the numberof occurrence of p as a column in the matrix G. m(p) is called the value or multiplicity ofp (with respect to G) [4]. This map can be extended to any subset W ⊂ PG(k − 1, q) bydefining

m(W ) =∑

p∈W

m(p)

m(W ) is called the value of W .Let p = (u1, . . . , uk) be a vector of G F(q)k or a projective point of PG(k − 1, q). For

any L ⊂ {1, 2, . . . , k}, we denote PL(p) = (v1, . . . , vk), where vi = ui if i ∈ L, and

123

Page 4: On relative constant-weight codes

Z. Liu, X.-W. Wu

vi = 0 if i /∈ L. For a subset W ⊂ PG(k − 1, q), define PL(W ) = {PL(p) | p ∈ W }. It iseasy to see that if W is a projective subspace of PG(k − 1, q), so is PL(W ).

For a projective subspace V of PG(k − 1, q), and integers l = 1, . . . , k − 1, we define

V l = {p ∈ V | p = (0, . . . , 0, pl+1, . . . , pk)}that is, V l is the set of points of V which are all 0 in the first l coordinates. Note that V l maybe an empty set. If V l �= ∅, then it is a projective subspace of V .

For the purpose of further characterizing subcodes of C, we introduce the following nota-tions. Let C1 be a k1-dimensional subcode of C, and C2 a k2-dimensional subcode, satisfyingC1 ⊂ C2 ⊂ C. Without loss of generality, we assume that C1 and C2 are generated by the firstk1 and k2 rows of G, respectively (otherwise, we can simply choose another generator matrixsatisfying this condition). Let L1 = {1, . . . , k1} and L2 = {k1 + 1, . . . , k2}. For nonnegativeintegers ξ, η, and γ , we denote by Pξ

ηγ a projective subspace V of PG(k − 1, q), satisfyingdim(PL1(V )) = ξ − 1, dim(PL2(V k1)) = η − 1 and dim(V k2) = γ − 1. Here, a projectivespace of dimension 0 is a set consisting of a single point; and the empty set is viewed as aprojective space of dimension −1. It is easy to see that dim(Pξ

ηγ ) = ξ + η + γ − 1.

Example 1 Three types of projective subspaces, namely, P100, P0

10, and P001, will be useful

in the investigation of relative three-weight codes. By the above notation and discussion, itis easy to see that any (single) point p of PG(k − 1, q) satisfying PL1(p) �= 0 constitutesP1

00. Similarly, P010 consists of any point p satisfying PL1(p) = 0 and PL2(p) �= 0; and P0

01represents any point p satisfying PL1(p) = 0 and PL2(p) = 0.

As we will show later in Sect. 3, the values m(P100), m(P0

10), and m(P001) play a key role

in the characterization and construction of relative three-weight codes.We are now ready to give some preliminary results. We first recall some results in [9,10],

i.e., Lemmas 1 and 2, which will be useful in the studies of applications of relative constant-weight codes. In order to state these results, we require the following definition.

Definition 3 ([9]) Let C1 be k1-dimensional subcode of a k-dimensional linear code C. Anysubcode D of C is called a relative (r, t) subcode (with respect to C1), where r = dim D andt = dim(D ∩ C1).

The support of a codeword c=(c1, c2, . . . , cn) of C is defined to be {i | 1≤ i ≤ n, ci �= 0}.For any subcode D of C, the support, χ(D), of D is defined as the union of the supports of allthe codewords in D. The support weight, w(D), of D is defined as the cardinality of χ(D),that is, w(D) = |χ(D)|. In particular, the Hamming weight w(c) of a codeword c is exactlythe support weight of the 1-dimensional subcode generated by c. The support weight w(C)

of C itself is called the effective length of C.

Lemma 1 ([9]) There is a 1-1 correspondence between the relative (r, t) subcodes and the(k − r − 1)-dimensional projective subspaces, such that if D corresponds to the projectivesubspace Pk−r−1, we have dim PL(Pk−r−1) = k1 − t − 1 and n − w(D) = m(Pk−r−1),where L = {1, 2, . . . , k1} is the set of the first k1 coordinate positions of the projective pointsin PG(k − 1, q).

Lemma 2 ([10]) A code C is a relative two-weight code with respect to its k1-dimensionalsubcode C1 if and only if the value assignment m(·) only has two distinct values. Moreprecisely, for all the points p of PG(k − 1, q) satisfying PL(p) = 0, m(p) are a constant;and for all the points p satisfying PL(p) �= 0, m(p) are a constant, where L = {1, 2, . . . , k1}.

123

Page 5: On relative constant-weight codes

Constant-weight codes

Lemma 2 will be generalized in Sect. 3 to fully characterize relative three-weight codes.To this end, the following result will be useful.

Lemma 3 Let C1 be a k1-dimensional subcode of C, and C2 a k2-dimensional subcode, sat-isfying C1 ⊂ C2 ⊂ C. There is a one-to-one correspondence between the nonzero codewordsc1 ∈ C1, c2 ∈ (C2\C1) and c ∈ (C\C2) and the subspaces Pk1−1

(k2−k1)(k−k2), Pk1(k2−k1−1)(k−k2)

and Pk1(k2−k1)(k−k2−1), respectively. The one-to-one correspondence satisfies that if c1, c2 and

c correspond to Pk1−1(k2−k1)(k−k2), Pk1

(k2−k1−1)(k−k2) and Pk1(k2−k1)(k−k2−1), respectively, then

m(PG(k − 1, q)) = n,

n − w(c1) = m(Pk1−1(k2−k1)(k−k2)),

n − w(c2) = m(Pk1(k2−k1−1)(k−k2)), and

n − w(c) = m(Pk1(k2−k1)(k−k2−1)).

Proof The first equation is obvious, as every column of G must be a point of PG(k − 1, q),where m(·) is defined with respect to G. The last three equations in the lemma can be provedsimilarly. Let us give a detailed proof for the third equation. Let c2 ∈ (C2\C1). Then we maywrite

c2 = (x1, . . . , xk1 , xk1+1, . . . , xk2 , 0, . . . , 0)G,

where G is a generator matrix of C, and the first k1 rows of G generate the subcodeC1, and the next k2 − k1 rows of G and the first k1 rows of G together generate thesubcode C2. Since c2 ∈ (C2\C1), there exists some i satisfying k1 + 1 ≤ i ≤ k2

such that xi �= 0. Consider the space U of G F(q)k which is orthogonal to the vec-tor (x1, . . . , xk1 , xk1+1, . . . , xk2 , 0, . . . , 0). Then U , being viewed as a projective subspaceof PG(k − 1, q), satisfies dim PL1(U ) = k1 − 1, dim PL2(U

k1) = k2 − k1 − 2 anddim(U k2) = k − k2 − 1. Therefore, U is exactly Pk1

(k2−k1−1)(k−k2) corresponding to the

codeword c2. Then, the equation n − w(c2) = m(Pk1(k2−k1−1)(k−k2)) is obvious. �

3 Three-weight codes and their geometric construction

In this section, we will establish a sufficient and necessary condition for a linear code to bea relative three-weight code. We then present the geometric construction of relative three-weight codes, which form a large family of linear codes. Before we conclude the section, weshow that the subcodes of punctured Reed–Muller codes are relative constant-weight codes.

3.1 Characterization of relative three-weight codes

We first present the sufficient and necessary condition for a linear code to be a relativethree-weight code.

Theorem 1 Let C be a linear code of effective length n, with a generator matrix G. Let C1

and C2 be subcodes of C, generated by the first k1 and k2 rows of G, respectively. Then Cis a relative three-weight code with respect to C1 and C2 if and only if the following is true:m(P1

00) is a constant for all the points P100; m(P0

10) is a constant for all the points P010; and

m(P001) is a constant for all the points P0

01.

123

Page 6: On relative constant-weight codes

Z. Liu, X.-W. Wu

Proof We first prove the sufficient condition. Assume m(·) has same values on the pointsP1

00, P010 and P0

01, respectively. Then all the subspaces Pk1−1(k2−k1)(k−k2) will have the same value

since any Pk1−1(k2−k1)(k−k2) contains the same number of points being from the set of points

P100, P0

10 and P001, respectively. It follows from Lemma 3 that all the nonzero codewords

of C1 have the same weight. Similarly, we know that all the codewords of C2\C1 have thesame weight, and all the codewords of C\C2 have the same weight. Therefore, C is a relativethree-weight code with respect to C1 and C2.

Next, we prove the necessary condition. Assume C is a relative three-weight code. Inorder to show that the value assignment m(·) has same values on the points P1

00, P010 and

P001, respectively, we will prove the following general result:

m(

Pξηγ

)= a constant, (1)

for any fixed triple (ξ, η, γ ).To show (1) is true, we denote ξ + η + γ = k − i and use the induction on i , for

i = 0, . . . , k − 1.For i = 0, we have ξ + η + γ = k and Pξ

ηγ = PG(k − 1, q), so, m(Pξηγ ) = m(PG(k −

1, q)) = n.For i = 1, we have ξ + η + γ = k − 1 and Pξ

ηγ is equal to one of the three kinds of

subspaces Pk1−1(k2−k1)(k−k2), Pk1

(k2−k1−1)(k−k2) and Pk1(k2−k1)(k−k2−1). It follows from Lemma 3

that m(Pξηγ ) is a constant.

Now, assume (1) is true for any i satisfying i < i0, i.e., (1) is true for any fixed triple(ξ, η, γ ) satisfying ξ + η + γ > k − i0. We will show that (1) is true for i = i0 in the

following. For any Pξηγ satisfying ξ + η + γ = k − i0, there exists a Pξ ′

η′γ ′ satisfying

ξ ′ + η′ + γ ′ = k − (i0 − 2) such that Pξηγ ⊂ Pξ ′

η′γ ′ . We may distinguish the parameters intothe following cases.

(Case 1) ξ ′ = ξ + 2. Then η′ = η and γ ′ = γ . Since m(Pξ ′η′γ ′) = (q + 1)m(Pξ+1

ηγ ) −qm(Pξ

ηγ ), m(Pξηγ ) = q + 1

q m(Pξ+1ηγ ) − 1

q m(Pξ ′η′γ ′). Thus, m(Pξ

ηγ ) is a constant, by theinductive hypothesis.

(Case 2) ξ ′ = ξ + 1, η′ = η + 1. Then γ ′ = γ . Since m(Pξ ′η′γ ′) = qm(Pξ+1

ηγ ) +m(Pξ

(η+1)γ ) − qm(Pξηγ ), m(Pξ

ηγ ) = m(Pξ+1ηγ ) + 1

q m(Pξ

(η+1)γ ) − 1q m(Pξ ′

η′γ ′), which is aconstant, by the inductive hypothesis.

(Case 3) ξ ′ = ξ + 1, γ ′ = γ + 1. Then η′ = η. Similar to Case 2, we obtain m(Pξηγ ) =

m(Pξ+1ηγ ) + 1

q m(Pξ

η(γ+1)) − 1q m(Pξ ′

η′γ ′), which is a constant.

(Case 4) ξ ′ = ξ, η′ = η + 2. Then γ ′ = γ . Similar to Case 1, we obtain m(Pξηγ ) =

q + 1q m(Pξ

(η+1)γ ) − 1q m(Pξ ′

η′γ ′), which is a constant.

(Case 5) ξ ′ = ξ, η′ = η + 1 and γ ′ = γ + 1. Similar to Case 2, we obtain m(Pξηγ ) =

m(Pξ

(η+1)γ ) + 1q m(Pξ

η(γ+1)) − 1q m(Pξ ′

η′γ ′), which is a constant.

(Case 6) ξ ′ = ξ, η′ = η and γ ′ = γ + 2. Similar to Case 1, we obtain m(Pξηγ ) =

q + 1q m(Pξ

η(γ+1)) − 1q m(Pξ ′

η′γ ′), which is a constant.Therefore, we have proved that (1) is true for i = i0. By mathematical induction, (1) is

true. �

123

Page 7: On relative constant-weight codes

Constant-weight codes

3.2 Geometric construction of relative three-weight codes

From Theorem 1, to construct a relative three-weight code of dimension k over G F(q), wecan construct a generator matrix G for the code as follows: Choose appropriate k-dimensionalcolumn vectors over G F(q) (or equivalently, points of PG(k − 1, q)), and use them as thecolumns of G, such that m(P1

00), m(P010), and m(P0

01) all are constants, respectively. Then,the code C generated by G is a relative three-weight code. Please note that we can take anyorder for the columns. Different column orders lead to different relative three-weight codes,but these codes are equivalent.

More precisely, let k1 and k2 be any positive integers satisfying k1 < k2 ≤ k. Let L1 ={1, . . . , k1} and L2 = {k1 + 1, . . . , k2}. By Example 1 in Sect. 2, P1

00 represents points p ofPG(k − 1, q) satisfying PL1(p) �= 0 (that is, points for which at least one of the coordinatesin the first k1 positions is not 0); P0

10 represents any point p satisfying PL1(p) = 0 andPL2(p) �= 0; and P0

01 represents any point p satisfying PL1(p) = 0 and PL2(p) = 0. By

simple calculation, we know that there are exactly qk − qk−k1

q − 1 points P100,

qk−k1 − qk−k2

q − 1

points P010, and qk−k2 − 1

q − 1 points P001.

For any nonnegative integers a1, a2, and a3, assign

m(p) =⎧⎨

a1, p is a point P100

a2, p is a point P010

a3, p is a point P001.

(2)

Next, let G be the matrix consisting of P100, P0

10, and P001 as columns in the following way:

Each of the points P100 appears in G as columns for a1 times; each of the points P0

10 appearsin G for a2 times; and each of the points P0

01 appears in G for a3 times.By Theorem 1, the code C generated by G is a relative three-weight code with respect to

C1 (which is generated by the first k1 rows of G) and C2 (which is generated by the first k2

rows of G).As an example, in the following we construct a binary 5-dimensional code, which is a

relative three-weight codes with respect to a 2-dimensional subcode C1 and a 4-dimensionalsubcode C2.

Example 2 We first set

m(p) =⎧⎨

1, p is a point P100

2, p is a point P010

4, p is a point P001.

As k1 = 2 and k2 = 4, we have L1 = {1, 2} and L2 = {3, 4}. Then, it is easy to find allpoints P1

00, P010, and P0

01 in PG(4, 2). By the procedure described above, a generator matrixG is given as follows.

⎜⎜⎜⎜⎝

1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 00 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 00 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 1 1 1 1

⎟⎟⎟⎟⎠.

Please note that each of the 24 points P100 appears in G once; each of the 6 points P0

10 appearsin G twice; and there is only one point P0

01 which appears in G for four times.

123

Page 8: On relative constant-weight codes

Z. Liu, X.-W. Wu

Now, it is easy to verify that all of the nonzero codewords of C1 have weight 16, and allof the codewords of C2\C1 have weight 20, whereas the codewords of C\C2 all have weight22. Thus, the code C generated by G is a relative three-weight code.

It is obvious that from the geometric construction, we can construct an infinite number ofrelative three-weight codes over a given finite field. In the following, for any given k, k1, andk2 satisfying k1 < k2 ≤ k, we compute the code length and the three weights for a relativethree-weight k-dimensional code C constructed through the geometric construction. As wehave seen earlier in this subsection, the subcodes C1 \ {0}, C2 \ C1, and C \ C2 are all constantcodes. We first compute the length of C; and then compute the weights of C1 \ {0}, C2 \ C1,and C \ C2, which are denoted as before by w1, w2, and w, respectively.

Since the projective space PG(k −1, q) contains qk − qk−k1

q − 1 points P100,

qk−k1 − qk−k2

q − 1

points P010, and qk−k2 − 1

q − 1 points P001, from the geometric construction, the generator matrix

G has n columns, thus the length of C is n, where n is given by

n = qk − qk−k1

q − 1m

(P1

00

) + qk−k1 − qk−k2

q − 1m

(P0

10

) + qk−k2 − 1

q − 1m

(P0

01

). (3)

From Lemma 3, we have

w(c1) = n − m(

Pk1−1(k2−k1)(k−k2)

), ∀c1 ∈ C1. (4)

It is easy to verify that the projective subspace Pk1−1(k2−k1)(k−k2) contains qk−1 − qk−k1

q − 1

points P100,

qk−k1 − qk−k2

q − 1 points P010, and qk−k2 − 1

q − 1 points P001. Thus,

m(Pk1−1(k2−k1)(k−k2)) = qk−1 − qk−k1

q − 1m(P1

00) + qk−k1 − qk−k2

q − 1m(P0

10) + qk−k2 − 1

q − 1m(P0

01).

By this equation and (4), one gets

w1 = w(c1) = qk−1m(P1

00

), ∀c1 ∈ C1. (5)

By similar procedures, we have

w2 =(

qk−1 − qk−k1−1)

m(P1

00

) + qk−k1−1m(P0

10

), (6)

and

w =(

qk−1 − qk−k1−1)

m(P1

00

) +(

qk−k1−1 − qk−k2−1)

m(P0

10

) + qk−k2−1m(P0

01

).

(7)

From the geometric construction and the code parameters (length, dimension, and weights)given above, by varying the values of k, k1, k2, m(P1

00), m(P010), and m(P0

01), we obtain aninfinite number of relative three-weight codes.

3.3 Subcodes of punctured Reed–Muller codes

Reed–Muller (RM) codes are a well-known family of linear codes, which are applied inmany areas [12,14]. In this subsection, we will show that subcodes of punctured RM codesare special instances of the relative constant-weight codes. For simplicity, in the following

123

Page 9: On relative constant-weight codes

Constant-weight codes

we take binary RM codes as examples; the results can be straightforwardly extended to q-aryRM codes.

Let n = 2k . The vector space G F(2)k has n points. For any given ordering of thesepoints, denote G F(2)k = {P1, . . . , Pn}. The binary Reed–Muller code RM(r, k) of order rin k variables is defined as

RM(r, k) ={

( f (P1), . . . , f (Pn)) | f ∈ G F(q) [X1, . . . , Xk] , deg( f ) ≤ r}

where G F(2)[X1, . . . , Xk] is the set of polynomials over G F(2) in variables X1, . . . , Xk .Consider the first order Reed–Muller codes RM(1, k). As the set of polynomials of degree

at most 1 forms a linear space and has a basis 1, X1, . . . , Xk , the code RM(1, k) is a (k +1)-dimensional linear code and has the following generator matrix

⎜⎜⎜⎝

1 1 . . . 1X1(P1) X1(P2) . . . X1(Pn)

......

......

Xk(P1) Xk(P2) . . . Xk(Pn)

⎟⎟⎟⎠ .

Assuming the first point of G F(2)k is the zero point, that is P1 = (0, 0, . . . , 0), then forall i = 1, . . . , k, Xi (P1) = 0. Denote by RM(1, k)∗ the punctured RM codes obtained bydeleting the first coordinator for all codewords. Consider the k-dimensional subcode C ofRM(1, k)∗ generated by the following matrix

G =

⎜⎜⎜⎝

X1(P2) X1(P3) . . . X1(Pn)

X2(P2) X2(P3) . . . X2(Pn)...

......

...

Xk(P2) Xk(P3) . . . Xk(Pn)

⎟⎟⎟⎠ . (8)

Note that points P2, . . . , Pn constitute the (k − 1)-dimensional binary projective spacePG(k − 1, 2). Viewing these points as column vectors, the first column of G is exactlyP2, the second column is P3, . . ., and the last column is Pn .

Now, for any k1 and k2 with 0 < k1 < k2 ≤ k, there are 2k − 2k−k1 pointsP1

00, 2k−k1 − 2k−k2 points P010, and 2k−k2 − 1 points P0

01. In total, the number of all points ofthese three types is 2k − 1 = n − 1. By the geometric construction presented in the previoussubsection, the above matrix G is exactly the same as the matrix by setting

m(p) =⎧⎨

1, p is a point P100

1, p is a point P010

1, p is a point P001

and letting each of the points, P100, P0

10 and P001, appear as a column of the matrix exactly

once. By Theorem 1, the code generated by G, namely, the subcode of the punctured RMcode RM(1, k)∗, is a relative three-weight code.

In this case, as m(P100) = m(P0

10) = m(P001) = 1, by Eqs. (5–7), we have w1 = w2 = w =

2k−1. Thus, this code is a constant weight code, a special instance of relative three-weightcodes. Actually, by the construction of the generator matrix G, this code is the dual code of aHamming code, which is called simplex code in the literature, a well-known constant weightcode [14].

Next, consider the punctured RM code which is generated by the sub-matrix of G consist-ing of the columns which are points of type P0

10 or P001 (that is, all the columns of G which

123

Page 10: On relative constant-weight codes

Z. Liu, X.-W. Wu

are points of type P100 are deleted). Then, this punctured RM code is a code satisfying

m(p) =⎧⎨

1, p is a point P100

0, p is a point P010

1, p is a point P001.

It is a relative three-weight code by Theorem 1.Note that the above examples both satisfy that the multiplicity values m(p) ≤ 1 for all

points P100, P0

10 and P001 (a very special case of Eq. (2)). This is actually not necessary for

subcodes of punctured RM codes to be relative constant-weight codes.Consider the points of the binary projective space PG(k − 1, 2), which are not all-zero in

the first k − 1 coordinates. The number of such points that are equal to each other in the firstk − 1 coordinates is 2. Similarly, for those that are not all-zero in the first k − 2 coordinates,the number of such points which are equal to each other in the first k − 2 coordinates is 4.Therefore, if we delete the last row of G and then delete the all-zero column, the obtainedsub-matrix of G generates a relative constant-weight code satisfying m(p) ≤ 2 for all pointsP1

00, P010 and P0

01. If we delete the last two rows of G and then delete the all-zero columns,the obtained sub-matrix generates a relative constant-weight code satisfying m(p) ≤ 4. Thisway, we obtain more relative three-weight codes from punctured RM codes, which allow forgeneral multiplicity values.

Summarizing the above results we have the following proposition.

Proposition 1 There exists a large family of codes, consisting of dual Hamming codes (thatis, simplex codes) and subcodes of punctured Reed–Muller codes, which are special instancesof relative constant-weight codes.

4 Applications to wire-tap channel of type II

In this section, we study the applications of relative constant-weight codes to wire-tap channelof type II. For simplicity of the presentation of the main idea and results, we will focus onrelative two-weight codes. The results can be generalized to relative three-weight codes.

Let J be a subset of I = {1, . . . , n}. Define CJ := {(c1, . . . , cn) ∈ C | ct = 0 for t /∈ J}. Bydefinition CJ is a subcode of C. Subcodes CJ play an important role in the noiseless wire-tapchannel of type II with the coset coding. When C⊥ is used in the coset coding scheme, itis shown that dim(CJ) is exactly the number of data symbols that the adversary can obtainwhenever he taps the transmission positions that J represents [7,11]. With regard to thisnumber, we have the following lower bound for an arbitrary linear code C.

Proposition 2 Suppose D is a subcode of C. Then,

dim(Cχ(D)) ≥ dim(D) (9)

where χ(D) is the support of D.

The proof of the proposition is straightforward. By definition of support (see Sect. 2), itis easy to verify that Cχ(D) ⊇ D. This implies the lower bound.

Theorem 2 Suppose C is relative two-weight code with respect to C1. Then, for any subcodeD,

Cχ(D) = D.

123

Page 11: On relative constant-weight codes

Constant-weight codes

Proof It suffices to prove Cχ(D) ⊆ D, by Proposition 2 and Cχ(D) ⊇ D (as showed above).Since any subcode of C is a relative subcode with respect to C1 by Definition 3, we may assumeD is an (r, t) relative subcode and Cχ(D) an (r ′, t ′) relative subcode. Since dim(Cχ(D)) −dim(D) ≥ dim(Cχ(D) ∩C1)−dim(D∩C1), r ′ − t ′ ≥ r − t , or equivalently, r ′ −r ≥ t ′ − t . Itfollows by Lemma 2 that m(Pk−r ′−1) < m(Pk−r−1) if t ′ − t > 0 or if r ′ − r > 0 and t ′ = t ,where Pk−r−1 and Pk−r ′−1 are the projective subspaces corresponding to D and Cχ(D) byLemma 1, respectively. So, w(D) = n−m(Pk−r−1) < n−m(Pk−r ′−1) = w(Cχ(D)) = w(D)

by Lemma 1 again, which is a contradiction. Therefore, r ′ = r and t ′ = t , i.e., Cχ(D) = D. �From the theorem, for a relative two-weight code C, we have dim(Cχ(D)) = dim(D) for

any subcode D. This shows that when the dual code of a relative two-weight code is appliedto the noiseless wire-tap channel of type II, if the adversary taps a number of positions thatconstitute the support of a subcode, then the number of data symbols that the adversary canobtain is equal to the minimal value (the lower bound). Therefore, relative two-weight codesare optimal codes in such an application.

5 Minimal codewords and applications to secret sharing

Another important application of relative constant-weight codes is to secret sharing schemes.We first briefly introduce the basic concepts of secret sharing schemes based on linear codes,which will be required in this section. For more details on secret sharing, please see [3,13,16].

Let G = (g0, g1, . . . , gn−1) be a generator matrix (without any all-zero column) of an[n, k] linear code C, where g0, g1, . . . , gn−1 are the columns of G and none of them is theall-zero vector. In the secret sharing scheme based on C, a secret is an element of G F(q).Thus, G F(q) is called the secret space. The scheme can accommodate n − 1 participants,say, P1, P2, . . . , Pn−1, and a dealer. The dealer is a trusted party.

In order to compute the shares with respect to a secret s, the dealer chooses randomly avector u = (u0, . . . , uk−1) ∈ G F(q)k such that s = ug0. There are altogether qk−1 suchvectors u ∈ G F(q)k . The dealer then treats u as an information vector and computes thecorresponding codeword

t = (t0, t1, . . . , tn−1) = uG

and gives ti to participant Pi as the share for each i ≥ 1.Since t0 = ug0 = s, a set of shares {ti1 , ti2 , . . . , tim }, 1 ≤ ti1 < · · · < im ≤ n − 1 and

1 ≤ m ≤ n−1, determines the secret if and only if g0 is a linear combination of gi1 , . . . , gim .Massey [13] has discovered the following fact: In the secret sharing scheme based on C, a

set of shares {ti1 , ti2 , . . . , tim }, 1 ≤ i1 < · · · < im ≤ n − 1 and 1 ≤ m ≤ n − 1, determinesthe secret if and only if there is a codeword

(1, 0, . . . , 0, ci1 , 0, . . . , 0, cim , 0, . . . , 0

)(10)

in the dual code C⊥, where ci j �= 0 for at least one j .If there is a codeword of (10) in C⊥, then the vecor g0 is a linear combination of

gi1 , . . . , gim , that is, g0 = ∑mj=1 x j gi j for certain coefficients x1, . . . , xm ∈ G F(q). Then

the secret s is recovered by computing s = ∑mj=1 x j ti j .

If a group of participants can recover the secret by combining their shares, then any groupof participants containing this group can also recover the secret. A group of participants isreferred to as a minimal access set, if they can recover the secret with their shares, whileany of its proper subgroups cannot do so. Here, a proper subgroup has fewer members than

123

Page 12: On relative constant-weight codes

Z. Liu, X.-W. Wu

this group. For a secret sharing scheme, an important problem is to determine the set of allminimal access sets.

Definition 4 Given a linear code, a codeword c′ covers a codeword c, if the support of c′contains that of c. If a nonzero codeword c covers only its scalar multiples, but no othernonzero codewords, then c is called a minimal codeword.

From the preceding discussions, it is clear that there is a one-to-one correspondencebetween the set of minimal access sets and the set of minimal codewords of the dual codeC⊥ whose first coordinate is 1. To determine set of minimal access sets of the secret sharingscheme, it is sufficient to determine the set of minimal codewords of C⊥ whose first coordinateis 1, i.e., a subset of the set of all minimal codewords. In the literature, the problem ofdetermining the set of minimal codewords is called the covering problem. Unfortunately, itis well known that the covering problem is a hard problem for an arbitrary linear code (see[1,13] for example).

Attempting to characterize minimal codewords for some special families of linear codes,a useful sufficient condition has been given in [1]. Denote by ωmin and ωmax the minimumnonzero weight and maximum weight of a linear code C over G F(q), respectively. Then, asit has been proved in [1], all nonzero codewords of C are minimal codewords, provided that

ωmin

ωmax>

q − 1

q. (11)

We are now ready to present our results on relative constant-weight codes. In the followingtheorems, all the minimal codewords of a relative two-weight code or a relative three-weightcode are determined.

Theorem 3 Assume C(w1, w) is a relative two-weight code with respect to C1. Then, all thenonzero codewords of C are minimal ones except the following case: dim C1 = 1, and C1

and C have the same effective length. In this case, all the codewords of C\C1 are minimalcodewords.

Proof We prove the theorem by distinguishing the following cases.(Case 1) w1 = w.In this case, C is a linear constant weight code and ωmin = ωmax. Thus, the theorem holds

by (11).(Case 2) w1 < w.Since w1 < w, any codeword c′ ∈ C1 can not cover any codeword of C\C1. Furthermore,

c′ can not cover any other codeword of C1 since C1 is a linear constant weight subcode. Itfollows that any codeword of C1 is a minimal one.

Next, we show that all the codewords of C\C1 are minimal ones. Let c = (c1, . . . , cn) bea codeword of C\C1, and let c covers another codeword c′ ∈ C1, where c′ = (c′

1, . . . , c′n).

Without loss of generality, assume that both c1 and c′1 are nonzero coordinates and that

c1 = θc′1. Then x = c − θc′ is a codeword whose weight is less than that of c. So, we get

x ∈ C1, which implies c = θc′ + x ∈ C1, a contradiction to the fact that c ∈ (C\C1). So, anycodeword c ∈ (C\C1) can not cover any nonzero codeword of C1.

On the other hand, if c ∈ (C\C1) covers another codeword c′ ∈ (C\C1), then since c andc′ have the same weight w, it follows that c and c′ have the same support positions. So,there exists nonzero θ such that the weight of the codeword x = c − θc′ is less than thatof c. It follows that x ∈ C1. If x is not the zero codeword, then c covers x ∈ C1, which is acontradiction to the result stated in the above paragraph. Thus, x is the zero codeword andc = θc′.

123

Page 13: On relative constant-weight codes

Constant-weight codes

The above facts show that all the codewords of C\C1 are minimal.(Case 3) w1 > w.Similarly as in Case 2, we get all the codewords of C\C1 are minimal ones.It is necessary to show that the codewords of C1 are the minimal ones. Assume that c is

any codeword of C1, and c covers c′ ∈ C\C1, and that the effective length of C1 is n1. Ifdim C1 > 1, then w(c) < n1. Without loss of generality, let the first coordinate of c be zeroand write c as

c = (x1, . . . xk1 , 0, . . . , 0

)G,

where G is a generator matrix of C whose columns determine a value assignment. Representthe first column of G by p1, and define a set

S = {p | p is a column of G, and PL1(p) = PL1(p1)

}.

Then (x1, . . . xk1 , 0, . . . , 0) is orthogonal to all the elements of S. Write c′ as

c′ = (y1, . . . yk1 , yk1+1 . . . , yk

)G. (12)

If c covers c′, then (y1, . . . yk1 , yk1+1 . . . , yk) is also orthogonal to the elements of S,in particular, (y1, . . . yk1 , yk1+1 . . . , yk) is orthogonal to the element p0 = PL1(p1) ∈S, i.e., (y1, . . . yk1 , 0, . . . .0) is orthogonal to all the elements of S. It follows that(0, . . . 0, yk1+1, . . . , yk) is orthogonal to all the elements of S. So, we get yk1+1 = yk1+2 =· · · = yk = 0 since rank(S∗) = k − k1 by Lemma 2, where

S∗ ={

p | p = PL1(p), p ∈ S

},

and L1 = {k1 + 1, k1 + 2, . . . k}.It follows that c′ ∈ C1, a contradiction to the fact c′ ∈ (C\C1). This shows that any

codeword c ∈ C1 doesn’t cover any codeword c′ ∈ (C\C1) if dim C1 > 1.If dim C1 = 1 and w(c) = n1 for c ∈ C1, and n1 < n (n is the effective length of C), then

using Lemma 2, one get that the rank of the set

S2 ={

p | p = PL1(p1), p1 ∈ S1

}

is equal to k − k1 = k − 1, where

S1 = {p | p is a column of G, PL1(p) = 0

}.

Note that the codeword c has zero in the coordinate positions S1 represents, whereas anynonzero codeword c′ ∈ (C\C1) has nonzero in at least one of the coordinate positions S1

represents according to (12) and the fact rank(S2) = k − k1. It follows that c doesn’t coverany codeword c′ ∈ (C\C1) when dim C1 = 1 and w(c) = n1 < n.

So, any nonzero codeword of a relative two-weight code is a minimal one except the casethat k1 = 1 and the weight of the codewords of C1 being equal to the effective length of C, inwhich the codewords of C\C1 are all the minimal ones. �Remark 2 Theorem 3 generalizes the results of [10], where the minimal codewords havebeen determined for relative two-weight codes in a special case where the condition (11) issatisfied.

Theorem 4 Assume C(w1, w2, w) is a relative three-weight code with respect to C1 and C2.Then, all the nonzero codewords of C are minimal codewords except the following two cases:

123

Page 14: On relative constant-weight codes

Z. Liu, X.-W. Wu

(1) dim C1 = 1, and C1 and C2 have the same effective length.(2) dim C1 = 1, and C1 and C have the same effective length.

In these two cases, all the codewords of C\C1 are minimal codewords.

Proof We prove the theorem by generalizing the method used in the proof of Theorem 3.Also, the proof is split into several cases.

(Case 1) w1 = w2 or w2 = w. Then C(w1, w2, w) is a relative two-weight code. So, allthe minimal codewords of C can be determined using Theorem 3.

(Case 2) w1 = w > w2.We first show that any codeword c ∈ C\C2 is a minimal one. If c covers a codeword

c′ ∈ C1, then c and c′ have the same support positions since w(c) = w(c′) = w. So, thereexists a a ∈ G F(q) such that the codeword u = c −ac′ has zero coordinate in at least one ofthe support positions of c, i.e., w(u) < w = w1. If u = 0, then c = ac′ ∈ C1, a contradictionto c ∈ C\C2. It follows that w(u) = w2. So, u ∈ C2\C1. It follows c = ac′ + u ∈ C2, again acontradiction to c ∈ C\C2. So, c doesn’t cover any codeword c′ ∈ C1.

We further show that c ∈ C\C2 doesn’t cover any codeword c′ ∈ C2\C1. Otherwise, wesimilarly find a a ∈ G F(q) such that u = c − ac′ �= 0 and w(u) = w2 < w(c) = w = w1.It follows that u ∈ C2\C1. So, c = u + ac′ ∈ C2, a contradiction to c ∈ C\C2.

We last show that c ∈ C\C2 doesn’t cover any other codeword c′ ∈ C\C2 unless c′ = acfor some a ∈ G F(q). If c covers c′, then c and c′ have the same support positions sincew(c) = w(c′) = w. So, we similarly find a a ∈ G F(q) such that u = c′ − ac andw(u) < w = w1. If u �= 0, then w(u) = w2 and u ∈ C2\C1. It follows that c covers thecodeword u, a contradiction to the fact that c doesn’t cover any codeword of C2\C1. So, u = 0,i.e., c′ = ac.

From the above text, we get all the codewords of C\C2 are minimal ones.Next, we show that all the codewords of C2\C1 are minimal ones. Assume c ∈ (C2\C1).

It is clear that c doesn’t cover the codeword c′ ∈ (C\C2) or c′′ ∈ C1 since w(c) = w2 <

w(c′) = w(c′′) = w = w1. If c covers another codeword c′ ∈ (C2\C1), then we similarlyfind u = c′ − ac such that w(u) < w(c) = w2 since w(c) = w(c′) = w2. So, u = 0, i.e.,c′ = ac for some a ∈ G F(q).

Last, we show that all the codewords of the linear constant weight subcode C1 are minimalones. Assume c ∈ C1. Then c doesn’t cover c′ ∈ (C\C2). Otherwise, c′ also covers c sincew(c) = w(c′). It is necessary to show that c doesn’t cover any codeword c′ ∈ (C2\C1).Assume the effective length of C1 is n1. If dim C1 > 1, then w(c) < n1. Without loss ofgenerality, let the first coordinate of c be zero and write c as

c = (x1, . . . xk1 , 0, . . . , 0

)G,

where G is the generator matrix of C whose columns determine a value assignment. Representthe first column of G by p1, and define a set

S = {p | p is a column of G, and PL1(p) = PL1(p1)

}.

Then (x1, . . . xk1 , 0, . . . , 0) is orthogonal to all the elements of S. Write c′ ∈ (C2\C1) as

c′ = (y1, . . . yk1 , yk1+1 . . . , yk2 , 0, . . . , 0

)G.

If c covers c′, then (y1, . . . yk1 , yk1+1 . . . , yk2 , 0, . . . , 0) is orthogonal to the element ofS, in particular, (y1, . . . yk1 , yk1+1 . . . , yk2 , 0, . . . , 0) is orthogonal to the element p0 =PL1(p1) ∈ S, i.e., (y1, . . . yk1 , 0, . . . .0) is orthogonal to all the elements of S. It followsthat (0, . . . 0, yk1+1, . . . , yk2 , 0, . . . , 0) is orthogonal to all the elements of S∗, where

S∗ = {p | p = PL2(p), p ∈ S

},

123

Page 15: On relative constant-weight codes

Constant-weight codes

and L1 and L2 are defined as before. Since rank(S∗) = k2 − k1 according to Theorem 1,we get yk1+1 = yk1+2 = · · · = yk2 = 0. It follows that c′ ∈ C1, a contradiction to the factc′ ∈ (C2\C1). This shows that any codeword c ∈ C1 does n’t cover any codeword c′ ∈ (C2\C1)

if dim C1 > 1.On the other hand, If dim C1 = 1 and w(c) = n1 < n2 (n2 is the effective length of C2),

then using Theorem 1 and similarly to the proof of (Case 3) of Theorem 3, we get that c ∈ C1

doesn’t cover any codeword c′ ∈ (C2\C1).It follows that all the codewords are the minimal ones except that dim C1 = 1 and w(c) =

n1 = n2 for c ∈ C1, in which all the codewords in C\C1 are the minimal ones.Using the techniques in the proof of (Case 2), we may similarly show the results in (Case

3)–(Case 9), and we only list these results:(Case 3) w1 = w < w2. Then all the codewords of C are minimal ones.(Case 4) w1 < w2 < w. Then all the codewords of C are minimal ones.(Case 5) w1 < w < w2. Then all the codewords of C are minimal ones.(Case 6) w2 < w1 < w. Then all the codewords of C are minimal ones except the case

dim C1 = 1 and C1 and C2 have the same effective length. In such a case, all the codewordsof C\C1 are the minimal ones.

(Case 7) w2 < w < w1. Then all the codewords of C are minimal ones except the casedim C1 = 1 and C1 and C2 have the same effective length or the case dim C1 = 1 and C1 andC have the same effective length. In these cases, all the codewords of C\C1 are the minimalones.

(Case 8) w < w1 < w2. Then all the codewords of C are minimal ones except the casedim C1 = 1 and C1 and C have the same effective length. In such a case, all the codewords ofC\C1 are the minimal ones.

(Case 9) w < w2 < w1. The result is the same as in (Case 7). �

6 Comparison and further discussions

In this section, we will compare relative constant-weight codes with the existing families ofcodes for which minimal codewords can be determined [1,5,6,8,16], and with well-knownthree-weight codes [3,17].

In [8], certain binary cyclic codes for which all nonzero codewords are minimal have beenstudied. It is easy to see that the relative constant-weight codes are in general not cyclic.Therefore, relative constant-weight codes are not a sub-family of the known codes in [8]. Seethe following example.

Example 3 Consider the code generated by⎛

⎜⎜⎝

1 1 1 1 1 1 1 1 0 0 0 00 0 0 0 1 1 1 1 1 1 1 10 0 1 1 0 0 1 1 0 0 1 10 1 0 1 0 1 0 1 0 1 0 1

⎟⎟⎠ .

It is a relative two-weight code with respect to the 2-dimensional subcode generated bythe first two rows of the matrix. It is obvious that the code is not cyclic. For instance, for thefirst row of the generator (which is a codeword), shifting the last bit to the first position, weget (011111111000) which is not a codeword of this code.

According to Theorems 3 and 4, not all relative two-weight and three-weight codes havetheir nonzero codewords as minimal codewords. See the following example.

123

Page 16: On relative constant-weight codes

Z. Liu, X.-W. Wu

Example 4 Consider the ternary code generated by⎛

⎜⎜⎝

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 00 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 00 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 0 0 0 1 1 1 2 2 2 00 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 1

⎟⎟⎠ .

The code is a relative three-weight code with respect to the subcode generated by the firstrow of the matrix and the subcode generated by the first three rows of the matrix. According toTheorem 4, only part of nonzero codewords of this code are minimal, that is, all the nonzerocodewords except those generated by the first row of the matrix are minimal.

On the other hand, it is well known that all the nonzero codewords are minimal for inter-secting binary codes [1,5,6]. Example 4 gives a relative three-weight code which is nonbinaryand does not satisfying the necessary condition of intersecting binary codes. Although thecode of Example 4 would be an intersecting code, if we extend the definition of intersectingcodes to nonbinary cases, it is certainly not a code defined and studied in [1,5,6].

All of the codes studied in [8] and [16] satisfy the condition (11). On the other hand, arelative constant-weight code does not necessarily satisfy (11).

Example 5 Consider a 4-dimensional relative three-weight ternary code C with respect to a2-dimensional subcode C1 and a 3-dimensional subcode C2 ⊃ C1. The value assignment ofthe code is given as follows.

m(p) =⎧⎨

1, p is a point P100

0, p is a point P010

12, p is a point P001.

It is easy to verify that the nonzero codewords of C1 have weight 27, the codewords ofC2\C1 have weight 24, and the codewords of C\C2 have weight 36. All the nonzero codewordsare minimal according to Theorem 4. However, for this code,

ωmin

ωmax= 24

36= 2

3= q − 1

q,

Thus, C does not satisfy (11).The codes studied in [16] may not be two-weight or three-weight codes (see the second and

third classes of codes in [16]). Even if the codes constructed in [16] are three-weight codes(that is, they only have three distinct weights) for some low-dimensional cases, they maynot be relative three-weight codes. In the following example, the code C is a 3-dimensionalternary linear code obtained by using the construction in [16].

Example 6 The generator matrix of the dual code C⊥ has been given in [16], and we canwrite the generator matrix of C as follows.

⎝2 1 2 1 1 0 0 2 1 0 0 00 0 2 2 1 1 2 0 0 1 1 02 1 1 1 2 2 0 1 0 1 0 1

⎠ .

C is indeed a three-weight code with weights 7, 9 and 10. However, C does not satisfyDefinition 2 no matter how we set up the parameters w1, w2 and w in Definition 2. Thus, itis not a relative three-weight code.

In the following we compare relative three-weight codes with the well-known three-weightcodes in [3,17].

123

Page 17: On relative constant-weight codes

Constant-weight codes

Remark 3 It is easy to see that our relative three-weight codes are new codes which are notcovered by the classes of codes in [3,17]. In [17] a class of three-weight cyclic codes overG F(p), where p is an odd prime, are studied. On the other hand, our relative three-weightcodes are constructed over an arbitrary finite filed (including the binary field). The three-weight codes in [17] are all cyclic codes; while the relative three-weight codes are generallinear codes.

Let us now compare the code parameters. The codes in [17] are either [pk2 − 1, k, p

k2 −

pk2 −1 − p − 1

2 p(k/2+e−2)/2] codes or [pk2 − 1, k, p

k2 − p

k2 −1 − (p − 1)p(k/2+e−2)/2] codes,

where the dimension k is an even number and e is a positive integer which divides k/2.Thus, the dimension k of the codes in [17] has to be an even number, and the length isonly dependent on the dimension k and the parameter e (which is a divisor of k/2). Onthe other hand, the dimension of relative three-weight codes can be any integer. Therefore,the relative three-weight codes with odd dimension are certainly different from the codes in[17]. Furthermore, the length of relative three-weight codes is dependent on not only k, butalso m(P1

00), m(P010), m(P0

01), the dimension of the subcode C1, and the dimension of thesubcode C2 (which are all variables). Thus, for a given dimension k, the family of relativethree-weight codes may contain much more codes than the class of codes in [17].

The three-weight codes in [3] are [q2t − 1, 3t] codes. It is clear that when q is even (forexample, q = 2), the code length has to be odd. By (3) the length of relative three-weightcodes is given by

n =(

2k − 2k−k1)

m(P1

00

) +(

2k−k1 − 2k−k2)

m(P0

10

) +(

2k−k2 − 1)

m(P0

01

)

which can be any integer. For instance, setting m(P001) = 2, the length is even. These relative

three-weight codes of even length are obviously different from the codes in [3]. Similarly,when q is odd, the length of the codes in [3] must be even number; but the length of relativethree-weight codes can be any integer (including odd number). According to the the resulton the weight distribution of the three-weight codes (please see Theorem 25 of [3]), the threenon-zero weights are distinct. On the other hand, the relative three-weight codes containtwo-weight codes (for example, those in [10]) as special instances.

7 Conclusion

We have investigated relative constant-weight codes, namely, relative two-weight and three-weight codes. A geometric approach has been established to characterize relative constant-weight codes, making use of the finite projective geometric. A sufficient and necessary con-dition for linear codes to be relative three-weight codes has been derived, using the geometricapproach. A family of infinite number of relative constant-weight codes are constructed. It isshowed that the relative constant-weight codes include the well-known dual Hamming codesas well as subcodes of punctured Reed–Muller codes as special instances. Furthermore, theminimal codewords of relative two-weight and three-weight codes were completely deter-mined. Applications of relative constant-weight codes to wire-tap channel of type II andsecret sharing have been discussed. A comparative study shows that the relative two-weightand three-weight codes are a new family of codes; they are not covered by previously well-known linear codes for which minimal codewords can be determined or existing three-weightcodes.

123

Page 18: On relative constant-weight codes

Z. Liu, X.-W. Wu

References

1. Ashikhmin A., Barg A.: Minimal vectors in linear codes. IEEE Trans. Inf. Theory 44(5), 2010–2017(1998).

2. Bouyukliev I.G.: Classification of Griesmer codes and dual transform. Discret. Math. 309(12), 4049–4068(2009).

3. Carlet C., Ding C., Yuan J.: Linear codes from perfect nonlinear mappings and their secret sharingschemes. IEEE Trans. Inf. Theory 51(6), 2089–2102 (2005).

4. Chen W.D., Kløve T.: The weight hierarchies of q-ary codes of dimension 4. IEEE Trans. Inf. Theory42(6), 2265–2272 (1996).

5. Cohen G.D., Lempel A.: Linear intersecting codes. Discret. Math. 56(1), 35–43 (1984).6. Encheva S.B., Cohen G.D.: Constructions of intersecting codes. IEEE Trans. Inf. Theory 45(4), 1234–

1237 (1999).7. Forney G.D.: Dimension/length profiles and trellis complexity of linear block codes. IEEE Trans. Inf.

Theory 40(6), 1741–1752 (1994).8. Li Z.H., Xue T., Lai H.: Secret sharing schemes from binary linear codes. Inf. Sci. 180(22), 4412–4419

(2010).9. Liu Z.H., Chen W.D.: Notes on the value function. Des. Codes Cryptogr. 54(1), 11–19 (2010).

10. Liu Z.H., Zeng X.Y.: On a kind of two-weight code. Eur. J. Comb. 33(6), 1265–1272 (2012).11. Luo Y., Mitrpant C., Han Vinck A.J., Chen K.F.: Some new characters on the wire-tap channel of type II.

IEEE Trans. Inf. Theory 51(3), 1222–1229 (2005).12. MacWilliams F.J., Sloane N.J.A.: The Theory of Error-Correcting Codes. North-Holland, Amsterdam

(1977).13. Massey J.L.: Minimal codewords and secret sharing. In: The 6th Joint Swedish-Russian Workshop on

Information Theory, Mölle, Sweden, pp. 276–279 (1993).14. Pellikaan R., Wu X.-W., Bulygin S., Jurrius R.: Error-Correcting Codes and Cryptology. Cambridge

University Press, Cambridge (2012).15. Tsfasman M.A., Vladuts S.: Geometric approach to higher weights. IEEE Trans. Inf. Theory 41(6),

1564–1588 (1995).16. Yuan J., Ding C.: Secret sharing schemes from three classes of linear codes. IEEE Trans. Inf. Theory

52(1), 206–212 (2006).17. Zhou Z.C., Ding C.: A class of three-weight cyclic codes (2013) (arXiv: 1302.0569vl [cs.IT]).

123