1 Limited-Magnitude Error-Correcting Gray Codes for Rank Modulation Yonatan Yehezkeally, Student Member, IEEE, and Moshe Schwartz, Senior Member, IEEE Abstract—We construct Gray codes over permutations for sinceemployedmethodsofrelabelingtooptimizetheminimal the rank-modulation scheme, which are also capable of cor- distance of known constructions. recting errors under the infinity-metric. These errors model 6 Gray codes were first discussed over the space of binary limited-magnitude or spike errors, for which only single-error- 1 vectors, where each pair of consecutive vectors differed by detecting Gray codes are currently known. Surprisingly, the 0 error-correcting codes we construct achieve a better asymptotic a single bit-flip [17]; the concept has since been generalized 2 rate than that of presently known constructions not having the to include codes over arbitrary alphabets, requiring only that n Gray property, andexceed theGilbert-Varshamov bound.Addi- codewords could be ordered in a sequence, where each code- u tionally, wepresent efficient rankingandunrankingprocedures, wordisderivedfromthepreviousbyoneofapredefinedsetof J aswellasadecodingprocedurethatrunsinlineartime.Finally, functions. Other suggested usages of Gray codes, surveyedin we also apply our methods to solve an outstanding issue with 9 error-detecting rank-modulation Gray codes (snake-in-the-box [28],includepermanent-computation[26],circuit-testing[27], 1 codes) under a different metric, the Kendall τ-metric, in the image-processing [1], hashing [15], coding [14], [21], [29] ] group of permutations over an even number of elements S2n, and data storing/extraction[8]. In particular, in the context of T where we provide asymptotically optimal codes. rank modulation, the use of Gray codes has been shown to I Index Terms—Gray codes, error-correcting codes, permuta- reduce write-time by eliminating the risk of programming- . s tions, spread-d circuit codes, rank modulation overshoot and allow integration with other multilevel-cells c [ coding schemes [12], [13], [21]. 3 I. INTRODUCTION Gray codes with error-correction capabilities have some- times been referred to as spread-d circuit codes (see [19] v RANK modulationis a method for storing information in 8 and references therein). Specifically, in the context of rank non-volatile memories [21], which has been researched 1 modulation, such codes were so far only studied for the case in recent years. It calls for storing information in relative 2 of single-error-detection, where they were dubbed snake-in- 5 values stored in a group of cells rather than the absolute the-box codes (or, more appropriately, coil-in-the-box codes, 0 values of single cells. More precisely, it stores information whentheyarecyclic).[36]studiedthesecodesunderboththe 1. in the permutation suggested by sorting a group of cells Kendall τ-metric and the ℓ∞-metric, and more recent papers 0 by their relative values, e.g., charge levels in flash memory [18], [20], [38] have categorized and constructed optimally 6 cells. It allows for increased robustness against certain noise sized coil-in-the-box codes under the former metric for odd 1 mechanisms (e.g., charge leakage in flash memory cells), as : orders, although the case of even orders proved more chal- v well as alleviating some inherent challenges in flash memo- lenging (see [37] in addition to the aforementioned papers). Xi ries(e.g.,programming/erasure-asymmetryandprogramming- In this work we focus on the ℓ∞-metric and present a overshoot). Permutation codes have also previously seen us- r construction of error-correcting Gray codes capable of cor- a agesinsource-encoding[3]–[5],[31]andsignaldetection[7], recting an arbitrary number of limited-magnitude errors. The as well as other fields [6], [9], [10], and more recently been allowed transitions between codewords are the “push-to-the- used in power-line communications [34]. top” operations,used in most previousworks [12], [13], [18], Severalerrormodelshavebeenstudiedforrankmodulation, [20], [21], [36], [38]. Theresulting codeswill be shownto be including the Kendall τ-metric [2], [22], [25], [39], the ℓ∞- larger than known constructions in the case of fixed minimal metric [24], [30], [32], [33] and other examples [11], [16]. In distance,aswellasachievebetterasymptoticratesthanknown this paper we focus on the ℓ∞-metric, which models limited- codes in the case of d =Θ(n). magnitudeorspike noise,i.e.,we assume thattherankof any Wewillalsobrieflyexamineerror-detectingcodesunderthe given cell–its position when sorting the group of cells–could Kendall τ-metric for even orders, since methods developed not have changed by more than a given amount. [24], [32] for the application of our main construction can readily be have presented constructions for error-correcting codes under adaptedtothatpurpose.Weprovideanasymptoticallyoptimal this metric, as well as explored some non-constructivelower- construction which nearly completes the categorization of andupper-boundsontheparametersofexistingcodes.[33]has available codes for that scheme. The paper is organizedas follows. In Section II we present ThisworkwassupportedinpartbyISFgrantno.130/14.Thispaperwillbe presented inpartatthe2016IEEEInternational SymposiumonInformation notationsanddefinitions.InSection IIIwestudyanewkindof Theory. auxiliarycodeswhicharerequiredforourconstruction,before TheauthorsarewiththeDepartmentofElectricalandComputerEngineer- presenting it in Section IV and discussing its performance in ing,Ben-GurionUniversityoftheNegev,BeerSheva8410501,Israel(e-mail: [email protected]; [email protected]). comparison with known constructionsand bounds. We devise 2 a decoding algorithm for the generated codes in Section V, we say that C is cyclic, and include t = t in its generating M and discuss ranking and unranking procedures in Section VI. transition sequence. If C = S, we say that C is a complete We briefly present an adaptation of the developed auxiliary code. codes to error-detecting codes under the Kendall τ-metric in Section VII.Finally,weconcludeinSection VIIIbyreviewing Example1 In the classic example of a Gray code we have, our results and suggesting problems for future study. e.g., S = F 3, with T consisting of the group action of 2 001,010,100 S on S, defined { }⊆ II. PRELIMINARIES v(u)=u+v. For n N, we let S be the symmetric group, the set of n all permu∈tations on [n] = 1,2,...,n (i.e., bijections σ : We then have the complete cyclic Gray code given by { } 1 1 [n] − [n]), with composition as group action: 000001001010011001010100110001111010101001100100000. −on→to −→ −→ −→ −→ −→ −→ −→ −→ στ(k)=(σ τ)(k)= σ(τ(k)). ✷ ◦ Throughoutthepaperweshalldenotetheidentitypermutation In this paper, we fix S = S . We say that C = n IdW∈eSunsedethfienecdycfloernaoltlaktio∈n[fno]r:pIder(mk)ut=atiko.ns,i.e., fordistinct w(ci1th,c2tr,a.n.s.i,ticoMn)s⊆et STn=isaGti↑(n,iM<)ji6fitnis.aWcyhcelincGi r=ay1cowdee i j suacjhkj=th1at⊆σ[(na])we=leat σ =(a1,a2a,n.d..,σa(kb))b=e thbe fpoerrmaulltabtion arenfderwteolCikeawsaise“pduesnho-tteo-“tph(cid:8)ues-th↑o-pto|”-cthoed-eboanttdom(cid:9)de”ncootdeeistGG↑((nn,,MM)),. (cid:8) (cid:9) j (jmodk)+1 ∈ ↓ k [n] a . Trivially, every permutationcan be represented \ j j=1 Example2 It has been remarked in [21] that as a composition of disjoint cycles. It is also well known (cid:8) (cid:9) tohfattraevnesrpyospiteiromnsu,tactyiocnlescaonfbleenrgetphre2s,enatneddtahsatathceomppaoristiytioonf 12 t↑2 21 t↑3 32 t↑3 13 t↑2 31 t↑3 23 ty↑3 −→ −→ −→ −→ −→ the number of transpositions in that representation is unique 3 3 1 2 2 1 (although the representation itself is not). We therefore have is a G (3,6), i.e., a complete cyclic “push-to-the-top” Gray even and odd permutations, and the set of even permutations code o↑ver S . ✷ forms a subgroup A 6S named the alternating group. We 3 n n willsaythatC Snisparity-preservingifeverytwoelements It is worthwhile to note that when S is a group, and ⊆ σ,τ C have the same parity, that is, signσ =signτ. T consists of the group action of some subset on S, and ∈ We also use the vector notation for permutations, C is a (complete- and/or cyclic-) Gray code generated by t ,t ,...,t (,t ), then for all σ S we observe that σ =[σ(1), σ(2), ... ,σ(n)]. 1 2 M 1 M (σ,t (σ),t (−t (σ)),...) is also a (com∈plete- and/or cyclic- 1 2 1 This allows us to more easily notate, for 1 6 i < j 6 n, the respectively) Gray code. In other words, the code is shift “push-to-the-ith-index”transition ti j : Sn Sn by invariant. In these cases we might refer to the transition ↑ → sequencegeneratingthecodeasthecodeitself,whendesirable t a ,a ,...,a ,a,a ,...,a ,a ,a ,...,a i↑j 1 2 i−1 i i+1 j−1 j j+1 n for simplicity. It is also of interest to observe that ti j(σ) = =(cid:0)(cid:2)a1,a2,...,ai 1,aj,ai,ai+1,...,aj 1,aj+1,...,an(cid:3)(cid:1). σ (j,j 1,...,i),i.e.,“push-to-the-ith-index”transit↑ionsare − − ◦ − group actions. We f(cid:2)ollow [20], [21], [36], [38] (among others) in dubb(cid:3)ing “push-to-the-1st-index”transitionsas “push-to-the-top” tran- When S is equipped with a metric d : S×S → R+, and C S has the property that for all σ,τ C either stoit-itohnes-,baonttdomw”edtreannostietiot↑nj o=ntt1h↑ej.jFthinianlldye,xw,etde:fiSnetheS“p,ush- σ = τ⊆or d(σ,τ) > d, for some constant d >∈0, then C j n n ↓ → (when considered as an unordered set) is commonly referred t a ,a ,...,a ,a ,a ,...,a to as an error-correcting code with minimal distance d. If j 1 2 j 1 j j+1 n ↓= a ,a ,...,a− ,a ,...,a ,a . d( , ) models an error mechanism, such that a single error (cid:0)(cid:2) 1 2 j−1 j+1 n j(cid:3)(cid:1) cor·re·sponds to distance 1, and 2p+q < d, it is well known Given any set(cid:2)S, and a collection of transition(cid:3)s that C can then correct p errors, and also detect q additional errors. T f f : S S , ⊆ { | → } Error-correcting Gray codes have sometimes been referred we define a T-Gray code over S to be a sequence to as spread-d circuit codes (see [19] and references therein), C =(c )M S such that for all 1 6 r < r 6 M we where they were traditionally defined by requiringthat for all have cr=r=c1 ⊆and such that for all 1 6 r < M′there exists c ,c C, (r r mod C ) > d implies d(c ,c ) > d. r 6 r′ r r′ ∈ − ′ | | r r′ t T satisfying c = t (c ) (we say that a sequence C is In that way, e.g., spread-1 circuit codes are traditional Gray r r+1 r r ∈ containedinS,byabuseofnotation,ifc Sforallr.Thatis, codes. This eased requirement was made necessary since, r ∈ we may refer to a Gray Code as an unordered set–or simply working with the Hamming distance d in the n-cube, one H a code–when desired for simplicity). We call M = C the cannot have codewords at distance less than d in the code | | size of the code, and t ,t ,...,t the transition sequence sequenceattainadistanceofatleastd.Weshalldepartfromit 1 2 M 1 generating C. If there exists t −T such that c = t(c ) heretodealwithGraycodeswhichareclassicerror-correcting 1 M ∈ 3 TABLEI This motivates us to examine another family of codes, CODENOTATIONSFORC⊆Sn. namely, parity-preserving codes, due to the following obser- Notation Definition vations. Gi↑(n,M) Cc(r=mo(dcrM)rM)=+11⊆=Stin↑jrs(uccrh).thatforallr: Lemma4 If C ⊆Sk is parity-preserving then |C|6 |S2k|. G (n,M) Cisa G1 (n,M). ↑ ↑ Proof: Either C A or C S A . G (n,M) C=(cr)rM=1⊆Sn suchthatforallr: ⊆ k ⊆ k\ k ↓ c(rmodM)+1=t↓jr(cr). Lemma5 If C S is a parity-preserving G (k,M), then C (n,M,d)-LMRM dC∞⊆(cS1,nc,2|)C>|=d.Mandforallc16=c2∈C: is Gaux(k,M). ⊆ k ↑ ↑ Gi↑(n,M,d) Cisa Gi↑(n,M)andan(n,M,d)-LMRM. Proof: Observe that signσ = sign(q,k)σ for all G (n,M,d) Cisa G1 (n,M,d). q [k 1], thus both cannot belong6 to C. ↑ ↑ ∈ − C is a G (k,M), and for all q [k 1]: Parity-preserving Gaux(2m+1,M) codes are known to G↑aux(k,M) (σSe∈eCSec=t⇒io↑n(IIqI,.)k)σ6∈C. ∈ − exist, achieving the afo↑rementioned bound. Lemma6 [18] For all m = 2, there exist parity-preserving codes, but the codes presented in this paper are nevertheless also, in particular, spread-d circuit-codes. G (2m + 1,(2m2+1)!) code6s. The largest parity-preserving We shall focus on the ℓ∞-metric defined on Sn by G↑↑(5,M) codes have M =57. d∞(σ,τ)=max σ(j) τ(j) . Although not declared, it is shown in [18] that such codes j [n]| − | can be assumed to have t as the first transition in their ∈ 2m+1 generatingtransitionseque↑nce,andfurthermore,thattheyalso That is, it is the metric induced on S by the embedding into n Zn (and, indeed, Rn) implied by the vector notation, and employ at least one t 2m 1 transition. the ℓ∞-metric in these spaces. [32] studied error-correcting In comparison, as↑ n−oted in [36], a parity-preserving codes in Sn with d∞, which it dubbed limited-magnitude G (2m,M) must satisfy M6 |S22mm|, as it must never employ rank-modulation codes, and denoted a code C with minimal a ↑t 2m transition. We therefore examine more general Gaux distance d as an (n, C ,d)-LMRM code. In our case, if a cod↑es, which are not parity-preserving. We begin by not↑ing G (n,M) is also an (|n,|M,d)-LMRMcode, we shall denote the following lemma. i it a↑ G (n,M,d) (likewise for G and G ). i Fina↑lly, we organize our notati↑on of co↓des in Table I. Lemma7 [21, Thm.4,7]For all n>1 there exist G (n,n!) codes, that is, complete and cyclic “push-to-the-top↑” Gray codes over the symmetric group S . III. AUXILIARY CONSTRUCTION n Before we present the main construction of our paper, we Relying on these codes, we construct auxiliary codes in first describe in this section a constructionfor auxiliarycodes the following theorem. Similarly constructed codes already which will be a component of the main construction. appearedinadifferentcontextascomponentsinaconstruction WedefineauxiliarycodesinS inthefollowingway:wesay in [21]. k that C is Gaux(k,M) if it is G (k,M) and for all q [k 1] it holds tha↑t ↑ ∈ − Theorem8 For all m > 2 there exists a Gaux(2m, |S2m|), 2m 1 starting at Id and with a generating sequenc↑e starting −with σ C = (q,k) σ C. ∈ ⇒ ◦ 6∈ t 2m. ↑ In our main construction, we will use a Gaux(k,M) code Proof: Take a G (2m 2,(2m 2)!) code C , provided (cr)rM=1, which we also require to satisfy ↑c1 = Id and by Lemma7. We fo↑llow −the conc−ept of [21, T′hm. 7] in c2F=irstt↑lky,Idn.otWeethhatenthceeosntulydyexthisetinexgisGteanucxe(2o,fMsu)cchodceosdeasre. the extending C′ to S2m. Let us define singletons {Id},{(1,2)}. However, fo↑r k > 3 there do exist σ0 = t↑2mId=[2m,1,...,2m−1]. Gaux(k,M) codes with M>3, as one such example is If we take t ,t ,...,t to be the transition sequence ↑ generating C↑i1, th↑ei2n the tr↑ain(2smi−ti2o)!n sequence Id,t Id,t 2Id . ′ 3 3 ↑ ↑ We also note the folnlowing: o t↓2m+1−i1,t↓2m+1−i2,...,t↓2m+1−i(2k−2)! of “push-to-the-bottom” operations, applied in succession to Lemma3 If C ⊆Sk is G↑aux(k,M), then M6 |S2k|. eσl0e,mgeenntesr’avteesctCor′′n⊆otaSt2iomn,sabGeg↓i(n2mwi,t(h2m[2m−,21)].!), all of whose Proof: Take q [k 1], andobservethat σ (q,k)σ is We now note that t = t 2m 1t . Thus, by anS -automorphism∈,und−erwhichCanditsimage7→aredisjoint. replacing each t ↓2mw+it1h−jt fol↑lo2mwed−by↑ja sequence k 2m+1 j j Hence 2M6 S . of 2m 1 occu↓rrence−s of t ↑, we get C S , a | k| − ↑2m ⊆ 2m 4 G (2m,(2m 2)!2m), where every block of 2m elements is We note in particular that for all r, πˆ is even, and thus r co↑mprised of−cyclic shifts of some σ C . P A . Moreover, since the parity-preserving code P ′′ r 2m+2 r ∈ ⊆ The code C is known to be a Gray code [21, Thm. 7]. does not employ t , for all π P it holds that Moreover, if σ C satisfies τ = (q,2m)σ C, note that ↑2m+2 ∈ r both have a vec∈tor notation with 1 immediat∈ely (cyclically) π(2m+2)= πˆr(2m+2) following 2m, but since τ = (q,2m)σ its vector notation has 2m+2 r 0 (mod 2m), = ≡ 1 following q. It follows (by abuse of notation) that q =2m. (2m+1 (r mod2m) r 0 (mod 2m). Finally, note that C is generated by a transition sequence − 6≡ Thus, when considered as sets, ending with 2m 1 instances of t , so it includes Id fsoatlilsofiweesdthbeythaeto↑r2e−mm.transition. A cyc↑li2cmshift of C therefore Pr∩Pr′ =∅, for all 06r <r <2m. ′ Example9 To construct a Gaux(4,8) we utilize the complete We shall construct a Gaux(2m+2,M) code by stitching G (2,2) code Id,t Id , g↑enerated by t ,t , to arrive by together P1,P2,...,P2m 1.↑We will need to amend P0 before th↑e G (4,2) code ↑2 ↑2 ↑2 incorporating it into ou−r code, for reasons we shall discuss ↓ (cid:8) (cid:9) below.First,wedescribethestitchingmethodinthefollowing C′′ = [4,1,2,3],[4,1,3,2] , lemma. { } which is generatedby t ,t . We recallthat t =t 3 t , allowing us to expand C↓3 i↓n3the following ma↓n3ner: ↑4 ◦ ↑3 Lemma11 For all r > 0 (including, in particular, ′′ r = 2m 1), we may concatenate P,P into a (non- r r+1 − 4 2 3 1 4 3 2 1 cyclic) “push-to-the-top” code by applying the transitions 123→t↑3413→t↑4241→t↑4324→t↑4132→t↑3412→t↑4341→t↑4234ty↑4 tt↑22mm+21,−t1↑π2ˆmr.+2Adtdoitiothnealllya,stthepeornmlyutaotdiodnpeorfmuPtra,tiownhiicnhthies ∈ ∈ re↑sul−ting code is C′′ C′′ Finally,weobservethatshiftingtheresultingcodesoitbegins βr+1 =t 2m+2−1(πˆr+1). with Id is satisfactory. ✷ ↑ We shall refer to it as the (r+1)-bridge. Weremarkthat,whileTheorem8doesnotproduceauxiliary Proof: The claim follows trivially from the definition codes much larger than the parity-preserving code of size |S22mNm|e,xitt, dwoeespraetsleenatstanaloltohwerucsotnostpruercmtiountewthheiclhasytieelledmselanrtg.er πˆr+1 = ϕ(πˆr) =t↑2m+2◦ t↑2m+2◦t↑2m−1−1(πˆr) , (cid:16) (cid:17) codes, for even k > 6 (but not k = 4). From now on, we fix since Pr,Pr+1 are parity-preserving, and t 2m+2 flips parity. ↑ m>2. We also define ϕ : S S by 2m+2 2m+2 → Lemma11 can be used iteratively to concatenate ϕ =t↑2m+22◦t↑2m−1−1. bPr1i,dPg2e,–.b.e.t,wPe2emn−1e,acwhitphairaofsinPgle,oPd.dTpheursm, uwtaetioobnt–atihnethre- We note that r 1 r sequence − ϕ(π) = π (1,2m+1)(2m+2,2m,2m 1,...,2), P ,β ,P ,β ,...,β ,P . ◦ − 1 2 2 3 2m 1 2m 1 − − Hence, informally, in π’s vector notation, ϕ transposes the Note that if any two permutations π ,π in the resulting se- 1 2 elements in indices 1,2m+1, and cyclically shifts all other quencesatisfy π = (q,2m+2) π for some q [2m+1], 1 2 elementsonceto the top.We canalso observethat ϕ2m =Id. then w.l.o.g π is odd and hence◦an r-bridge for s∈ome r, and 2 We conveniently define, for all r>0, the permutations π is even and thus not a bridge. Since in every bridge the 1 last element is πˆ = ϕr(Id) r =(1,2m+1)r(2m+2,2m,2m−1,...,2)r ∈ S2m+2, βr(2m+2)=πˆr(1)∈ {1,2m+1}, In particular, we note that when r r (mod 2m), and only and in every non-bridge it is not, it must follow, then, that ′ then, we have πˆr = πˆr . ≡ q= βr(2m+2), and in particular ′ π (2m+2) =(β (2m+2),2m+2) β (2m+2) 1 r r Lemma10 For all r > 0 a parity-preserving G (2m + ◦ 2,M )code P existswhichbeginswithπˆ anden↑dswith =2m+2, 2m+2 r r t 2m 1−1πˆr, where thus π1 P0. ↑ − ∈ We witness, therefore, that no such pair of permutations 57 m =2, M2m+2 = ((2m2+1)! m >2. eaxlsiost,bseicnocmeewseaphpavaerennottthyaettPin0comrupsotranteecdePss0ariniltyoboeuramcoedned.eIdt prior to its inclusion, so it does not include any permutations Proof: The claim follows trivially from Lemma6, if we of the form shift the generating transition sequence such that it ends with t and apply it to πˆ , due to Lemma5. (β (2m+2),2m+2) β , 0<r62m. ↑2m−1 r r ◦ r 5 In order to do so, we note that for all r >0 We observe that P˜ is still a “push-to-the-top” code since “push-to-the-top” transitions are group actions by right- β (2m)=πˆ (2m+1) 1,2m+1 , r r ∈ { } multiplications. Moreover, since π˜(k) = k, if for some π ,π P we have π˜ 1 π = (q,k) π˜ 1 π , where and in particular βr(2m) =2m+2, hence 1 2 ∈ − ◦ 1 ◦ − ◦ 2 6 q [k 1], then ∈ − (cid:0) (cid:1) (β (2m+2),2m+2) β (2m)= β (2m) 1,2m+1 . r r r ◦ ∈ { } π1 = π˜ (q,k) π˜−1 π2 ◦ ◦ ◦ Itfollowsthatifwelet P begeneratedbythetransitionse- quencet 2m 12m−1 applied0′to πˆ0,thenitisparity-preserving, = π˜ ◦h(q,k)◦π(cid:16)˜−1 ◦π2(cid:17)=i(π˜(q),k)◦π2, iπts(2lamst)p=e↑rm2mu−tation1i,s2tm↑2+m−11−,1tπhˆu0s,andforallπ ∈ P0′ wehave and π˜(q) ∈ [hk−1], in contradiiction. 6∈{ } Asforthesizeofthecode,notethat P =2m 1=k 3 0′ − − P0′∩{(βr(2m+2),2m+2)◦βr}2r=m1 = ∅. and (cid:12) (cid:12) (cid:12) (cid:12) 57 k =6, Lemma12 The following sequence P, |P1| = |P2| =...= |P2m−1| =((k−1)! k >6. 2 P= P0′,β1,P1,β2,P2,β3,...,β2m 1,P2m 1,β2m, Counting β ,...,β , the claim is thus substantiated. − − 1 2m is a cyclic Gaux(2m+2,M). To concludethissection, we combineLemma6, Theorem8 ↑ and Theorem13 into the following corollary. Proof:By Lemma11,andsince whenconsideredassets, Corollary14 Forallk>3thereexistsaGaux(k,M˜ )starting P P =∅ k r∩ r′ with Id and a t k transition, where ↑ for all 0 < r < r < 2m, and similarly P is disjoint from ↑ ′ 0′ 8 k =4; P ,P ,...,P , we know that P is a G (2m+2,M). 1 2 2m 1 Asseen abov−e,if foranytwopermutatio↑nsπ ,π P and 57 k =5; 1 2 πq2∈=[2mβr+fo1r]swoemeha0ve<π1r=6(2qm,2man+d 2q)=◦πβ2r,(t2hmen+∈w2.l)..o.Ign. M˜k =1k!78 5k ==6k; 1 (mod 2); 2 6 ≡ particular, π1(2m+2)=2m+2, thus ρ k! 6<k 0 (mod 2), π1 6∈ {βr}2r=m1∪2m−1Pr, where ρk > k−k3. k2 ≡ r[=1 IV. CODE CONSTRUCTION thus π P . But 1 ∈ 0′ In this section we present the main construction of our P0′∩{(βr(2m+2),2m+2)◦βr}2r=m1 = ∅, paper,anddiscussthesizeandasymptoticrateoftheresulting codes. We will show, surprisingly, that our method generates in contradiction. codeswhicharelargerthanformerlyknownfamiliesofcodes, TheauxiliarycodefromLemma12isalmostwhatweneed. eventhoughwerequiretheadditionalstructureofaGraycode. The only property lacking is the fact that Id is not followed in P by the transition t . We fix this in the following 2m+2 theorem. ↑ A. Main code construction We now present a construction of G (n,M,d) codes, for Theorem13 Let k > 6 be even. Then there exists a d6n, which we base on Corollary14 a↑nd Lemma7. Gaux(k,M) starting at Id and a t transition, with Itwillsimplifythepresentationtoassume n= kd forsome k ↑ ↑ positive k > 2, since in that case every congruence class 178 k =6, modulo d of [n] has size k. Nonetheless, the construction is M =((k−3) (k−21)!+2 +1 k >6. tahpepsleiccahbalengtoesa,nfyocnus>indgwonithspneactiuarlaclaasmese,nadfmteernptsr.eWseentdinisgcuthses (cid:16) (cid:17) In particular, for all k >6, simple construction first. k 3 k! M > − . ConstructionA Let n,k,d N, with n =kd and k >2.We k · 2 ∈ recursively construct a sequence of codes, C ,C ,...,C . d d 1 1 Proof: Denote k = 2m + 2 for m > 2, and let An explicit construction is given for C and a rec−ursion step d P = (cj)jM=1 be the code from Lemma12. Since Id ∈ Sk constructs Cm from Cm+1. is not followed with a t transition in P, we denote the last Recursionbase:We constructthecodeC bystartingatthe k d permutation of P0′ by π˜,↑and replace P with permutation σ0 ∈ Sn defined by M j P˜ =π˜−1P= π˜−1◦cj j=1. σ0(j)=d(jmodk)+ k . (cid:24) (cid:25) (cid:16) (cid:17) 6 We obtaina transitionsequence t ,t ,...,t whichgen- Thus, eratesthe G (k,k!) providedbyL↑er1mm↑ra27. The↑crko!deC starts with σ0, and↑uses the transition sequence d t = M∏˜k+1t t km+1↑j r=2 k(m−1)+1↑k(m−1)+ir k(m−1)+1↑j t ,t ,... k(d−1)+1↑k(d−1)+r1 k(d−1)+1↑k(d−1)+r2 (where the product is expanded right-to-left). Therefore, C ...,t . m k(d−1)+1↑k(d−1)+rk! expandseach“push-to-the-km+1st-index”transitionofCm+1 Recursionstep:AssumeCm+1hasalreadybeenconstructed, into M˜k+1 “push-to-the-k(m−1)+1st-index” transitions. starting with permutation σ . Additionally, let It follows that C contains the codewords of C in the 0 m m+1 same order, with M˜ 1 new words inserted between any t ,t ,...,t (1) k+1− ↑k+1 ↑i2 ↑iM˜k+1 two words originally from Cm+1. We say that each codeword ofC (nowappearinginC )istheC -parentofeachof beatransitionsequencegeneratinga Gaux(k+1,M˜k+1)code the Mm˜+1 precedingcodewormdsin C (imn+cl1udingitself), since provided by Corollary14. ↑ k+1 m their vector notations agree on the order of the elements We construct the code C as follows: replace each m t transition of C with t , followed by σ (km+1),σ (km+2),...,σ (n). km+1 j m+1 k(m 1)+1 j 0 0 0 t ↑ , t − , a↑nd so on until tkk((mm−−11))++11↑↑kk((mm−−11))++ii2M˜k+1k.(m−1)+1↑k(m−1)+i3 ✷ τ′Nbeowth,esiurpCpmos+e1t-hpaatreσn,tτs,∈resCpmecstiavteislfyy. Tdo∞c(oσm,τp)le<tedth.eLeptroσo′f, we will show that σ =τ. Lemma15 For all n = kd, k > 2, the code Cd from Case 1: σ′ =τ′. Denote Construction A is a G (n,k!,d). k(d 1)+1 − ↑ x =σ′(km+1) =τ′(km+1) Proof: The parameters of the code are obvious, except perhaps the minimal distance d. The fact that the codewords and s= σ−1(x), a = τ(s). of C are distinct follows from Lemma7. If a = x then for all j = s, k(m 1) < j 6 km+1, we d 6 − Toprovetheminimaldistanced,notethatforall06u< d have σ(j) τ(j) (mod d) and ≡ and ku+1 6 i < j 6 k(u+1) it holds that σ0(i) ≡ σ0(j) σ(j) τ(j) 6d∞(σ,τ)< d, (mod d). Thus, for every distinct σ,τ C , there exists j, | − | d m(d 1) < j 6 kd = n, such that σ(∈j) = τ(j). Since by hence σ(j)=τ(j), and σ = τ. − 6 construction σ(j) τ(j) 0 (mod d), we observe Otherwise, a = x, and denote t =τ−1(x) =s. It similarly ≡ ≡ holds for all j 6 s,t , k(m 1)< j6km+6 1, that σ(j)= d∞(σ,τ)> σ(j) τ(j) >d, τ(j). We there6∈for{e ob}serve τ−= σ (s,t). This implies that, | − | ◦ if we let σˆ,τˆ S be the permutations in the Gaux we implying that Cd is a Gk(d−1)+1↑(n,k!,d). obtained,genera∈tedks+im1ilarlytoσ,τ,respectively(i.e.,b↑ytheir corresponding transition sequences), then Example16 We let d = 3, k = 2, and n = kd = 6. We construct the code C3 starting at τˆ =σˆ (s k(m 1),t k(m 1))= (q,k+1)σˆ ◦ − − − − σ0 =[4,1,5,2,6,3] S6. for some q [k], in contradiction to the fact it was a ∈ Gaux(k+1,M˜∈ ). We use the complete G (2,2) shown in Example 9, which is k+1 gseeqnueerantceedtby ,thte sefqoureCn↑ce. Ht↑e2n,ct↑e2,.inWoeuarrerixvaemaptlea generating as↑sCuamspetio2n: dσ∞′(σ6=′,ττ′)′.>Sidn,ceandσ′n,τot′e∈thatCfmo+r1allwjesahtaivsfeyibnyg 5↑6 5↑6 3 j6k(m 1) or j > km+1, it holds that σ(j) = σ′(j) and C3 =([4,1,5,2,6,3],[4,1,5,2,3,6]), τ(j) = τ−′(j). Hence there exists j, k(m−1) < j 6 km+1, such that which is readily seen to be a G (6,2,3) code. ✷ 5 ↑ σ(j) τ(j) <d but σ′(j) τ′(j) >d. | − | − Theorem17 For all n = kd, k > 2, the code C1 from Note particularly, since for all k((cid:12)m 1) < j 6(cid:12) km it holds Construction A is a G↑(n,M˜k+1d−1·k!,d). that σ′(j) =σ0(j) =τ′(j), that w(cid:12)e h−ave (cid:12) Proof: To prove the claim we will prove by induc- σ′(km+1) τ′(km+1) >d. tion that C from Construction A, for all m [d], is a − m pGrko(vme−d1)in+1L↑(enm,mM˜ak1+51.d−Amss·ukm!,edt)h.eTchlaeimbahseoldcsasfeo∈roCfmC+d1 wanads Denote x =σ(cid:12)(cid:12)(σj′)(kkmm++11), y ==τ′(akmk+(cid:12)(cid:12)1),xand; note that we now prove it for Cm. { }j=k(m−1)+1 { i}i=1∪{ } Recall (1) gives the sequence of transitions for a τ(j) km+1 = a k y , Gaux(k+1,M˜ ). Then { }j=k(m−1)+1 { i}i=1∪{ } k+1 ↑ where a k isacongruenceclassmodulodof[n],ofwhich t↑iM˜k+1t↑iM˜k+1−1···t↑i3t↑i2 =t↑k+1−1. x,y are{nio}ti=m1embers. 7 Let s= σ 1(x) and denote a =τ(s). Since We choose Gaux( +1,M˜ ). x− a = σ(s) τ(s) 6d∞(σ,τ)<d •• We use push↑oper|aRtiomn|s to pos|iRtiomn|+11+∑im=−11|Ri|. | − | | − | We obtain C which is a G (n,M,d), where 1 we have a = y. Let t = σ 1(a). Since a a k is a ↑ ocobnsegrrvueen|cae−6cbla|s>s md,obduutlo d,−for all b ∈ {ai∈}ki={1i\}i{=a1} we FMina=llyM,˜w⌈ne/dd⌉i+sc1unsmsotdhde·sMp˜e⌊cni/ald⌋c+a1sde−o(nfmnod<d)2−d1,·ijnndwkh!.ich a τ(t) = σ(t) τ(t) 6d∞(σ,τ)<d all but (nmod d) congruenceclasses are singletons. We will | − | | − | amend our construction by replacing the recursion base with and therefore τ(t) = y. For all j s,t satisfying k(m 1)< j6km+1 we then have σ(6∈j) { τ(}j) (mod d) C = σ ,t σ ,t 2σ , and −σ(j) τ(j) 6d∞(σ,τ)<d, hence σ(≡j)=τ(j). m 0 2m−1↑2m+1 0 2m−1↑2m+1 0 | − | n o This implies that, if we again let σˆ,τˆ S be the per- where m = nmod d, and continuing the recursion step ∈ k+1 mutationsinthe Gaux generatedsimilarly to σ,τ respectively, as discussed above. Thus, we are effectively only using the then ↑ first member of m+1 together with the previouscongruence classes, fixing σR(j) for j > 2m+1. In this case, we obtain 0 τˆ = σˆ ◦(s−k(m−1),t−k(m−1))= (q,k+1)σˆ C1 which is a G (n,3nmodd,d). where q is given by a = a a k , again contradicting Thus, in w↑hat follows, whenever we mention thepropertiesofaGaux(k+q1,∈M˜{ i})i.=H1enceC hasminimal Construction A, we refer to its most general version k+1 m ℓ∞-distance of at lea↑st d, as required. applying to all n and d. Example18 We complete Example 16 into a G (6,32 2,3) B. Code-size analysis and comparison code by applying the recursion step twice. In eac↑h step,·since We would like to give an explicitexpression for the size of k =2, we utilize the trivial parity-preservingGaux(3,3) code the codes constructed by Construction A. This would enable generated by the sequence t 3,t 3,t 3. ↑ a comparison with previously known results. Firstly, recall that we used↑ ↑ ↑ Lemma19 Let C be the code from (the general version of) σ =[4,1,5,2,6,3] S , 1 0 6 ∈ Construction A. Then its size, C , is given by (2). 1 | | and the sequence t ,t generates 5 6 5 6 ↑ ↑ Proof:Let usfirst assume n>2d. We note the asymme- C3 =([4,1,5,2,6,3],[4,1,5,2,3,6]). try in Construction A between congruence classes i of odd R and even sizes. Indeed, a class of size = k > 2 (for all We build C2 by exchanging each t5 6 transition by t3 6 |Ri| followed by 2 instances of t2+1 2+3 = t↑3 5; the middle lev↑el classesotherthanRd,whichisusedintherecursionbaseand of Figure 1 shows the resulting↑code. ↑ whosecontributionisbasedonthe G (k,k!)code)contributes to the code size, according to Coro↑llary14, a multiplicative Secondly,as seen in the same figure, each t transition of 3 j C , j 5,6 , can be replaced by t = t ,↑followed by 2 factor of in2stan∈ces{of t}0+1 0+3 =t 3, to gener1a↑tje C1.↑j 8 k =3; GN(o6te,6t,h3a)taCn3d⊆G↑ C(62,1⊆8,↑C3)1,coanddes,thraetspthecetyivaerley.G5↑(6,2,3✷), 57 k =4; 3W↑ e now describe↑ the changes needed in Construction A to M˜k+1 = 1(k7+81)! 4k ==5k; 0 (mod 2); 2 6 ≡ allow general n and d parameters. We first consider n not ρ (k+1)! 5< k 1 (mod 2), nie∈ce[sds]a,rlielyt being a multiple of d, but still n > 2d. For all where, again, ρk+1 >k+1kk+−122. ≡ It is therefore important to note that when n 0 Ri ={i,i+d,i+2d,...,n−((n−i)mod d)}, (mod 2),[n] has(nmod d)congruenceclassesmoddulo≡d of (cid:4) (cid:5) be the ith congruence class modulo d of [n]. Then odd size n , and d (nmodd) classes of even size n . Thus, if addditionally −n > 4, the constructed code C isdof n 16i6(nmodd), (cid:6) (cid:7) d 1 (cid:4) (cid:5) = d size |Ri| ((cid:6)nd(cid:7) (nmod d)<i 6d. (cid:4) (cid:5)( n/d +1)! nmodd n C = ρ ⌈ ⌉ ! We define the starting(cid:4)pe(cid:5)rmutation | 1| ⌈n/d⌉+1 2 · d (cid:18) (cid:19) j k σ0 =[ 1 2 ... d] Sn, ( n/d +1)! d−(nmodd)−1 R |R | |R ∈ ⌊ ⌋ , · 2 to be comprised of a concatenation of the congruence (cid:18) (cid:19) classes, where the order of elements within the congruence and simple rearranging gives us the first case of (2). Similar class is arbitrary. Additionally, the recursion base uses a considerations give us the next five cases of (2). G ( , !).AsfortherecursionstepofconstructingC Finally, we consider the case of n < 2d, which implies d d m fro↑m|RC | |R, w|e can still apply it with the following changes: n =1. In this special case we only permute (nmodd) = m+1 d (cid:4) (cid:5) 8 4 4 1 1 5 t5 6 5 t5 6 C ↑ ↑ 3 2 2 6 3 3 4 4 6 4 4 1 1 1 1 t3 6 3 t3 5 2 t3 5 t3 6 6 t3 5 2 t3 5 C ↑ ↑ ↑ ↑ ↑ ↑ 2 5 3 5 6 2 5 2 5 3 1 6 2 1 6 5 1 6 1 3 2 1 3 5 1 4 3 4 2 4 5 4 6 4 2 4 5 t 6 1 t 3 4t 3 t 5 1 t 3 4t 3 t 5 1 t 3 4t 3 t 6 1 t 3 4t 3 t 5 1 t 3 4t 3 t 5 1 t 3 4t 3 C ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ 1 5 5 3 3 2 2 5 5 6 6 2 2 2 2 5 5 3 3 2 2 5 5 6 6 6 6 6 6 6 6 3 3 3 3 3 3 Figure1. Construction Aasdemonstrated inthecase d=3,k=2. n +1 nmodd n +1 !d ρ⌈n/d⌉+1nmodd 4< n 0 (mod 2), d nmodd d · 2d−1(⌊n/d⌋+1) d ≡ |C1| =(cid:0)(cid:16)(cid:0)(cid:6)8315n(cid:1)7d78n(cid:7)(cid:17)m+ond1m(cid:1)don·dm3dd·o−d571dd·(cid:0)−2(cid:4)1nd·(cid:5)24+1(cid:1)!d· ρ⌊n/2dd⌋−+11((⌊d−n/1)d−⌋(+nm1)odd) 5(cid:4)(cid:4)nndd<(cid:5)(cid:5)(cid:4)==nd42(cid:5),,≡1 (mod 2), (2) (cid:0)(cid:6)126(cid:7)0 (cid:1) (17(cid:0)(cid:4)8)d(cid:5) 120(cid:1) n (cid:4)=5(cid:5), 3(cid:0)(cid:16)n5878m(cid:1)9ond(cid:17)mdodd·8d· · 34 · 178 (cid:4)(cid:4)(cid:4)nnddd(cid:5)(cid:5)(cid:5)==31,. (n d) congruence classes of [n], (and each such class has LMRM-code construction to date, [32, Cst. 1, Thm. 2] and 2=− n +1elements).Asmentioned,wethereforeconstruct [24, Sec. III-A], presented (n,M,d)-LMRMcodeswith sizes d a code of size C =3nmodd. (cid:4) (cid:5) | 1| n nmodd n d (nmodd) We commentthatitis also possibleto achievea slightgain M = ! ! − , in code size by reordering σ so that the last block consists d d 0 l m j k of a congruenceclass of oddsize, ratherthan even,where the whichourconstructionimprovesupon,morepronouncedlythe addedcomplexityofindexcalculationis inconsequential.The more[n]haseven-sizedcongruenceclassesmodulod(cf.(2)). asymptotic gain in code rate vanishes. In the asymptotic regime, we go on to examine the case of We now turn to comparing the size of the resulting code d= Θ(n). For an (n,M,d)-LMRMcode (and in particulara with that of previously constructed codes, as well as known G (n,M,d)),wefollowtheconvention(e.g.,[32])ofdefining bounds on the cardinality of such codes. th↑e rate of the code The first comparison we make is with codes that have the 1 Gray property. Such codes were only studied for d = 2, i.e., R = log M, n 2 snake-in-the-boxcodes or G (n,M,2) codes in our notation. These codes were studied i↑n [36, Thm. 24], where it was and its normalized distance shown that such codes can be constructed with sizes d n n n δ= . M = ! + 1 ! . n 2 2 2 − l m (cid:16)j k (cid:16)j k (cid:17) (cid:17) The following were proven in [32]. Construction A improves this size by a factor of 1 n +1 n , times ρ when n 2 (mod 4) (2in th2e case of2 n 1 (m⌊ond/2⌋4+)1ρ is≡eliminated by Lemma20 [32, Thm. 23] For any (n,M,d)-LMRM code it ch(cid:0)a(cid:6)ngi(cid:7)ng th(cid:1)e(cid:4)or(cid:5)der≡of congruence⌊cnl/a2s⌋s+es1 in σ ). We note holds that 0 that a similar improvement was made concurrently by [35] 1 1 R6 2 2δ δ δ log (δ) in a preprint devoted solely to the case of d = 2, i.e., − δ − δ − 2 snake-in-the-box codes. (cid:22) (cid:23) (cid:18) (cid:22) (cid:23) (cid:19) 1 1 We now also compare our results to error-correcting codes 1+δ δ log 1+δ δ +o(1). − − δ 2 − δ with the ℓ∞-metric which are not necessarily Gray codes (cid:18) (cid:22) (cid:23)(cid:19) (cid:18) (cid:22) (cid:23)(cid:19) (LMRM-codes). We observe that the best known general 9 Lemma21 [32,Thm.27]Forany0< δ61theconstruction auxiliary Gaux(k+1,M˜ ) code. Extensions to the general k+1 of [32, Cst. 1, Thm. 2] and [24, Sec. III-A] yields codes with version of C↑onstruction A are easily obtainable. We first require a function ValidAux capable of detecting 1 1 R= 1 δ log ! whetheragivenpermutationσ S belongstotheauxiliary (cid:18) − (cid:22)δ(cid:23)(cid:19) 2(cid:18)(cid:24)δ(cid:25) (cid:19) Gaux(k+1,M˜ ) code. ∈ k+1 k+1 1 1 ↑ + δ+δ 1 log ! . (cid:18) (cid:22)δ(cid:23)− (cid:19) 2(cid:18)(cid:22)δ(cid:23) (cid:19) Lemma24 For an auxiliary Gaux(k+1,M˜k+1) code pro- It was also shown in [32] that a Gilbert-Varshamov-like vided by Lemma6, Theorem8↑or Theorem13, a function non-constructive bound exists: ValidAux can be implemented to operate in O(k) steps. Lemma22 [32, Thm. 25] For any 0 < δ 6 1 there Proof: If we use Lemma6, then the auxiliary code consists of all even permutations, and it is well known that exist (n,M,d)-LMRM codes satisfying d > δ with rate n we can determine the signature of a permutation σ S in R> fGV(δ)+o(1), where O(k) operations, e.g., by finding a cycle decomposi∈tionk+o1f σ. log 1 +2δ(log e 1) 1 0<δ6 1 IfweinsteaduseTheorem8,thentheauxiliarycodeconsists f = 2 δ 2 − − 2 GV (−2δlog2 1δ +2(1−δ)log2e 21 6δ61 ofoflleoxwasctkly+t1ho(sceycpliecramllyu)ta,tii.oen.,s in whose vector notation 1 We therefore aim to show that our construction can bridge some of the gap between the given bounds and known con- σ (σ−1(k+1)mod (k+1))+1 =1, structions. (cid:16) (cid:17) which again requires O(k) steps to verify. Finally, for Theorem13 we divide into cases according to Lemma23 Let C be the code from (the general version of) 1 σ(k).Forallelementsotherthan1,k 1,k theproblemagain Construction A. Then and estimate from below of its rate R − reducestodeterminingsignσ.Forthoseelements,onlycyclic as a function of its normalized distance δ is given by (3). shift(ona subsetof indices,by case) ofa knownpermutation Proof: The proof follows by a simple substitution of are valid, which we can easily verify in linear time. (nmodd) = n d n and d = nδ into (2). We also recall Animportantnotionofawindowwillbeuseful.Letσ Sn that ρk > k−k3. − (cid:4)d(cid:5) bweinadopwermasutthateiosne,tnof=indkidc.esFor all j ∈ [d] we define th∈e jth Inconclusion,theseasymptoticratesandboundsareshown in Figure 2. We note in particular that the rate of codes W = k(j 1)+2,k(j 1)+3,...,kj+1 [n]. j producedbyConstruction Aisstrictlyhigherthanthatofpre- { − − }∩ viously known constructions (as in Lemma21). Furthermore, The windows partition [n] 1 , and are all of size k except \{ } it produces codes with rates higher than those guaranteed by Wd which is of size k−1. the Gilbert-Varshamov-like Lemma22 for all δ greater than Given a set I [n], we conveniently denote ⊆ 0.1 except in a small neighborhood of 1, whereas known ≈ 5 σ(I)= σ(i) i I . constructionsonlybypassedtheseratesonlyforδgreaterthan { | ∈ } 0.349. We prove a simple lemma concerning properties of windows ≈ of codewords from Construction A. V. DECODING ALGORITHM Lemma25 Let σ be a codeword of C from Construction A, This section is devoted to devising a decoding algorithm 1 with n =kd. Then for all j [d], capableofcorrectinganoisyreceivedversionofatransmitted ∈ codeword. k 16 σ(W) 6k, j j Knownconstructionsof (n,M,d)-LMRMcodes,presented − ∩R in[32,Cst.1,Thm.2]and[24,Sec.III-A],lendthemselvesto i.e., at most one element(cid:12)(cid:12)of σ(Wj) do(cid:12)(cid:12)es not leave a residue straightforwarddecodingalgorithms,efficiently donein O(n) of j modulo d. In particular, σ(Wd) ⊆Rd. operations,since for anygivencodewordσ andindexi [n], Additionally, if σ(Wj) j = k 1, j [d 1], then r = [σ(i)modd] isknown.Hence,ifa retrievedpermu∈tation x ∈σ(Wj)\Rj sa(cid:12)tisfies x∩∈RR(cid:12)j′ for s−ome j′∈> j.− bτestahtiesfiuensiqdu∞e(eσl,eτm)en6t k⌊(d−r1+)/d2Z⌋,stahtiesnfyσin(gi) kis knτo(wi)n 6to Proof: Take a(cid:12)ny 1 < j ∈(cid:12) [d], and let σj be the Cj- (d 1)/2 . ∈ | − | parent of σ. Then, in C1, no transition between σ and σj is ⌊ O−urpropo⌋sedconstructiondivergesfromthatrigidpartition. induced by Cj, and hence σj is derived from σ by a (perhaps empty)sequence of t transitions, for i W W . However, we can still efficiently decode noisy information, Therefore, for all i ↑iW′ W w′e∈have1∪σ·(·i)·∪= σj(−i1), provided errors of magnitude no more than t have occurred, ∈ j∪···∪ d j andthesamealsoholdsforj =1(sinceσ = σ).Inparticular, where 2t+1 6 d. More precisely, we assume that for every 1 σ(W)= σ(W). storedpermutationσ andretrievedpermutationτ itholdsthat j j j Now, since C only applies “push-to-the-k(j 1)+1st- d∞(σ,τ)6t6⌊(d−1)/2⌋. index” transitionsj, and − To simplify our presentation we assume n = kd, since then our construction only makes (repeated) use of a single σ k(j 1)+1 W W = , 0 j d j d { − }∪ ∪···∪ R ∪···∪R (cid:0) (cid:1) 10 1 δ 1 log 1 +1 +δlog 1 +1 ! − δ 2 δ 2 δ (cid:16) +j1k(cid:17)δ 1 (cid:16)llomg ⌈(cid:17)n/d⌉−2 (cid:16)δ(cid:16)j k (cid:17) (cid:17) 4< 1/δ 0 (mod 2), R>(((cid:16)111−−−+42δδδ(cid:16)j))δ1δ((l3k+−o(cid:17)−gδl2ol(jog11δg27k28(cid:16)(cid:17)()l3)1δ)1+)m+2(+l5o(cid:16)δδg1⌈l(cid:17)−no/g+d12⌊⌉)+nδ(l/13oldo(cid:17))g⌋g−2−22((cid:16)57(cid:16))j1δδk+1(cid:17)!(cid:17) 5⌊⌊11<//δδ⌊⌋⌋1==/δ42⌋,,≡1 (mod 2), (3) δ − 2 n/d +1 − ⌊ ⌋ ≡ (((111−−−53δ)δδ(cid:16)))lol(oglog2g(232(j)3(517k5))−+4((cid:17)6)δ+−11(cid:16))⌊log2⌋(89(cid:17))+2−9δ ⌊⌊⌊111///δδδ⌋⌋⌋ ===531,,. 4 3.5 3 2.5 R 2 (d) 1.5 1 (c) 0.5 (b) (a) 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 δ Figure2. (a)TheGilbert-Varshamov-like lower bound ofLemma22.(b)Therate ofcodes fromLemma21constructed in[32].(c)Alower boundforthe rateofcodes C1 fromConstruction A.(d)TheupperboundofLemma20. if for any i W we have σ(i) = σ(i) , then by Corollary26 Let σ be a codeword of C from j j j 1 necessity σ(i)∈ for some j > j. In parti6c∈ulaRr, σ(W ) Construction A, with n = kd. Then for each j [d], . ∈ Rj′ ′ d ⊆ there is a unique element xσ satisfyi∈ng Rd j ∈Rj∪···∪Rd Forallj [d 1],wealsoconsiderσ ,theC -parentof j+1 j+1 ∈ − both σ and σ. Since C only applies “push-to-the-kj+1st- index” transitjions, j+1 σ(Wj∪···∪Wd) =Rj∪···∪Rd\ xσj . n o σ ( k(j 1)+1 W) kj+1 j+1 { − }∪ j \{ } Proof: The proposition follows from Lemma25 for j = (cid:0)=σ0 ({k(j−1)+1}∪Wj)\{kj(cid:1)+1} =Rj. d since |σ(Wd)| = |Wd| = k−1 6 |Rd∩σ(Wd)|. Now suppose the proposition holds for j+1, and we prove that it Finally, sinc(cid:0)e σj+1 is derived from σj by a s(cid:1)equence of holds for j. t transitions for i W, it follows that k(j−1)+1↑i′ ′ ∈ j We again observe by Lemma25 that |Rj ∩ σ(Wj)| ∈ k 1,k . If σ(W) = k, since σ(W) = W = k, σj+1 {k(j−1)+1}∪Wj =σj {k(j−1)+1}∪Wj t{he−n =} σ(W|R)j∩and xσj=| xσ satisfi|es thej c|laim|. j| Rj j j j+1 thus (cid:0) (cid:1) (cid:0) (cid:1) Otherwise σ(W) = y for some y [n]; it would j j \R { } ∈ suffice to show y = xσ , since then σ(W) = xσ σj(Wj) ⊆ σj+1 {k(j−1)+1}∪Wj would satisfy the claim.j+1 Rj \ j { j} = Rj∪(cid:0) σj+1(kj+1) . (cid:1) Consider then σj, the Cj-parent of σ. Note that σj(Wj) = σ(W), and since C employs “push-to-the-(k(j 1)+1)st- Noting that σ(W) = (cid:8)=k and reca(cid:9)lling that σ(W) = j j − j j j j index” transitions only, and R σ(W), we are done. j j (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) (cid:12) σ (W W ) , 0 j d j d ∪···∪ ⊆R ∪···∪R