<s>
In	O
applied	O
mathematics	O
,	O
a	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
is	O
a	O
permutation	B-Algorithm
of	O
a	O
sequence	O
of	O
items	O
,	O
where	O
is	O
a	O
power	O
of	O
two	O
.	O
</s>
<s>
Repeating	O
the	O
same	O
permutation	B-Algorithm
twice	O
returns	O
to	O
the	O
original	O
ordering	O
on	O
the	O
items	O
,	O
so	O
the	O
bit	B-Algorithm
reversal	I-Algorithm
permutation	B-Algorithm
is	O
an	O
involution	B-Algorithm
.	O
</s>
<s>
This	O
permutation	B-Algorithm
can	O
be	O
applied	O
to	O
any	O
sequence	O
in	O
linear	O
time	O
while	O
performing	O
only	O
simple	O
index	O
calculations	O
.	O
</s>
<s>
Repeating	O
the	O
same	O
permutation	B-Algorithm
on	O
this	O
new	O
sequence	O
returns	O
to	O
the	O
starting	O
sequence	O
.	O
</s>
<s>
Writing	O
the	O
index	O
numbers	O
in	O
decimal	O
(	O
but	O
,	O
as	O
above	O
,	O
starting	O
with	O
position	O
0	O
rather	O
than	O
the	O
more	O
conventional	O
start	O
of	O
1	O
for	O
a	O
permutation	B-Algorithm
)	O
,	O
the	O
bit-reversal	B-Algorithm
permutations	I-Algorithm
on	O
items	O
,	O
for	O
,	O
are	O
:	O
</s>
<s>
Each	O
permutation	B-Algorithm
in	O
this	O
sequence	O
can	O
be	O
generated	O
by	O
concatenating	O
two	O
sequences	O
of	O
numbers	O
:	O
the	O
previous	O
permutation	B-Algorithm
,	O
with	O
its	O
values	O
doubled	O
,	O
and	O
the	O
same	O
sequence	O
with	O
each	O
value	O
increased	O
by	O
one	O
.	O
</s>
<s>
Thus	O
,	O
for	O
example	O
doubling	O
the	O
length-4	O
permutation	B-Algorithm
gives	O
,	O
adding	O
one	O
gives	O
,	O
and	O
concatenating	O
these	O
two	O
sequences	O
gives	O
the	O
length-8	O
permutation	B-Algorithm
.	O
</s>
<s>
The	O
generalization	O
to	O
radix	O
representations	O
,	O
for	O
,	O
and	O
to	O
,	O
is	O
a	O
digit-reversal	B-Algorithm
permutation	I-Algorithm
,	O
in	O
which	O
the	O
base	O
-	O
digits	O
of	O
the	O
index	O
of	O
each	O
element	O
are	O
reversed	O
to	O
obtain	O
the	O
permuted	O
index	O
.	O
</s>
<s>
In	O
such	O
cases	O
,	O
the	O
digit-reversal	B-Algorithm
permutation	I-Algorithm
should	O
simultaneously	O
reverses	O
the	O
digits	O
of	O
each	O
item	O
and	O
the	O
bases	O
of	O
the	O
number	O
system	O
,	O
so	O
that	O
each	O
reversed	O
digit	O
remains	O
within	O
the	O
range	O
defined	O
by	O
its	O
base	O
.	O
</s>
<s>
Permutations	B-Algorithm
that	O
generalize	O
the	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
by	O
reversing	O
contiguous	O
blocks	O
of	O
bits	O
within	O
the	O
binary	O
representations	O
of	O
their	O
indices	O
can	O
be	O
used	O
to	O
interleave	O
two	O
equal-length	O
sequences	O
of	O
data	O
in-place	B-Algorithm
.	O
</s>
<s>
There	O
are	O
two	O
extensions	O
of	O
the	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
to	O
sequences	O
of	O
arbitrary	O
length	O
.	O
</s>
<s>
These	O
extensions	O
coincide	O
with	O
bit-reversal	B-Algorithm
for	O
sequences	O
whose	O
length	O
is	O
a	O
power	O
of	O
2	O
,	O
and	O
their	O
purpose	O
is	O
to	O
separate	O
adjacent	O
items	O
in	O
a	O
sequence	O
for	O
the	O
efficient	O
operation	O
of	O
the	O
Kaczmarz	B-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
The	O
second	O
extension	O
,	O
called	O
EBR	O
(	O
extended	O
bit-reversal	B-Algorithm
)	O
,	O
is	O
similar	O
in	O
spirit	O
to	O
bit-reversal	B-Algorithm
.	O
</s>
<s>
Given	O
an	O
array	O
of	O
size	O
,	O
EBR	O
fills	O
the	O
array	O
with	O
a	O
permutation	B-Algorithm
of	O
the	O
numbers	O
in	O
the	O
range	O
in	O
linear	O
time	O
.	O
</s>
<s>
Successive	O
numbers	O
are	O
separated	O
in	O
the	O
permutation	B-Algorithm
by	O
at	O
least	O
positions	O
.	O
</s>
<s>
Bit	B-Algorithm
reversal	I-Algorithm
is	O
most	O
important	O
for	O
radix-2	O
Cooley	B-Algorithm
–	I-Algorithm
Tukey	I-Algorithm
FFT	I-Algorithm
algorithms	I-Algorithm
,	O
where	O
the	O
recursive	O
stages	O
of	O
the	O
algorithm	O
,	O
operating	O
in-place	B-Algorithm
,	O
imply	O
a	O
bit	B-Algorithm
reversal	I-Algorithm
of	O
the	O
inputs	O
or	O
outputs	O
.	O
</s>
<s>
Similarly	O
,	O
mixed-radix	O
digit	O
reversals	O
arise	O
in	O
mixed-radix	O
Cooley	B-Algorithm
–	I-Algorithm
Tukey	I-Algorithm
FFTs	I-Algorithm
.	O
</s>
<s>
The	O
bit	B-Algorithm
reversal	I-Algorithm
permutation	B-Algorithm
has	O
also	O
been	O
used	O
to	O
devise	O
lower	O
bounds	O
in	O
distributed	O
computation	O
.	O
</s>
<s>
The	O
Van	O
der	O
Corput	O
sequence	O
,	O
a	O
low-discrepancy	O
sequence	O
of	O
numbers	O
in	O
the	O
unit	O
interval	O
,	O
is	O
formed	O
by	O
reinterpreting	O
the	O
indexes	O
of	O
the	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
as	O
the	O
fixed-point	O
binary	O
representations	O
of	O
dyadic	O
rational	O
numbers	O
.	O
</s>
<s>
Bit-reversal	B-Algorithm
permutations	I-Algorithm
are	O
often	O
used	O
in	O
finding	O
lower	O
bounds	O
on	O
dynamic	O
data	B-General_Concept
structures	I-General_Concept
.	O
</s>
<s>
For	O
example	O
,	O
subject	O
to	O
certain	O
assumptions	O
,	O
the	O
cost	O
of	O
looking	O
up	O
the	O
integers	O
between	O
and	O
,	O
inclusive	O
,	O
in	O
any	O
binary	B-Language
search	I-Language
tree	I-Language
holding	O
those	O
values	O
,	O
is	O
when	O
those	O
numbers	O
are	O
queried	O
in	O
bit-reversed	B-Algorithm
order	I-Algorithm
.	O
</s>
<s>
This	O
bound	O
applies	O
even	O
to	O
trees	O
like	O
splay	B-Data_Structure
trees	I-Data_Structure
that	O
are	O
allowed	O
to	O
rearrange	O
their	O
nodes	O
between	O
accesses	O
.	O
</s>
<s>
Mainly	O
because	O
of	O
the	O
importance	O
of	O
fast	O
Fourier	O
transform	O
algorithms	O
,	O
numerous	O
efficient	O
algorithms	O
for	O
applying	O
a	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
to	O
a	O
sequence	O
have	O
been	O
devised	O
.	O
</s>
<s>
Because	O
the	O
bit-reversal	B-Algorithm
permutation	I-Algorithm
is	O
an	O
involution	B-Algorithm
,	O
it	O
may	O
be	O
performed	O
easily	O
in	B-Algorithm
place	I-Algorithm
(	O
without	O
copying	O
the	O
data	O
into	O
another	O
array	O
)	O
by	O
swapping	O
pairs	O
of	O
elements	O
.	O
</s>
<s>
In	O
the	O
random-access	B-Application
machine	I-Application
commonly	O
used	O
in	O
algorithm	O
analysis	O
,	O
a	O
simple	O
algorithm	O
that	O
scans	O
the	O
indexes	O
in	O
input	O
order	O
and	O
swaps	O
whenever	O
the	O
scan	O
encounters	O
an	O
index	O
whose	O
reversal	O
is	O
a	O
larger	O
number	O
would	O
perform	O
a	O
linear	O
number	O
of	O
data	O
moves	O
.	O
</s>
<s>
Alternative	O
algorithms	O
can	O
perform	O
a	O
bit	B-Algorithm
reversal	I-Algorithm
permutation	B-Algorithm
in	O
linear	O
time	O
while	O
using	O
only	O
simple	O
index	O
calculations	O
.	O
</s>
<s>
Because	O
bit-reversal	B-Algorithm
permutations	I-Algorithm
may	O
be	O
repeated	O
multiple	O
times	O
as	O
part	O
of	O
a	O
calculation	O
,	O
it	O
may	O
be	O
helpful	O
to	O
separate	O
out	O
the	O
steps	O
of	O
the	O
algorithm	O
that	O
calculate	O
index	O
data	O
used	O
to	O
represent	O
the	O
permutation	B-Algorithm
(	O
for	O
instance	O
,	O
by	O
using	O
the	O
doubling	O
and	O
concatenation	O
method	O
)	O
from	O
the	O
steps	O
that	O
use	O
the	O
results	O
of	O
this	O
calculation	O
to	O
permute	O
the	O
data	O
(	O
for	O
instance	O
,	O
by	O
scanning	O
the	O
data	O
indexes	O
in	O
order	O
and	O
performing	O
a	O
swap	O
whenever	O
the	O
swapped	O
location	O
is	O
greater	O
than	O
the	O
current	O
index	O
,	O
or	O
by	O
using	O
more	O
sophisticated	O
vector	B-General_Concept
scatter	I-General_Concept
–	I-General_Concept
gather	I-General_Concept
operations	I-General_Concept
)	O
.	O
</s>
<s>
Another	O
consideration	O
that	O
is	O
even	O
more	O
important	O
for	O
the	O
performance	O
of	O
these	O
algorithms	O
is	O
the	O
effect	O
of	O
the	O
memory	B-General_Concept
hierarchy	I-General_Concept
on	O
running	O
time	O
.	O
</s>
<s>
An	O
alternative	O
to	O
these	O
techniques	O
is	O
special	O
computer	O
hardware	O
that	O
allows	O
memory	O
to	O
be	O
accessed	O
both	O
in	O
normal	O
and	O
in	O
bit-reversed	B-Algorithm
order	I-Algorithm
.	O
</s>
<s>
The	O
performance	O
improvement	O
of	O
bit-reversals	B-Algorithm
in	O
both	O
uniprocessor	O
and	O
multiprocessors	O
has	O
been	O
paid	O
a	O
serious	O
attention	O
in	O
high-performance	O
computing	O
fields	O
.	O
</s>
