國
立
交
通
大
學
資訊科學與工程研究所
碩
士
論
文
排 列 碼 與 其 高 效 率 之 編 解 碼 演 算 法
Efficient Encoding and Decoding
with Permutation Arrays
研 究 生:林德璁
指導教授:蔡錫鈞 教授
Efficient Encoding and Decoding with Permutation Arrays
研 究 生:林德璁 Student:Te-Tsung Lin
指導教授:蔡錫鈞 Advisor:Shi-Chun Tsai
國 立 交 通 大 學
資 訊 科 學 與 工 程 研 究 所
碩 士 論 文
A ThesisSubmitted to Institute of Computer Science and Engineering College of Computer Science
National Chiao Tung University in partial Fulfillment of the Requirements
for the Degree of Master
in
Computer Science
July 2007
Hsinchu, Taiwan, Republic of China
Efficient Encoding and Decoding with
Permutation Arrays
An (n, d) permutation array(PA) is a subset of Sn with the property that
the distance (under any distance metric, such as hamming) between any two permutations in the array is at least d, which becomes popular recently for communication over power line. We use both hamming distance and l∞ -norm to measure the distance between permutations, and give constructions of permutations arrays under those two metrics. For the hamming distance, we give the first explicit construction of 3-DPMH. For the l∞-norm, we give
the first explicit construction of DPM∞ and a direct construction of (n, d) permutation array with l∞-norm without using other binary code. Further-more, all have efficient encoding and decoding algorithms.
Acknowledgements
I am grateful to my advisor, Dr. Shi-Chun Tsai, for his guidance. I thank Hsin-Lung Wu who gives some important ideas for this thesis.
1 Introduction 7
1.1 Background and Preliminary . . . 7
1.2 Main Result and Construction Idea . . . 9
1.3 Notations . . . 11
2 Metrics and Lower Bound of Permutation Arrays 12 2.1 Metrics on Sn . . . 12
2.2 Lower Bound of PAs . . . 16
3 DPMs from Zn 3 to Sn with Hamming Distance 18 3.1 Construction of 3-DPMH . . . 18
3.1.1 3-DPMH of length 8n for n≥ 2 . . . 18
3.1.2 3-DPMH for input length ≥ 16 . . . 31
3.2 Construction of PAs with Hamming Distance . . . 34
3.3 Previous Result and Comparison . . . 43
4 Permutation Arrays with l∞-Norm 45 4.1 DPMs from Z2n−1 to Sn with l∞-norm . . . 45
4.2 Encoding and Decoding with PAs by DPM∞ . . . 48
4.3 Encoding and Decoding Directly with PAs under l∞-norm . . 52
CONTENTS 4
5 Conclusion and Open Problem 57
2.1 A6×6 such that per(A) = V∞(6, 1) . . . 15
3.1 3-DPMH Algorithm A8n . . . 19
3.2 Transition patterns of PASS 1. . . 20
3.3 Transition patterns of PASS 2. i∈ {0, 1, 2, 3} . . . 21
3.4 Possible final positions of π8k+i1 , i∈ {0, 1, 2, 3}. . . 26
3.5 3-DPMH Algorithm A8n+k for k ∈ [7] . . . 32
3.6 Construction of permutation array with 3-DPMH . . . 35
3.7 The unique path of symbol 12, given π5 = 12. . . 36
3.8 Weighted majority vote . . . 41
4.1 Algorithm Bn computes DPM∞ from Z2n−1 to Sn . . . 46
4.2 Algorithm C computes an (n1 + 1, n2 + 1, k)-DIM∞ with an (n1, n2, k)-DIM∞ . . . 47
4.3 Encoding and decoding with DPM∞ . . . 50
4.4 Algorithm Dn . . . 51
4.5 Direct encoding and decoding scheme with PAs . . . 53
4.6 Algorithm Gn encodes from Z2n−d to Sn . . . 53
4.7 Algorithm G−1n is the decoding algorithm for Gn. . . 55
A.1 Algorithm A−18n+k without table lookup for n≥ 2, k ∈ [0, 7] . . 60 5
List of Tables
2.1 Lower bounds of P (16, d) with different metrics . . . 17
3.1 Possible values of πj1 after PASS 1 for k ∈ {0, 1, · · · , 4n − 1}. 23 3.2 Possible values of πj after PASS 2 for k ∈ {0, 1, · · · , n − 1} and i∈ {1, 2, 3, 4}. . . 24
3.3 Possible final positions of π8k+i1 and π8k+4+i1 . . . 27
3.4 Necessary Conditions for Position Covering . . . 30
3.5 Path Table of πi , i = 8k + 8 + j, j ∈ {1, 2, 3, 4} . . . 37
3.6 Path Table of πi , i = 8k + 4 + j, j ∈ {1, 2, 3, 4} . . . 38
3.7 Comparison between A3(16, d) and A(16, d−2) where L[A3(16, d)] stands for the lower bound of A3(16, d) as in [2] and U [A(16, d− 2)] the upper bound of A(16, d− 2) as in [1]. . . 44
4.1 f is a (4, 4,−1)-DIM∞. . . 49
4.2 Comparison of the three constructions . . . 56
Introduction
1.1
Background and Preliminary
Let Sn denote the set of all permutations of length n. We consider a coding
scheme C : {0, 1}k → S
nwith the property that if we are given a permutation y ∈ Sn that is close to a valid encoding C(x), then it is possible to recover
the message x from the corrupted encoding y. To do this, first we need to choose a proper metric for the distance between two permutations. A natural choice is hamming distance, but it is not clear how to decode corrupted permutations efficiently under this metric. Secondly, we need to decide which permutations can be used as code words, such that for any two different messages x and x, such that C(x) and C(x) are “far” enough. In this thesis, we give efficient encoding and decoding algorithms for such scheme by measuring the permutation distance with the hamming distance and the
l∞-norm.
An (n, d) permutation array(PA) is a subset of Sn with the property
that the distance (under any distance metric, such as hamming, etc.) be-tween any two permutations in the array is at least d. PAs were studied
CHAPTER 1.
Introduction
8 for some time [6]. It is Vinck [25], who proposed permutation arrays as an error correcting code over power-line communications, where each symboli∈ {1, .., n} is associated with a frequency fi and a message is encoded as a
permutation, which is then transmitted in time as the series of corresponding frequencies. For example, to transmit the message encoded as (3, 4, 1, 2), the sequence of frequencies (f3, f4, f1, f2) is transmitted one by one. Since then many researches have been done on coding/modulation schemes with PAs [12],[21],[23],[24]. Ferreira and Vinck [12] made use of distance preserving mappings (DPMs) from binary sequences to permutation sequences to con-struct permutation trellis codes. A systematic study of DPMs was initiated in [6]. Later, Lee [16],[18], Swart et al. [20] proposed several constructions of DPMs, and Chang [4],[5] studied the distance increasing mappings (DIMs). All the above mentioned works use the hamming distance as a metric for per-mutations. Most of the efforts have been on finding mappings from binary vectors to permutations that preserve the minimum distance of the binary vectors. A typical scheme is starting by encoding a message with a binary code, which is mapped to a permutation and transmitted. Upon receiving a permutation, one can recover the corresponding binary vector and then with the binary code one can do some error correcting to recover the mes-sage. However, there is no discussion on the efficiency of error correcting directly from the permutations. In our research, we construct distance pre-serving mappings from ternary vectors to permutations and we give efficient encoding/decoding scheme for the PAs we constructed.
A permutation can be seen as a ranking, and vice versa. To study the correlations between ranks, several metrics on permutations were introduced, such as the hamming distance, the minimum number of transpositions tak-ing one permutation to another, etc. [14], [9], [7], [8]. And some consider
permutation arrays with different metrics. Stoll and Kurz [22] investigated a detection scheme of permutation arrays using Spearman’s rank correlation. Chadwick and Kurz [3] studied the permutation arrays based on Kendall’s tau.
We consider a noisy channel which can transmit permutations as code words. The noise in the channel is an independent Gaussian distribution with zero mean for each position. The received sequence is the original permutation together with the Gaussian noise, and its ranking can be seen as a permutation, which can be different from the original one. Under the model of additive white gaussian noise (AWGN) [11], there is only a small probability for any frequency to deviate significantly from the original one. This inspires us to consider not only the hamming distance but also the
l∞-norm.
1.2
Main Result and Construction Idea
In this thesis, we have two main results.
First, we give the first explicit construction of distance preserving map-pings from ternary vectors of dimension n to Sn with hamming distance
(3-DPMH) for n ≥ 16. Thus we can construct (n, d) permutation array
under hamming distance with size ≥ A3(n, d). Moreover, we have efficient encoding/decoding scheme for the PAs we constructed by the 3-DPMH.
Second, we give explicit constructions of distance preserving mappings with l∞-norm (DPM∞), which can be used to recover corrupted permuta-tions. And we give an (n, d) permutation array under l∞-norm without us-ing binary codes. It’s the first direct construction of PAs to the best of our knowledge. With both constructions, a lower bound on the size of
permu-CHAPTER 1.
Introduction
10 tation arrays is given, i.e. P∞(n, d) ≥ A(n − 1, d), and P∞(n, d) ≥ 2n−d.Moreover, for both constructions, we have efficient encoding/decoding algo-rithms.
For the first result, Our 3-DPMH construction is inspired by [18]. It is
based on a crucial ”local” property which we discuss as follows. Intuitively, an algorithm has the local property if each element of the permutation is not far away from its initial position after running the algorithm. From a 2-DPMH with local property, we can obtain a 3-DPMH. First we run a
2-DPMH algorithm such that every element in the permutation is not far from
the initial position, i.e. with a small position difference. Then we only swap two positions far enough, i.e. with the position difference larger than the difference resulting from the 2-DPMH. This will give us a 3-DPMH if we
have a 2-DPMH with local property. We constructed a two-pass 3-DPMH
by using a 2-DPMH, which is very similar to the one constructed in [17, 18].
However, in these papers, the local property is not fully exploited. Following the same paradigm, one can obtain q-DPMH for all q > 3.
For the second result, both construction ideas are crucial on a greedy strategy. For a binary vector, first we use the largest number n to represent 1 and the smallest number to represent 0 for the first bit. For the second bit, we use the available largest number to represent 1 and the available smallest number to represent 0, i.e. if the first and second bit is one, then we use the largest value n to represent the first bit and second largest value n− 1 to represent the second bit. The other bits can be determined one by one. Thus each value of permutation only depends on the prefix of the vector, and then it gives the largest distance with a greedy strategy and it can be decoded in linear time.
1.3
Notations
Let [n] ={1, · · · , n}, [m · · · n] = {m, m+1, · · · , n}, for m < n. For a function
f , let f (S) denote the union of f (s) for all s∈ S. Let δ : Zq×Zq → {0, 1} be
the function defined by δ(a, b) = 1 if a = b and 0 otherwise. Let Sn denote
the set of all permutations of [n] and Zn
q denote the set of all q-ary vectors
of length n. For any π ∈ Sn and i∈ [n], π−1(i) denotes the position of i in π, i.e. if π(j) = i then π−1(i) = j. Let idn denote the identity permutation
in Sn, i.e. idn = (1, 2,· · · , n). For any x ∈ Z2n, we use x[i..j] to denote the
subvector (xi,· · · , xj) for any i < j. For any π ∈ Sn, we use π[i..j] to denote
the partial permutation (πi,· · · , πj) for any i < j. The Hamming distance dH(a, b) between two n-tuples a = (a1, a2,· · · , an) and b = (b1, b2,· · · , bn) is
the number of positions where they differ, i.e. dH(a, b) =|{j : aj = bj}|. The l∞-norm distance of two permutations is d∞(π, σ) = max
j |πj− σj|.
Define Vf(n, d) = |{π ∈ Sn : df(id, π) ≤ d}| to be the size of a sphere
with center id∈ Snand radius d, where f is any metric function of Sn. If f is
right-invariant, i.e., df(π1, π2) = df(π1σ, π2σ) for all σ then for any center π
and fixed radius d, the size of a sphere is the same, i.e. |{π ∈ Sn: df(σ, π)≤ d}| = {π ∈ Sn : df(id, πσ−1) ≤ d}| = Vf(n, d). Let (n, d) q-ary code be a
code over Zn
q with minimum distance d. Let (n, d)-PA with metric f be a
permutation array over Sn with minimum distance d based on metric f . Let Aq(n, d) denote the maximum size among all (n, d) q-ary code and Pf(n, d)
denote the maximum size among all (n, d)-PA with metric f . A mapping
F : Zn1
q → Sn2 is a q-ary distance-preserving mappings under metric f
(q-DPMf), if for any x, y ∈ Z2n1, df(F (x), F (y))≥ dH(x, y). We usually omit q
Chapter 2
Metrics and Lower Bound of
Permutation Arrays
In this chapter, we introduce several metrics, and derive the Gilbert like lower bounds for permutation arrays under these metrics. To get the lower bounds, we will need to estimate the size of a sphere for every metric.
2.1
Metrics on S
nGiven Sn and a metric function d : Sn × Sn → R+ satisfied d(π, π) = 0, d(π, σ) = d(σ, π) and d(π, σ)≤ d(π, η) + d(η, σ) then (Sn, d) formed a metric
space. The metric function d is designed to measure the distance between any two permutations in Sn. We call the metric function just metric.
Many metrics can be defined and discussed. We need two additional restrictions. First is right invariant. In general, permutations are presented as one to one mappings between two sets with the same cardinality. π :
A → B, |A| = |B| = n. If the distance will not change when changing the
labeling of A, then it’s right invariant, i.e. d(π1, π2) = d(π1σ, π2σ) for all
σ. On the other hand, if the distance will not change when changing the
labeling of B, it’s left invariant, d(π1, π2) = d(σπ1, σπ2). By the definition, given a right invariant metric d, it’s easy to construct another inverse metric
d(π1, π2) = d(π−11 , π2−1) which is left invariant. It’s because d(π1, π2) =
d(π1−1, π−12 ) = d(π1−1σ, π2−1σ) = d((σ−1π1)−1, (σ−1π2)−1) = d(σ−1π1, σ−1π2). So we only need to consider right invariant.
Next we introduce several different kinds of metrics. These metrics have been used to measure the distance of permutations in various areas.
Define Vf(n, d) = |{π ∈ Sn : df(id, π) ≤ d}|, the size of a sphere with
center id ∈ Sn with radius d with respect to metric f . Note that all metrics
we discuss here are right-invariant, so spheres with the same radius have the same sizes, i.e., given any σ ∈ Sn, |{π ∈ Sn : df(σ, π) ≤ d}| = {π ∈ Sn : df(id, πσ−1)≤ d}| = Vf(n, d).
The Hamming distance is a well-known and very popular metric. Orig-inally it’s a natural design for string. It counts the number of positions for which the corresponding symbols are different. Hamming distance is widely used for binary vectors and q-ary vectors in coding theory category. The Hamming distance between two permutations is dH(π, σ) = |{j : πj = σj}|.
One may verify that it’s a bi-invariant metric easily. Next let’s consider
VdH(n, d). Because |{π|dH(id, π) = d}| =
n
d
(!d), where the subfactorial !d is the number of distinct derangement on d elements, it implies VdH(n, d) =
d i=0 n i
(!i). It’s well known the subfactorials satisfy the recurrence relations !(n + 1) = n· [!n+!(n − 1)] and !n is equivalent to ning(ne!), where ning is the nearest integer function, ning(r) = minargj{z ∈ Z : |j − r|}(half-integers
are rounded to even numbers to avoid ambiguous). Thus VdH(n, d)≤ 2e n!
(n−d)!
CHAPTER 2.
Metrics and Lower Bound of PAs
14 There is another famous norm called l1-norm, and it’s defined as l1(π, σ) =n
j=1
|πj− σj|. It’s not clear whether an explicit formula of Vl1(n, d) exist, but
the upper bound can be derived. By [10], Vl1(n, d) ≤ (2e(d+n)n )n. Note that l1-norm is one of a metric family called lp-norm family. In general, lp-norm
is defined as lp(π, σ) = [ n j=1 (|πj − σj|)p] 1 p.
The l∞-norm of two permutations is d∞(π, σ) = max
j |πj − σj|. It’s a
special case of lp-norm when p is infinitely large. We give two ways to derive
upper bounds for V∞(n, d). Note that there is a connection between V∞(n, d) and permanent. Recall the definition of permanent for a matrix A, perA ≡
π∈Sn
a1π1· · · anπn =|{π ∈ Sn : aiπi = 1 for all i}|. Define A(n,d) to be an n×n
matrix, a(n,d)ij = 1 if |j − i| ≤ d 0 otherwise
And by the theorem 11.5 in [19], for an n× n (0, 1)-matrix A with ri ones in
row i, then per(A) ≤
n
i=1
(ri)!
1
ri. We can derive the upper bound of V∞(n, d)
as follows.
V∞(n, d) = |{π ∈ Sn: d∞(id, π)≤ d}|
= |{π ∈ Sn:|πi− i| ≤ d for all i}|
= |{π ∈ Sn: a(n,d)iπi = 1 for all i}|
= per(A(n,d))
≤ [(2d + 1)!] n
2d+1
The second way to estimate V∞(n, d) is by a recurrence relation. Define
Aij to be the matrix obtained from A by deleting row i and column i. It’s well
known per(A) =
n
i=1
aij · per(Aij). By observing A(n,d), one can find A(n,d)11 = A(n−1,d) and each entry in A(n,d)1k is upper bounded by the corresponding entry
A = 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1 1 0 0 0 0 1 1
Figure 2.1: A6×6 such that per(A) = V∞(6, 1)
of A(n−1,d) for 2≤ k ≤ 1 + d. Thus V∞(n, d) = per(A(n,d)) = 1+d k=1 per(A(n,d)1k ) ≤ (1 + d)per(A(n−1,d)) ≤ (1 + d)2per(A(n−2,d)) · · · ≤ (1 + d)n−d−1per(A(d+1,d)) = (1 + d)n−d−1V∞(d + 1, d) = (1 + d)n−d−1(d + 1)!
The second bound is better when d is large.
For other metrics, define I(π, σ) as the minimum number of pairwise adjacent transpositions taking π−1 to σ−1. It has an equivalent definition
I(π, σ) ≡ |{(i, j) : πi < πj, σi > σj}|. Let π be a permutation ∈ Sn. If i < j and πi > πj, the pair (i, j) is called an inversion of π. Note that I(π, σ) equals the number of inversions of πσ−1. Let In(k) denotes the
num-CHAPTER 2.
Metrics and Lower Bound of PAs
16 ber of permutations ∈ Sn with exactly k inversions. By [15], In(k) havea recurrence relation In(k) = In−1(k) + In−1(k − 1) + In−1(k − 2) + .. + In−1(k − n + 1) and then VI(n, d) = |{π ∈ Sn : I(π, id) ≤ d}| = |{π ∈ Sn : the number of inversions of π ≤ d}| =
d
k=0
In(k). Thus VI(n, d) can be
computed by dynamic programming in quadratic time.
Define T (π, σ) as the minimum number of transpositions required to bring
π to σ. This is a bi-invariant metric on Sn. It’s known T (π, σ) = n−
number of cycles in πσ−1 [9]. Let c(n, k) denote the number of permutations
π ∈ Sn with exactly k cycles. This number is called a signless Stirling
number of the first kind. c(n, k) satisfies the recurrence relation c(n, k) = (n− 1)c(n − 1, k) + c(n − 1, k − 1) by [19]. Thus VT(n, d) =
d
i=0
c(n, n− i),
which can be computed by dynamic programming in quadratic time.
2.2
Lower Bound of PAs
Gilbert bound [13] is a lower bound on A(n, d). Similar idea can be applied to permutation arrays.
Theorem 1. Pf(n, d) ≥ V n!
f(n,d−1), where f is any metric function of Sn.
Proof. We give a greedy algorithm for producing a permutation array
achiev-ing the claimed bound.
(a) Start with any permutation in Sn.
(b) Choose a permutation whose distance is at least d to all previous chosen
permutations.
Let P be the permutation array produced by the above greedy algorithm. Once the algorithm stops, it implies all permutations can be covered with the |P | spheres centered at codewords in P . Thus n! ≤ |P | · Vd(n, d− 1)
By the upper bounds of VdH(n, d), Vl1(n, d) and V∞(n, d), we have
follow-ing corollaries immediately.
Corollary 1. P∞(n, d)≥ n! [(2d−1)!]2d−1n , and P∞(n, d) ≥ n! dn−d(d)! Corollary 2. Pl1(n, d) ≥ (2e(d+n)n! n )n Corollary 3. PH(n, d)≥ 2 n! e(n−d)!n! for d < n.
We give the lower bounds for n = 16 with different metrics by following table. One can find that the lower bound of Pl1(n, d) is very large since the l1-norm has a wide range up to n2/2. By [5], one can construct an (n, d)
permutation array P with hamming distance such that |P | = A(16, d − 2). Let U [A(16, d − 2)] denote the upper bound of A(16, d − 2). The lower bound of PH(n, d) is much larger than A(16, d− 2). The large gap between
those two constructions inspires us to construct PAs directly without using DPMs/DIMs. Note that the permutation array meets the lower bound of
PH(n, d) by Gilbert bound may not have efficient encoding/decoding
algo-rithm. P(16, d) d= 3 4 5 6 7 8 9 10 11 l1 1549 · 108 261 · 108 56 · 108 1439 · 106 423 · 106 139 · 106 50 · 106 19 · 106 8 · 106 T 3122338440 92948453 4082716 250023 20679 2269 327 62 15 l∞ 4647716 72097 3570 480 102 30 12 5 3 Hamming 1729 · 108 168 · 108 1187378122 99721132 8972294 888754 97568 12013 168 U[A(16, d − 2)] 65536 32768 3276 2048 340 256 37 32 6
Chapter 3
DPMs from Z
3
n
to S
n
with
Hamming Distance
3.1
Construction of 3-DPM
HIn this section, we give the construction of 3-DPMH. First of all, we show
the algorithm for input length 8n for any integer n≥ 2. We call the algorithm
A8n. Then we extend A8n for all input length≥ 16. Note that our approach gives a framework for designing general q-DPMH. In this chapter, all addition
and substraction is operated in Z8n = [8n], that is, if a, b ∈ Z8n then the output of a + b is a + b mod 8n if a + b mod 8n = 0, 8n otherwise.
3.1.1
3-DPM
Hof length 8n for n
≥ 2
The 3-DPMH of length 8n (A8n) is shown in Figure 3.1. Algorithm A8n
consists of two passes: PASS 1 and PASS 2. The transition patterns of both passes are illustrated in figures 3.2 and 3.3 respectively.
In figures 2(a) and 3(a), the thin lines represent the transpositions in the first for-loop of both passes and the thick lines represent those transpositions
Algorithm A8n: Input: (x1,· · · , x8n)∈ Z38n Output: (π1,· · · , π8n)∈ S8n PASS 1 : (π11, π12,· · · , π8n1 )← (1, 2, · · · , 8n); for i = 0 to 4n− 1 do;
if x2i+1= 1 then swap (π2i+11 , π12i+2);
for i = 0 to 4n− 1 do;
if x2i+2= 1 then swap (π2i+21 , π12i+3); PASS 2 :
(π1, π2,· · · , π8n)← (π11, π12,· · · , π8n1 );
for i = 0 to n− 1 do;
if x8i+1= 2 then swap (π8i+1, π8i+5);
if x8i+2= 2 then swap (π8i+2, π8i+6);
if x8i+3= 2 then swap (π8i+3, π8i+7);
if x8i+4= 2 then swap (π8i+4, π8i+8);
for i = 0 to n− 1 do;
if x8i+5= 2 then swap (π8i+5, π8i+9);
if x8i+6= 2 then swap (π8i+6, π8i+10);
if x8i+7= 2 then swap (π8i+7, π8i+11);
if x8i+8= 2 then swap (π8i+8, π8i+12); Output (π1,· · · , π8n).
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2(a) 2k + 1 2k + 2 2k + 3 2k + 4 2(b) 2k + 1 2k + 2 2k + 3 2k + 4 2(c)1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3(a)
π8k+i1 π8k+4+i1 π8k+8+i1 π18k+12+i
3(b)
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
22 in the second for-loop. Note that PASS 1 has the ”local” property which is implicitly used in [17, 18]. Since all transpositions in a single for-loop are independent and can be done simultaneously, the local property can be observed in figure 3.2. Now we prove the distance preserving property ofA8n.
Theorem 2. A8n is a 3-DPMH for all n≥ 2.
Proof. Given x∈ Z38n, let π = A8n(x) and π1 be the intermediate result after PASS 1. First of all, for any fixed position i, we look into what possible values πi and π1i can be after running the corresponding pass of A8n.
Claim 1. If i is even, the possible values of π1i are in{i−1, i, i+1, i+2}. If i is odd, the possible values of πi1 are in{i−2, i−1, i, i+1}. If i = 8k+4+j for j ∈ {0, 1, 2, 3}, the possible values of πi are in {π1i−4, πi1, πi1+4, π1i+8}. If i = 8k +
8 + j for j ∈ {0, 1, 2, 3}, the possible values of πi are in {π1i−8, πi1−4, πi1, πi1+4}. Proof. First consider i is even. Let i = 2k + 2. Observe figure 3.2(b), the
possible values of π12k+2 are {2k + 1, 2k + 2, 2k + 3, 2k + 4}. For example, if x2k+1 = 1, x2k+2 = 1 and x2k+3 = 1 (transition indicated in dotted line),
π2k+21 = 2k + 4. If only x2k+2 = 1(normal line), π2k+21 = 2k + 3. If only
x2k+1 = 1(dashed line), π2k+21 = 2k + 1. If all inputs are zero, π2k+21 = 2k + 2. Similarly for odd i, the transition pattern is shown in figure 3.2(c). All cases are summarized in Table 3.1.
In the table, each row stands for the input and the corresponding result after swap operations. For example, in row 7, if x2k+1 = x2k+2 = 1 and
x2k+3 = 1, then π2k+21 = 2k + 3 and π12k+3= 2k + 1. Thus by a similar obser-vation from figure 3.3, we summarize the possible values of πi’s in Table 3.2,
which is very similar to Table 3.1 if we replace 1 by 2. The claim is true by Table 3.1 and Table 3.2.
x2k+1 x2k+2 x2k+3 π2k+21 π2k+31 1 - - - 2k+2 2k+3 2 - - 1 2k+2 2k+4 3 - 1 - 2k+3 2k+2 4 - 1 1 2k+4 2k+2 5 1 - - 2k+1 2k+3 6 1 - 1 2k+1 2k+4 7 1 1 - 2k+3 2k+1 8 1 1 1 2k+4 2k+1
Table 3.1: Possible values of πj1 after PASS 1 for k∈ {0, 1, · · · , 4n − 1}.
Given x, y ∈ {0, 1}8n, let A8n(x) = π, A8n(y) = τ , and π1 and τ1 are the intermediate result after PASS 1 respectively.
Claim 2. If i and j are both even (or odd) and |i − j| ≥ 4, then πi1 = τj1. Proof. Assume that i and j are even. By Claim 1, the possible values of πi1are in{i−1, i, i+1, i+2} and the possible values of τj1are in{j−1, j, j+1, j+2}. Clearly |i − j| ≥ 4 implies that πi1 = τj1. Similarly the claim holds for the case when i and j are odd.
The following claim shows that if the values of the i-th position of π and τ are different after running PASS 1, the difference will be kept (or the difference may be propagated to different position) after running the whole algorithm.
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
24x8k+i x8k+4+i x8k+8+i π8k+4+i π8k+8+i
1 - - - π8k+4+i1 π8k+8+i1 2 - - 2 π8k+4+i1 π8k+12+i1 3 - 2 - π8k+8+i1 π8k+4+i1 4 - 2 2 π8k+12+i1 π8k+4+i1 5 2 - - π8k+i1 π8k+8+i1 6 2 - 2 π8k+i1 π8k+12+i1 7 2 2 - π8k+8+i1 π8k+i1 8 2 2 2 π8k+12+i1 π8k+i1
Table 3.2: Possible values of πj after PASS 2 for k ∈ {0, 1, · · · , n − 1} and i∈ {1, 2, 3, 4}.
Proof. Note that πj = π1i implies that 4|(j − i) since πj must be one of
the elements in {πi1−8, πi1−4, πi1, π1i+4, π1i+8} by Claim 1. Similarly assume that τj = τi1, then we have 4|(j − i). Thus, 4|(i − i). If |i − i| ≥ 4, then we
obtain π1i = τi1 by Claim 2. Therefore, in this case, πj = τj. On the other
hand, if |i − i| < 4, it implies i = i. By assumption, we have π1i = τi1 and this also implies πj = τj.
Definition 1. For any i = j, we say that position i can be covered with
position j if δ(xi, yi) > δ(πi, τi) and δ(xj, yj) < δ(πj, τj), where δ(a, b) = 1 if a = b and 0 otherwise. (that is, xi = yi, πi = τi, xj = yj, and πj = τj). Furthermore, we say that position i is self-covered if δ(xi, yi)≤ δ(πi, τi).
For each i with δ(xi, yi) > δ(πi, τi), it needs some other position to make
up the decrease of distance at position i in order to satisfy the distance preserving property.
Definition 2. Let NSC be the set of positions not self-covered, that is, NSC= {i ∈ [n] : δ(xi, yi) > δ(πi, τi)}. A covering pattern is a function g :
[n]→ [n] such that for any i ∈ NSC, g(i) covers i and for any i ∈ [n]\NSC,
g(i) = i.
The following is our main claim which is crucial to show the distance-preserving property of algorithm A8n.
Claim 4. There exists a covering pattern g such that for any position j ∈NSC,
g(j) ∈ {j − 1, j − 4, j − 5, j − 8, j − 9}. Furthermore, |g−1(k)∩ {k + 1, k + 4, k + 5, k + 8, k + 9}| ≤ 1 for any position k.
Proof. For any x and y ∈ {0, 1}8n, we define such a covering pattern g by analyzing every possible position j ∈ [n] and setting g(j) case by case.
Case 1 : [j with xj = yj] It implies that δ(xj, yj) = 0, and it is always
true that δ(πj, τj) ≥ δ(xj, yj). So j is self-covered. In this case,we can set g(j) = j.
Case 2 : [j with xj = yj and one of xj and yj is 2] W.L.O.G., we may
assume that xj = 2 and yj = 2.
• Case 2-1: [j = 8k + 4 + i for some k ∈ {0, 1, · · · , n − 1} and i ∈ {1, 2, 3, 4}] Observe that in Table 3.2, under the case condition, the
possible values of πj are in{π8k+8+i1 , π18k+12+i} and the possible values of τjare in{τ8k+i1 , τ8k+4+i1 }. Note that {π8k+8+i1 , π18k+12+i}∩{τ8k+i1 , τ8k+4+i1 } = ∅ by Claim 2. Thus, πj = τj. So j is self-covered. In this case, we set g(j) = j.
• Case2-2: [j = 8k+8+i for some k ∈ {0, 1, · · · , n−1} and i ∈ {1, 2, 3, 4}]
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
26 and the possible values of τj are in {τ8k+i1 , τ8k+4+i1 , τ8k+8+i1 }. Assumethat πj = πj11 and τj = τj12. If j1 = j2, then |j1− j2| ≥ 4 and πj = τj
by Claim 2. I.e., j is self-covered. In this case, set g(j) = j. On the other hand, if j1 = j2, then it must be the cases in row 3 and 4 (i.e.
j1 = j2 = 8k + 4 + i) or in rows 7 and 8 (i.e. j1 = j2 = 8k + i) of Table 3.2. In both cases, observe that x8k+4+i and y8k+4+i must be 2 and π8k+4+i = π18k+12+i and τ8k+4+i = τ8k+8+i1 . By Claim 2, π8k+4+i =
τ8k+4+i. Note that it’s still possible πj = τj; i.e. j is self-covered, and
we can simply set g(j) = j. So if πj = τj, then set g(j) = j, else j = 8k + 8 + i can be covered with position j− 4 = 8k + 4 + i and we
set g(j) = j − 4.
For convenience, we can let g(j) = j for all j by default. If j is not self-covered, then we can set g(j) to be other value. In other words, we reset
g(j) whenever necessary.
π8k−4+i π8k+i π8k+4+i π8k+8+i
Figure 3.4: Possible final positions of π8k+i1 , i∈ {0, 1, 2, 3}.
Case 3 : [j with xj = yj and xj, yj ∈ {0, 1}] In this case, W.L.O.G. we
may assume xj = 1 and yj = 0. For convenience, we use Table 3.3 to show
that the possible positions of π8k+i1 and π8k+4+i1 . For example, row 7 means that when x8k−4+i = 2, x8k+i= 2 and x8k+4+i = 2, then after running PASS
x8k−4+i x8k+i x8k+4+i π8k−4+i π8k+i π8k+4+i π8k+8+i 1 - - - π8k+i1 π8k+4+i1 2 - - 2 π8k+i1 π18k+4+i 3 - 2 - π8k+4+i1 π8k+i1 4 - 2 2 π8k+4+i1 π8k+i1 5 2 - - π18k+i π8k+4+i1 6 2 - 2 π18k+i π18k+4+i 7 2 2 - π18k+4+i π8k+i1 8 2 2 2 π18k+4+i π8k+i1
Table 3.3: Possible final positions of π8k+i1 and π8k+4+i1
2, π8k+i1 will appear in position 8k + 4 + i (figure 3.4: dashed line) and π18k+4+i in position 8k− 4 + i.
• Case 3-1: [π1
j = τj1 and j = 8k + i for some k ∈ {0, 1, · · · , n − 1} and i∈ {1, 2, 3, 4}] Note that xj = 2. By Table 3.3, π8k+i1 can be in position
either 8k+i or 8k−4+i. If π8k+i= π8k+i1 , then π8k+i= τ8k+iby Claim 3. Thus, j is self-covered and we set g(j) = j. Similarly it applies to the case when τ8k+i = τ8k+i1 . The rest of this case is that both π18k+i and
τ8k+i1 are in position 8k − 4 + i. When this happens, it implies that
xj−4 = yj−4 = 2 by observing Table 3.3 and we have π8k−4+i = π8k+i1
and τ8k−4+i = τ8k+i1 . By assumption that π8k+i1 = τ8k+i1 , we conclude that j can be covered with j − 4. In this case, set g(j) = j − 4, if
πj = τj. • Case 3-2: [π1
j = τj1 and j = 8k + 4 + i for some k∈ {0, 1, · · · , n−1} and i∈ {1, 2, 3, 4}] Again by observing Table 3.3 if xj = 2 and yj = 2, then
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
28π8k+4+i1 and τ8k+4+i1 have three possible final positions i.e., 8k + 4 + i, 8k + i, and 8k− 4 + i. We divide the analysis into three subcases.
– Subcase 3-2-I: [π8k+4+i1 or τ8k+4+i1 are in position 8k+4+i] W.L.O.G. we assume that π8k+4+i1 appears in position 8k+4+i, i.e. π8k+4+i=
π8k+4+i1 . By the assumption that π18k+4+i = τ8k+4+i1 , we obtain
π8k+4+i= τ8k+4+i by Claim 3. Thus j = 8k + 4 + i is self-covered and set g(j) = j by default.
– Subcase 3-2-II: [π18k+4+ior τ8k+4+i1 are in position 8k + i] W.L.O.G. we assume that π8k+4+i1 appears in position 8k + i, i.e. π8k+i =
π8k+4+i1 . We can assume that τ8k+4+i = τ8k+4+i1 , otherwise it has been done in Subcase 3-2-I. By Claim 3, it’s clear that π8k+i =
τ8k+i. In this subcase since π8k+4+i = π18k+4+i, τ8k+4+i = τ8k+4+i1 and both x8k+4+i and y8k+4+i are not equal to 2, it must be the cases in row 3 or row 7 of Table 3.3. In both cases we have
x8k+i = y8k+i = 2. Thus j can be covered with j− 4 and we set
g(j) = j− 4, if πj = τj.
– Subcase 3-2-III: [Both π18k+4+iand τ8k+4+i1 are in position 8k−4+i] I.e. π8k−4+i = π8k+4+i1 and τ8k−4+i = τ8k+4+i1 . Clearly π8k−4+i =
τ8k−4+i by the assumption of Case 3-2 that π8k+4+i1 = τ8k+4+i1 . Again, by observing Table 3.3, it must be the case that x8k−4+i=
y8k−4+i = 2 and x8k+i = y8k+i = 2. Thus j can be covered with
j− 8 and we set g(j) = j − 8, if πj = τj.
Next, we deal with the case that πj1 = τj1 and xj, yj ∈ {0, 1} with xj = yj. By observing Table 3.1, in this case, j must be odd, and in
rows 3 and 4 (i.e. π12k+3 = τ2k+31 = 2k + 2) or in rows 7 and 8 (i.e.
and πj1−1 = τj1−1 in these cases. We divide the analysis into two cases.
• Case 3-3: [π1
j = τj1 and j = 8k + i for some k ∈ {0, 1, · · · , n − 1} and i ∈ {3, 5}] Note that xj = yj. From the above discussion, we know
that xj−1 = yj−1 = 1 and π1j−1 = τj1−1. The possible final positions
of π1j−1 and τj1−1 are j − 1 and j − 5 by observing Table 3.3. Thus, there are the following three cases: (1) πj−5 = πj1−1 and τj−1 = τj1−1
(or symmetrically πj−1 = π1j−1 and τj−5 = τj1−1); (2)πj−1 = πj1−1 and τj−1 = τj1−1 and (3) πj−5 = π1j−1 and τj−5 = τj1−1. For (1), by Claim 3, πj−1 = τj−1. Thus, j can be covered with position j − 1 and we set g(j) = j− 1. For (2), it is obvious that j can be covered with position j − 1 and we set g(j) = j − 1. For (3), note that xj−5 = yj−5 = 2 by
observing Table 3.3. Thus j can be covered with position j− 5 and we set g(j) = j− 5.
• Case 3-4: [π1
j = τj1 and j = 8k + 4 + i for some k ∈ {0, 1, · · · , n − 1}
and i ∈ {3, 5}] Again we have xj−1 = yj−1 = 1 and πj1−1 = τj1−1. By
observing Table 3.3, the possible final positions of πj1−1 and τj1−1 are
j − 1, j − 5, and j − 9. If one of the final positions of πj1−1 and τj1−1 is j− 1, then j can be covered with position j − 1 by Claim 3 and we can set g(j) = j− 1. Suppose that one of final positions is j − 5. With the same argument as in Subcase 3-2-II, j can be covered with position
j− 5 and we can set g(j) = j − 5. Finally, suppose that both the final
positions are j− 9. With the same argument as of Subcase 3-2-III, j can be covered with position j− 9 and we can set g(j) = j − 9. By the above analysis, we can set up a covering pattern g such that
g(j) = j if position j is self-covered and g(j)∈ {j −1, j −4, j −5, j −8, j −9}
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
30 5, k + 8, k + 9}| ≤ 1 for any position k. We illustrate this in Table 3.4.covered case necessary condition
g(k + 4) = k xk= yk= 2 xk+4 = yk+4 xk= yk= 2 g(k + 8) = k xk+4 = yk+4 = 2 xk+8 = yk+8 g(k + 1) = k xk= yk= 1 xk+1 = yk+1 xk= yk= 2 g(k + 5) = k xk+4 = yk+4 = 1 xk+5 = yk+5 xk= yk= 2 g(k + 9) = k xk+4 = yk+4 = 2 xk+8 = yk+8 = 1 xk+9 = yk+9
Table 3.4: Necessary Conditions for Position Covering
In Table 3.4, we list the necessary conditions for the covering pattern g. Note that those conditions are all disjoint. This implies that g−1(k) contains at most one position in{k +1, k +4, k +5, k +8, k +9} Therefore we complete the proof of Claim 4.
Recall that NSC={i ∈ [n] : δ(xi, yi) > δ(πi, τi)}. Based on Claim 4, we
show that g on NSC is a one-to-one function.
NSC → [n] is a one-to-one function and g(NSC) ∩ NSC = ∅, and hence
|g(NSC)| = |NSC|.
Proof. Assume that g(i) = g(h) = j. Thus we have j ∈ {i − 1, i − 4, i − 5, i −
8, i− 9} ∩ {h − 1, h − 4, h − 5, h − 8, h − 9}. If i = h, then |g−1(j)∩ {j + 1, j + 4, j + 5, j + 8, j + 9}| ≥ 2 since i and h are both in the intersection. However, this is impossible by Claim 4. Thus, i = h and hence g is one-to-one. By Table 3.4, if k covers some other position, then xk = yk. By definition, if k can be covered with some other position, then xk = yk. Thus it implies
g(NSC)∩NSC = ∅. Since g is one-to-one, we have |g(NSC)| = |NSC|.
Now we show the distance-preserving property of A8n. Note that for any
i ∈ NSC, δ(xi, yi) = 1 and δ(πi, τi) = 0. Also for any i∈ g(NSC), we have δ(xi, yi) = 0 and δ(πi, τi) = 1. Thus i∈NSCδ(xi, yi) + i∈g(NSC)δ(xi, yi) = i∈NSCδ(πi, τi) +
i∈g(NSC)δ(πi, τi) by Claim 5. Thus, we have dH(x, y) = 8n i=1 δ(xi, yi) = i∈NSC∪g(NSC) δ(xi, yi) + i /∈NSC∪g(NSC) δ(xi, yi) ≤ i∈NSC∪g(NSC) δ(πi, τi) + i /∈NSC∪g(NSC) δ(πi, τi) = 8n i=1 δ(πi, τi) = dH(π, τ ).
This completes the proof of Theorem 2.
3.1.2
3-DPM
Hfor input length
≥ 16
In this section, we modify our algorithm A8n such that new algorithm can be applied to any input length at least 16. To achieve this goal, we need
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
32 to show another property of algorithm A8n. As in the previous section, letπ = A8n(x) and π1 be the intermediate result after PASS 1.
Lemma 1. For any i∈ {1, 2, · · · , 8n}, πi = i − 3.
Proof. By way of contradiction, suppose that there is i such that πi = i− 3.
Assume that πi = πj1 = i− 3 for some j. j must satisfy 4|(i − j). By the
structure of PASS 1, (i− 3) − 2 ≤ j ≤ (i − 3) + 2. Thus, it must be the case that j = i− 4, that is πi = πi1−4 = i− 3. If πi = π1i−4, then we have xi−4 = 2.
However, if πi1−4 = i− 3, then we have xi−4 = 1 by observing Table 3.1.
Hence, we get a contradiction.
Now we show the 3-DPMH A8n+k as in Figure 3.5.
Algorithm A8n+k (8n≥ 16 , 1 ≤ k ≤ 7) : Input: (x1,· · · , x8n+k)∈ Z38n+k Output: (π1,· · · , π8n+k)∈ S8n+k (π1,· · · , π8n)← A8n(x1, x2· · · , x8n); (π8n+1,· · · , π8n+k)← (8n + 1, · · · , 8n + k); for i = 1 to k do;
if x8n+i = 1 then swap (π8n+i, ππ−1(i−3));
if x8n+i = 2 then swap (π8n+i, πi);
Figure 3.5: 3-DPMH Algorithm A8n+k for k ∈ [7]
We prove its correctness in the following theorem.
Theorem 3. A8n+k : Z38n+k → S8n+k is a 3-DPMH for all n ≥ 2 and k ∈ {1, · · · , 7}.
Proof. Given two inputs (x, w), (y, z)∈ Z38n×Zk
3, suppose that π = A8n+k(x, w)
and τ = A8n+k(y, z). Let wi and zi denote the first i symbols of w and z
respectively. Let πi and τi be the permutations in S
8n+i obtained by
run-ning the i-th iteration in the for loop when the inputs are (x, w) and (y, z) respectively. It suffices to prove the following claim.
Claim 6. dH((x, wi), (y, zi))≤ dH(πi, τi) for any i∈ {0, · · · , k}.
Proof. We prove this claim by induction on i. It holds trivially for i = 0
since we have dH(x, y)≤ dH(A8n(x), A8n(y)) = dH(π0, τ0). For the inductive
step, suppose that dH(x, y) + dH(wi−1, zi−1)≤ dH(πi−1, τi−1). We divide the
analysis into the following cases.
• Case [wi = zi] : The claim holds trivially in this case since both swap
operations in the ith iteration are the same.
• Case [wi = zi and one of them is 0] : W.L.O.G. we assume that wi = 0.
In this case we have π8n+ii = 8n + i, π[1..8n+i−1]i = πi−1 and τ8n+ii equals to either i− 3 or τii−1. Thus we have δ(πi
8n+i, τ8n+ii ) = 1. W.L.O.G.,
we assume that τ8n+ii = τii−1 and hence τii = 8n + i. So δ(πii, τii) = 1. Also note that τi
t = τ i−1
t for any t ∈ [8n + i − 1]\{i}. So we have dH((x, wi), (y, zi))≤ dH(πi, τi).
• Case [wi = zi, and wi, zi ∈ {1, 2}] : W.L.O.G. we assume that wi = 1
and zi = 2. In this case, π8n+ii = i− 3 and τ8n+ii = τii−1 = τi. By
Lemma 1, we know that π−1(i − 3) = i and τi = i − 3. Now it is
easy to check dH(πi, τi) = dH(πi−1, τi−1) + 1. Hence we also have dH((x, wi), (y, zi))≤ dH(πi, τi).
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
34 From Theorem 2 and Theorem 3, we give the first explicit construction of 3-DPMH.Corollary 4. There exists an explicit construction of 3-DPMH from Z3n to Sn for any n≥ 16.
Note that the above construction can be applied to the case when q ≥ 3. However, for different q, we need a different version of lemma 1 in order to obtain an explicit construction of q-DPMH.
3.2
Construction of PAs with Hamming
Dis-tance
As shown in [6] and [4], we know that distance-increasing mappings are quite helpful for constructing permutation arrays. Similarly we can make use of 3-DPMH to construct permutation array with hamming distance. In this
section we introduce the construction and the corresponding encoding and decoding algorithms.
Theorem 4. For all N ≥ 16 and d ≤ N, suppose C is an (N, d) ternary
code. Then there is an (N, d) permutation array P with hamming distance and the same cardinality as C. If C has an efficient encoding/decoding algo-rithm pair, then there is an efficient encoding/decoding algoalgo-rithm pair for P . Furthermore, if the decoding algorithm of C can correct up to e errors, then the decoding algorithm of P can decode correctly when the corrupted codeword π satisfying dH(π, π)≤ e/4 − 2, for some codeword π ∈ P .
Proof. First note that C may not be a linear code. It can be any code over Z3N. Let N = 8n + k, n ≥ 2 and 0 ≤ k ≤ 7. By Theorem 3 and n ≥ 2, we
have a distance-preserving mapping A8n+k : ZN
3 → SN. It is easy to see that A8n+k(C) is a permutation array of length N with minimum distance d. Let
P be A8n+k(C) and so |P | = |A8n+k(C)| = |C|.
Next consider the encoding issue. If C has an efficient encoding algorithm
E : M sg → ZN
3 , where M sg is any arbitrary message space with size equal
to |C|. In particular, Msg usually is Z2log|C| or Z3log3|C| when using ternary code. Let EP = A8n+k◦ E, then EP : M sg → SN is an efficient encoding
algorithm for P because E and A8n+k are both efficient.
message m∈ Msg codeword x∈ C permutation π ∈ P
ˆ m∈ Msg xˆ∈ ZN 3 receive π ∈ SN E A8n+k A−18n+k D channel
Figure 3.6: Construction of permutation array with 3-DPMH
Finally consider the decoding issue. If C has an efficient decoding al-gorithm D : Z3N → C to correct up to e errors, i.e. for any codeword
x ∈ C , and a corrupted codeword y ∈ ZN
3 with dH(x, y) ≤ e, then
D(y) = x. Let π = A8n+k(x) ∈ P and π be a corrupted permutation
satisfying dH(π, π) = d. Without decoding π to π directly, we design an
algorithm A−18n+k which compute the inversion of A8n+k. If we can bound
dH(A−18n+k(π), x) by dH(π, π), then we can decode P by combining A−18n+k
and D. We will describe how to do that in the rest of this proof.
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
36A8n+k is based on A8n and then handle the last k positions. We consider the inversion of A8n first. The idea is based on the proof of lemma 1. In the lemma, we prove for any i, πi = i − 3 by checking the path of symbol i − 3
and derive a contradiction on the value of xi−4. In general if the value of πi = t is given, we can determine the path of symbol t and the values of four
positions of x. For example, given π5 = 12, the path of symbol 12 can be determined as in the figure below, where symbol 12 goes to position 13 in PASS 1 and goes to position 9 and then 5 in PASS 2. Furthermore, we can determine that x11 = 1, x12= 1, x5 = 2 and x9 = 2 by Tables 3.5 and 3.6.
12
5 9 13
Figure 3.7: The unique path of symbol 12, given π5 = 12.
We give Tables 3.5 and 3.6. for each possible value of πi. For example,
given πi = i + 7, i mod 8∈ {5, 6, 7, 8} and i is odd(the case π5 = 12). In the
gray area in Table 3.6, it implies that πi = πi1+8 , πi1+8 = i + 7 and determines
the values of four positions of x, i.e., xi = 2, xi+4 = 2, xi+6 = 1 and xi+7 = 1.
One can verify each entry in the both tables by checking algorithm A8n. Note that the tables give some entries, whcih are not applicable(n.a.) since under our construction certain positions in a permutation will avoid some values.
Checking each position of π, we can determine all the values of xi, so we
can compute the inversion of A8n. Then we consider A−18n+k. If given πi = t
i = 8k + 8 + j, j ∈ {1, 2, 3, 4}, i ∈ [n], k ∈ {0,n8 − 1} i is odd i is even πi πi
π
i−81 xi−8 = 2, xi−4 = 2 i− 10 xi−10= 1, xi−9 = 1 i− 9 xi−9 = 1, xi−8 = 1 i− 9 xi−10= 1, xi−9 = 1 i− 8 xi−9 = 1, xi−8 = 1 i− 8 xi−9 = 1, xi−8 = 1 i− 7(n.a) i− 7 xi−9 = 1, xi−8 = 1 i− 6(n.a.)π
i−41 xi−8 = 2, xi−4 = 2 i− 6 xi−6 = 1, xi−5 = 1 i− 5 xi−5 = 1, xi−4 = 1 i− 5 xi−6 = 1, xi−5 = 1 i− 4 xi−5 = 1, xi−4 = 1 i− 4 xi−5 = 1, xi−4 = 1 i− 3(n.a.) i− 3(n.a.) i− 2(n.a.)π
i1 xi−4 = 2, xi = 2 i− 2 xi−2 = 1, xi−1 = 1 i− 1 xi−1 = 1, xi = 1 i− 1 xi−2 = 1, xi−1 = 1 i xi−1 = 1, xi = 1 i xi−1 = 1, xi = 1 i + 1 xi = 1, xi+1 = 1 i + 1 xi−1 = 1, xi = 1 i + 2 xi = 1, xi+1 = 1π
i+41 xi−4 = 2, xi = 2 i + 2 xi+2 = 1, xi+3 = 1 i + 3 xi+3 = 1, xi+4 = 1 i + 3 xi+2 = 1, xi+3 = 1 i + 4 xi+3 = 1, xi+4 = 1 i + 4 xi+3 = 1, xi+4 = 1 i + 5 xi+4 = 1, xi+5 = 1 i + 5 xi+3 = 1, xi+4 = 1 i + 6 xi+4 = 1, xi+5 = 1CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
38 i = 8k + 4 + j, j ∈ {1, 2, 3, 4}, i ∈ [n], k ∈ {0,n8 − 1} i is odd i is even πi πiπ
i−41 xi = 2, xi−4 = 2 i− 6 xi−6 = 1, xi−5 = 1 i− 5 xi−5 = 1, xi−4 = 1 i− 5 xi−6 = 1, xi−5 = 1 i− 4 xi−5 = 1, xi−4 = 1 i− 4 xi−5 = 1, xi−4 = 1 i− 3(n.a.) i− 3(n.a.) i− 2(n.a.)π
i1 xi = 2, xi−4 = 2 i− 2 xi−2 = 1, xi−1 = 1 i− 1 xi−1 = 1, xi = 1 i− 1 xi−2 = 1, xi−1 = 1 i xi−1 = 1, xi = 1 i xi−1 = 1, xi = 1 i + 1 xi = 1, xi+1 = 1 i + 1 xi−1 = 1, xi = 1 i + 2 xi = 1, xi+1 = 1π
i+41 xi = 2, xi+4 = 2 i + 2 xi+2 = 1, xi+3 = 1 i + 3 xi+3 = 1, xi+4 = 1 i + 3 xi+2 = 1, xi+3 = 1 i + 4 xi+3 = 1, xi+4 = 1 i + 4 xi+3 = 1, xi+4 = 1 i + 5 xi+4 = 1, xi+5 = 1 i + 5 xi+3 = 1, xi+4 = 1 i + 6 xi+4 = 1, xi+5 = 1π
1i+8 xi = 2, xi+4 = 2 i + 6 xi+6 = 1, xi+7 = 1 i + 7 xi+7 = 1, xi+8 = 1 i + 7 xi+6 = 1, xi+7 = 1 i + 8 xi+7 = 1, xi+8 = 1 i + 8 xi+7 = 1, xi+8 = 1 i + 9 xi+8 = 1, xi+9 = 1 i + 9 xi+7 = 1, xi+8 = 1 i + 10 xi+8 = 1, xi+9 = 1xi = 2 otherwise. If given πi = t where i ∈ [1, 8n] and t ∈ [8n + 1, 8n + k], it
implies πi must have been swapped with πt= t in the final stage of algorithm A8n+k. Thus we can just swap the value of πi and πt first and then determine x by the above approach.
We give the algorithm A−18n+k as follows.
Algorithm A−18n+k (8n≥ 16 , k ∈ [0, 7]) :
(a) For all i in [1, k], check whether π8n+i is 8n + i or i− 3 or others, and then assign the corresponding value 0, 1, or 2, to x8n+i respectively. (b) For all i in [1, 8n], if it is larger than 8n, then swap (πi, ππi).
(c) For each πi, i ∈ [1, 8n], let Bi is a bucket for index i. By the value
of i and πi, find the corresponding entries in Table 3.5 or Table 3.6.
If it is not in the tables or not applicable(n.a), then do nothing. Else it will determine the values of four positions of x. Once we know
xi = b ∈ {1, 2} by checking the tables, put b to Bi. If xi = b ∈ {1, 2},
then put 0 to Bi.
(d) Decide xi by a weighted majority vote. For each i in [1, 8n], check Bi, ‘0’ gives half weight, ‘1’ and ‘2’ each gives weight 1, and assign xi be
the largest weighted value b∈ {0, 1, 2}. If tie, choose the larger value.
Let us explain the algorithm A−18n+k. First using π8n+i to decide x8n+i for all i ∈ [1, k]. One can verify that if π8n+k is not corrupted then x8n+k is correct too. Next for i∈ [1, 8n], if πi > 8n, it implies A8n+k swap πi and ππi,
CHAPTER 3.
DPMs from Z
3nto S
nwith Hamming Distance
40 and then we should swap them. Third, the bucket Bi is designed to collectthe vote (information) of xi. For each πi = t, one can determine the values
of four positions of x by checking Table 3.5 and Table 3.6. And if it gives
xi = b∈ {1, 2} then puts b to Bi; if it gives xi = b ∈ {1, 2} then puts ‘0’ to Bi. For example, if π5 = 12, then it will put ‘2’ to B5 and B9, put ‘1’ to B12
and put ‘0’ to B11. Finally for each bucket Bi, make a weighted majority
vote to decide the value of xi. Because if it gives xi = 1(or 2) then we puts
0 to bucket but the vote 0 does not guarantee xi is 0, thus we give 0 half
weight in the weighted majority vote. If tie, choose the larger value. Also we give another version of algorithm A−18n+k in appendix A without table lookup. Let’s give figure 3.8 to illustrate the weighted majority vote. Each π determine information in at most 4 positions of x. For each xi, there are four
positions of π determine information of xi if π is not corrupted, since xi
can be used to decide whether to swap two positions or not in PASS 1, and to swap two positions or not in PASS 2. Thus it reveals some information about xi by checking the path of those four symbols.
Bucket x π B1 x1 π1 B2 x2 π2 B3 x3 π3
·
·
·
·
·
·
·
·
·
B8 x8 π8 B9 x9 π9·
·
·
·
·
·
B16 x16 π16Figure 3.8: Weighted majority vote
The inverse algorithm A−18n+k works well if π is not corrupted. Let us consider the corrupted π. By Tables 3.5 and 3.6, each error will give us wrong information in at most 4 positions of x, and also lose correct information in at most 4 positions of x. It gives us a rough bound dH(A−18n+k(π), x) ≤
8· dH(π, π). Here we give a better bound by analyzing it more carefully.
Let π = A8n+k(x) be the correct codeword of x, and π be the corrupted permutation.
Claim 7. dH(A−18n+k(π), x) ≤ 4 · dH(π, π) + k