Product moment correlation coefficient use x as standard alphabet and y as encrypted alphabets.
Can precompute several values for the standard alphabet. These are: Σx Σx/n ( Σx2- (Σx )2/n)
Can precompute several values for the standard alphabet but sorted into frequency order. These are: Σx Σx/n ( Σx2- (Σx )2/n)
The columns contain the frequency counts of the letters sorted by frequency. The unsorted frequencies are PMCC tested against the 26 possible simple shift alphabets. The best and second best r values are rported back. If the sampling periodicity is the same as that of the codeword length then The best r should be over 0.95 whilst the second best r is low. If the sampling interval isn't the same as the Viginere code word length then bot r numbers will be 0.4-0.6. The shift value for the best match is also reported back.
If you can read JavaScript then download the source and fiddle with it! Basic common core code Javascript Monoalphabetic Code Basic common polyalphabetic code Javascript polyalphabetic Code Basic common statistics code Javascript Statistics Code
Code word length