<s>
A	O
random	B-Algorithm
permutation	I-Algorithm
is	O
a	O
random	O
ordering	O
of	O
a	O
set	O
of	O
objects	O
,	O
that	O
is	O
,	O
a	O
permutation-valued	O
random	O
variable	O
.	O
</s>
<s>
The	O
use	O
of	O
random	B-Algorithm
permutations	I-Algorithm
is	O
often	O
fundamental	O
to	O
fields	O
that	O
use	O
randomized	B-General_Concept
algorithms	I-General_Concept
such	O
as	O
coding	B-Error_Name
theory	I-Error_Name
,	O
cryptography	O
,	O
and	O
simulation	O
.	O
</s>
<s>
A	O
good	O
example	O
of	O
a	O
random	B-Algorithm
permutation	I-Algorithm
is	O
the	O
shuffling	O
of	O
a	O
deck	O
of	O
cards	O
:	O
this	O
is	O
ideally	O
a	O
random	B-Algorithm
permutation	I-Algorithm
of	O
the	O
52	O
cards	O
.	O
</s>
<s>
One	O
method	O
of	O
generating	O
a	O
random	B-Algorithm
permutation	I-Algorithm
of	O
a	O
set	O
of	O
length	O
n	O
uniformly	O
at	O
random	O
(	O
i.e.	O
,	O
each	O
of	O
the	O
n	O
!	O
</s>
<s>
A	O
simple	O
algorithm	O
to	O
generate	O
a	O
permutation	B-Algorithm
of	O
n	O
items	O
uniformly	O
at	O
random	O
without	O
retries	O
,	O
known	O
as	O
the	O
Fisher	B-Algorithm
–	I-Algorithm
Yates	I-Algorithm
shuffle	I-Algorithm
,	O
is	O
to	O
start	O
with	O
any	O
permutation	B-Algorithm
(	O
for	O
example	O
,	O
the	O
identity	O
permutation	B-Algorithm
)	O
,	O
and	O
then	O
go	O
through	O
the	O
positions	O
0	O
through	O
n	O
−	O
2	O
(	O
we	O
use	O
a	O
convention	O
where	O
the	O
first	O
element	O
has	O
index	O
0	O
,	O
and	O
the	O
last	O
element	O
has	O
index	O
n	O
−	O
1	O
)	O
,	O
and	O
for	O
each	O
position	O
i	O
swap	O
the	O
element	O
currently	O
there	O
with	O
a	O
randomly	O
chosen	O
element	O
from	O
positions	O
i	O
through	O
n	O
−	O
1	O
(	O
the	O
end	O
)	O
,	O
inclusive	O
.	O
</s>
<s>
It	O
's	O
easy	O
to	O
verify	O
that	O
any	O
permutation	B-Algorithm
of	O
n	O
elements	O
will	O
be	O
produced	O
by	O
this	O
algorithm	O
with	O
probability	O
exactly	O
1/n	O
!,	O
thus	O
yielding	O
a	O
uniform	O
distribution	O
over	O
all	O
such	O
permutations	B-Algorithm
.	O
</s>
<s>
The	O
probability	O
distribution	O
of	O
the	O
number	O
of	O
fixed	O
points	O
in	O
a	O
uniformly	O
distributed	O
random	B-Algorithm
permutation	I-Algorithm
approaches	O
a	O
Poisson	O
distribution	O
with	O
expected	O
value	O
1	O
as	O
n	O
grows	O
.	O
</s>
<s>
As	O
with	O
all	O
random	O
processes	O
,	O
the	O
quality	O
of	O
the	O
resulting	O
distribution	O
of	O
an	O
implementation	O
of	O
a	O
randomized	B-General_Concept
algorithm	I-General_Concept
such	O
as	O
the	O
Knuth	B-Algorithm
shuffle	I-Algorithm
(	O
i.e.	O
,	O
how	O
close	O
it	O
is	O
to	O
the	O
desired	O
uniform	O
distribution	O
)	O
depends	O
on	O
the	O
quality	O
of	O
the	O
underlying	O
source	O
of	O
randomness	O
,	O
such	O
as	O
a	O
pseudorandom	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
.	O
</s>
<s>
There	O
are	O
many	O
possible	O
randomness	O
tests	O
for	O
random	B-Algorithm
permutations	I-Algorithm
,	O
such	O
as	O
some	O
of	O
the	O
Diehard	O
tests	O
.	O
</s>
<s>
A	O
typical	O
example	O
of	O
such	O
a	O
test	O
is	O
to	O
take	O
some	O
permutation	B-Algorithm
statistic	O
for	O
which	O
the	O
distribution	O
is	O
known	O
and	O
test	O
whether	O
the	O
distribution	O
of	O
this	O
statistic	O
on	O
a	O
set	O
of	O
randomly	O
generated	O
permutations	B-Algorithm
closely	O
approximates	O
the	O
true	O
distribution	O
.	O
</s>
