<s>
In	O
cryptography	O
,	O
coincidence	B-General_Concept
counting	I-General_Concept
is	O
the	O
technique	O
(	O
invented	O
by	O
William	O
F	O
.	O
Friedman	O
)	O
of	O
putting	O
two	O
texts	O
side-by-side	O
and	O
counting	O
the	O
number	O
of	O
times	O
that	O
identical	O
letters	O
appear	O
in	O
the	O
same	O
position	O
in	O
both	O
texts	O
.	O
</s>
<s>
This	O
count	O
,	O
either	O
as	O
a	O
ratio	O
of	O
the	O
total	O
or	O
normalized	O
by	O
dividing	O
by	O
the	O
expected	O
count	O
for	O
a	O
random	O
source	O
model	O
,	O
is	O
known	O
as	O
the	O
index	B-General_Concept
of	I-General_Concept
coincidence	I-General_Concept
,	O
or	O
IC	O
for	O
short	O
.	O
</s>
<s>
What	O
makes	O
the	O
IC	O
especially	O
useful	O
is	O
the	O
fact	O
that	O
its	O
value	O
does	O
not	O
change	O
if	O
both	O
texts	O
are	O
scrambled	O
by	O
the	O
same	O
single-alphabet	O
substitution	O
cipher	O
,	O
allowing	O
a	O
cryptanalyst	O
to	O
quickly	O
detect	O
that	O
form	O
of	O
encryption	O
.	O
</s>
<s>
The	O
index	B-General_Concept
of	I-General_Concept
coincidence	I-General_Concept
provides	O
a	O
measure	O
of	O
how	O
likely	O
it	O
is	O
to	O
draw	O
two	O
matching	O
letters	O
by	O
randomly	O
selecting	O
two	O
letters	O
from	O
a	O
given	O
text	O
.	O
</s>
<s>
We	O
can	O
express	O
the	O
index	B-General_Concept
of	I-General_Concept
coincidence	I-General_Concept
IC	O
for	O
a	O
given	O
letter-frequency	O
distribution	O
as	O
a	O
summation	O
:	O
</s>
<s>
where	O
N	O
is	O
the	O
length	O
of	O
the	O
text	O
and	O
n1	O
through	O
nc	O
are	O
the	O
frequencies	O
(	O
as	O
integers	O
)	O
of	O
the	O
c	O
letters	O
of	O
the	O
alphabet	B-Application
(	O
c	O
=	O
26	O
for	O
monocase	O
English	O
)	O
.	O
</s>
<s>
If	O
all	O
letters	O
of	O
an	O
alphabet	B-Application
were	O
equally	O
probable	O
,	O
the	O
expected	O
index	O
would	O
be	O
1.0	O
.	O
</s>
<s>
Sometimes	O
values	O
are	O
reported	O
without	O
the	O
normalizing	O
denominator	O
,	O
for	O
example	O
for	O
English	O
;	O
such	O
values	O
may	O
be	O
called	O
κp	O
(	O
"	O
kappa-plaintext	O
"	O
)	O
rather	O
than	O
IC	O
,	O
with	O
κr	O
(	O
"	O
kappa-random	O
"	O
)	O
used	O
to	O
denote	O
the	O
denominator	O
(	O
which	O
is	O
the	O
expected	O
coincidence	O
rate	O
for	O
a	O
uniform	O
distribution	O
of	O
the	O
same	O
alphabet	B-Application
,	O
for	O
English	O
)	O
.	O
</s>
<s>
The	O
index	B-General_Concept
of	I-General_Concept
coincidence	I-General_Concept
is	O
useful	O
both	O
in	O
the	O
analysis	O
of	O
natural-language	O
plaintext	O
and	O
in	O
the	O
analysis	O
of	O
ciphertext	O
(	O
cryptanalysis	O
)	O
.	O
</s>
<s>
This	O
technique	O
is	O
used	O
to	O
cryptanalyze	O
the	O
Vigenère	B-Algorithm
cipher	I-Algorithm
,	O
for	O
example	O
.	O
</s>
<s>
For	O
a	O
repeating-key	O
polyalphabetic	B-Algorithm
cipher	I-Algorithm
arranged	O
into	O
a	O
matrix	O
,	O
the	O
coincidence	O
rate	O
within	O
each	O
column	O
will	O
usually	O
be	O
highest	O
when	O
the	O
width	O
of	O
the	O
matrix	O
is	O
a	O
multiple	O
of	O
the	O
key	O
length	O
,	O
and	O
this	O
fact	O
can	O
be	O
used	O
to	O
determine	O
the	O
key	O
length	O
,	O
which	O
is	O
the	O
first	O
step	O
in	O
cracking	O
the	O
system	O
.	O
</s>
<s>
Coincidence	B-General_Concept
counting	I-General_Concept
can	O
help	O
determine	O
when	O
two	O
texts	O
are	O
written	O
in	O
the	O
same	O
language	O
using	O
the	O
same	O
alphabet	B-Application
.	O
</s>
<s>
The	O
causal	O
coincidence	O
count	O
for	O
such	O
texts	O
will	O
be	O
distinctly	O
higher	O
than	O
the	O
accidental	O
coincidence	O
count	O
for	O
texts	O
in	O
different	O
languages	O
,	O
or	O
texts	O
using	O
different	O
alphabets	B-Application
,	O
or	O
gibberish	O
texts	O
.	O
</s>
<s>
To	O
see	O
why	O
,	O
imagine	O
an	O
"	O
alphabet	B-Application
"	O
of	O
only	O
the	O
two	O
letters	O
A	O
and	O
B	O
.	O
</s>
<s>
In	O
effect	O
,	O
the	O
new	O
alphabet	B-Application
produced	O
by	O
the	O
substitution	O
is	O
just	O
a	O
uniform	O
renaming	O
of	O
the	O
original	O
character	O
identities	O
,	O
which	O
does	O
not	O
affect	O
whether	O
they	O
match	O
.	O
</s>
<s>
This	O
is	O
noticeably	O
lower	O
than	O
the	O
probability	O
when	O
same-language	O
,	O
same-alphabet	O
texts	O
were	O
used	O
.	O
</s>
<s>
Nevertheless	O
,	O
this	O
technique	O
can	O
be	O
used	O
effectively	O
to	O
identify	O
when	O
two	O
texts	O
are	O
likely	O
to	O
contain	O
meaningful	O
information	O
in	O
the	O
same	O
language	O
using	O
the	O
same	O
alphabet	B-Application
,	O
to	O
discover	O
periods	O
for	O
repeating	O
keys	O
,	O
and	O
to	O
uncover	O
many	O
other	O
kinds	O
of	O
nonrandom	O
phenomena	O
within	O
or	O
among	O
ciphertexts	O
.	O
</s>
<s>
The	O
above	O
description	O
is	O
only	O
an	O
introduction	O
to	O
use	O
of	O
the	O
index	B-General_Concept
of	I-General_Concept
coincidence	I-General_Concept
,	O
which	O
is	O
related	O
to	O
the	O
general	O
concept	O
of	O
correlation	O
.	O
</s>
<s>
Various	O
forms	O
of	O
Index	B-General_Concept
of	I-General_Concept
Coincidence	I-General_Concept
have	O
been	O
devised	O
;	O
the	O
"	O
delta	O
"	O
I.C.	O
</s>
<s>
against	O
the	O
value	O
to	O
be	O
expected	O
for	O
the	O
null	B-General_Concept
hypothesis	I-General_Concept
(	O
usually	O
:	O
no	O
match	O
and	O
a	O
uniform	O
random	O
symbol	O
distribution	O
)	O
,	O
so	O
that	O
in	O
every	O
situation	O
the	O
expected	O
value	O
for	O
no	O
correlation	O
is	O
1.0	O
.	O
</s>
<s>
The	O
number	O
of	O
cipher	O
alphabets	B-Application
used	O
in	O
a	O
polyalphabetic	B-Algorithm
cipher	I-Algorithm
may	O
be	O
estimated	O
by	O
dividing	O
the	O
expected	O
bulge	O
of	O
the	O
delta	O
I.C.	O
</s>
<s>
for	O
a	O
single	O
alphabet	B-Application
by	O
the	O
observed	O
bulge	O
for	O
the	O
message	O
,	O
although	O
in	O
many	O
cases	O
(	O
such	O
as	O
when	O
a	O
repeating	B-Algorithm
key	I-Algorithm
was	O
used	O
)	O
better	O
techniques	O
are	O
available	O
.	O
</s>
<s>
Suspecting	O
this	O
to	O
be	O
an	O
English	O
plaintext	O
encrypted	O
using	O
a	O
Vigenère	B-Algorithm
cipher	I-Algorithm
with	O
normal	O
A	O
–	O
Z	O
components	O
and	O
a	O
short	O
repeating	O
keyword	O
,	O
we	O
can	O
consider	O
the	O
ciphertext	O
"	O
stacked	O
"	O
into	O
some	O
number	O
of	O
columns	O
,	O
for	O
example	O
seven	O
:	O
</s>
