The Index of Coincidence (IC) is a statistical tool used in cryptanalysis to measure the likelihood of similar letters appearing in the same position when two texts are aligned. It is used to break classical ciphers by comparing the IC of the encrypted text to the IC of the language it is believed to be in. A higher IC indicates a higher likelihood of the texts being in the same language, while a lower IC suggests the texts are in different languages or that one is encrypted.
The formula to calculate the Index of Coincidence (IC) is:
\[ IC = \frac{\sum (n_i (n_i - 1))}{N (N - 1)} \]
Where:
Let's say the text is "HELLO". The frequency of each letter is H:1, E:1, L:2, O:1. Using the formula:
\[ IC = \frac{1(1-1) + 1(1-1) + 2(2-1) + 1(1-1)}{5(5-1)} \]
We get:
\[ IC = \frac{0 + 0 + 2 + 0}{20} = 0.1 \]
So, the Index of Coincidence (\( IC \)) is 0.1.