I'm trying to understand how the maximum Index of Coincidence (IC) is found. This is the only description I have for it:
"For a given period $P$ you can divide a cipher into $P$ groups, calculate the IC for each group, then take the average of these $P$ values. Doing this for all periods from 1 to 15 and selecting the maximum of these 15 values gives a MIC statistic"
Just to make sure I understand it correctly if I have a text with a length of 100 characters I should calculate the IC for: ... 100 characters ... two sets of 50 characters ... three sets of 33 characters (or 34?) ... four sets of 25 characters
and so on until I have my 15 groups of $P$
Then I take the maximum IC from each of the groups of $P$ and
sum = sum + count * (count - 1);
Then
sum / totcount * totcount - 1
Sorry if I don't understand I'm new to cryptoanalysis