Index of Coincidence of a ciphertext with respect to itself.
by fortenforge, Oct 18, 2009, 9:51 PM
If we are comparing a text to itself, we basically are mathematically finding the probability that if we choose
characters from the text, the characters will be the same.
Here is the formula:
.
where
is the number of characters in the alphabet,
is the number of times the
th of the alphabet appears in the plaintext, and
is the number of letters in the plaintext.
Let us try to derive this formula. Probability is defined as the number of ways you get what you want divided by the total number of possibilities. How many ways are there to choose any
letters from a group of
letters? It is of course,
which is equal to
. This is the denominator. To calculate the numerator, we first calculate the number of ways to pick
a's from our plaintext and add that to the number of ways to pick
b's from our plaintext, and so on. If the number of a's in our plaintext was
, then the number of ways to pick
a's is
, this is equal to
as we have shown before. This numerator and denominator gives us
, the
's cancel giving us our desired formula:
.

Here is the formula:

where




Let us try to derive this formula. Probability is defined as the number of ways you get what you want divided by the total number of possibilities. How many ways are there to choose any












