I'm working on some cryptography homework and part of it is to do statistical analysis on the ciphered text and based on the letter frequencies of the ciphered text, match them to the proper English letters. So if 'w' is the most frequent letter in the ciphered text, it was likely 'e' in the original text, given that 'e' is the most frequent letter of the English language.
I'm currently matching it in order, such that I sort both lists and match them in the order of their probability. This works for the most frequent letters, but as the list goes on, where some letters have very similar probabilities, this approach fails.
Is there a better approach to this?