236601 - Coding and
Algorithms for Memories
Lecture 8
1
Relative Vs. Absolute Values
Less errors
More retention
1
0
Jiang, Mateescu, Schwartz, Bruck,
“Rank modulation for Flash Memories”, 20082
The New Paradigm
Rank Modulation
Absolute values
Relative values
Single cell
Multiple cells
Physical cell
Logical cell
3
Rank Modulation
Ordered set of n cells
1
4
Assume discrete levels
Relative levels define a permutation
3
2
Basic operation: push-to-the-top
Overshoot is not a concern
1
2
3
4
Writing is much faster
Increased reliability (data retention)
4
New Number Representation System
an-1…a3a2a1 = an-1·(n-1)! + … + a3·3! + a2·2! + a1·1!
permutation in
lexicographical order
012
021
102
120
201
210
FACTORADIC
0 ≤ ai ≤ i
decimal
[Lehmer 1906, Laisant 1888]
00
01
10
11
20
21
0
1
2
3
4
5
5
Gray Codes for Rank Modulation
The problem: Is it possible to
transition between all permutations?
Find cycle through n! states
by push-to-the-top transitions
n=3
3 cycles
1
2
3
3
1
2
2
3
1
2
1
3
1
3
2
3
2
1
Transition graph, n=3
1
2
1
2
3
3
6
Gray Codes for Arbitrary n
• Recursive construction:
– Keep bottom cell fixed
– (n-1)! transitions with others
132312
213231
321123
444444
1
2
3
3
1
2
2
3
1
2
1
3
1
3
2
3
2
1
412142
241214
124421
333333
3 4 2 4 3~ (n-1)!
2
234243
423324
1 11 11 1
1
2
3
4
1
2
3
4
7
Rewriting with Rank Modulation
• If we represent n! symbols then in the worst
case we apply n-1 push-to-the-top operations to
transfer from one permutation to another
• Problem: Is it possible to use less push-to-thetop operations in case less than n! symbols are
represented?
• Rank Modulation Rewriting code (RMRC) (n,M)
consists of
– Update function: E: Sn×[M] -> Sn
– Decoding function D: Sn -> [M]
8
Rewriting with Rank Modulation
• Definition: The cost of changing s1 into s2,
α(s1->s2), is the min number of push-to-the-top
operations needed to change s1 to s2
– Ex: α([123]->[213]) = 1, α([123]->[321]) = 2
• The rewriting cost of a RMRC is the maximum
update cost
• The transition graph Gn=(Vn,En)
1
3
– Vn = Sn, En ={(s1,s2) : α(s1->s2)=1}
2
3
1
2
2
3
1
• The ball or radius r:
2
3
1
Br(s)={ s’ : α(s->s’) ≤ r }
1
2
3
3
1
2
• The sphere or radius r:
Sr(s)={ s’ : α(s->s’) = r }
• The balls and the sphere sizes do not depend on r
Br,Sr
9
Rewriting with Rank Modulation
• Lemma: Br =n!/(n-r)!
• For n,M, define r(n,M) to be the smallest integer
such that Br(n,M) ≥ M
• Lemma (Lower Bound): For any RMRC (n,M), its
rewriting cost is at least r(n,M)
• A tight upper bound on the rewriting cost is given
by a construction
• Theorem: There exists a RMRC with parameters
(n,M≤Br) and cost r
–
–
–
–
Ex.
Ex.
Ex.
Ex.
(n,n) with cost 1
(n,n(n-1)) with cost 2
(n,n!) with cost n-1
(n,n!/2) with cost n-2
10
3
2
4
1
3 2 1 4
2 3 1 4
11
Kendall’s Tau Distance
• For a permutation an adjacent transposition is the
local exchange of two adjacent elements
• For ,π∊Sm, dτ(,π) is the Kendall’s tau distance
between and π
= Number of adjacent transpositions to change to be π
=2413 and π=2314
2413 2143 2134 2314
dτ(,π) = 3
It is called also the bubble-sort distance
Lemma: Kendall’s tau distance induces
a metric on Sn
The Kendall’s tau distance is the number of
pairs that do not agree in their order
12
Kendall’s Tau Distance
• Lemma: Kendall’s tau distance induces a metric on Sn
• The Kendall’s tau distance is the number of pairs that
do not agree in their order
• For a permutation , Wτ() = {(i,j) | i<j, -1(i) > -1(i) }
• Lemma: dτ(,π) = |Wτ()Wτ(π)|
= |Wτ()\Wτ(π)| + |Wτ(π)\Wτ()|
• dτ(,id) = |Wτ()|
• The maximum Kendall’s tau distance is n(n-1)/2
• The inversion vector of is x =(x(2),…,x(n))
x(i) = # of elements to the right of i and are less then i
• dτ(,id) = |Wτ()| = Σ2≤i≤nx(i)
13
Kendall’s Tau Distance
•
•
•
•
The Kendall’s tau ball: Br() = {π|dτ(,π) ≤ r}
The Kendall’s tau sphere: Sr() = {π|dτ(,π) = r}
They do not depend on the center
|B1()| = n, |S1()| = n-1
14
How to Construct ECCs for the
Kendall’s Tau Distance?
• Goal: Construct codes with some prescribed
min Kendall’s tau dist d
15
© Copyright 2026 Paperzz