Speeding permutation countingby albert (Monk)
|on Jul 18, 2007 at 13:53 UTC||Need Help??|
albert has asked for the wisdom of the Perl Monks concerning the following question:
I have a series of strings (all of equal length) which contain only 0s and 1s, such as:
For each unique pairs of strings, I want to count the number of 00, 01, 10, and 11 as you move each character for the pair. (In the example above, for the first two strings, there are 15 of '00', 0 of '01', 5 of '10', and 10 of '11'.)
Since I want to look at all the pairs amongst 1000s of these strings, speed is of the essence. I am currently doing the following, but appreciate any suggestions on alternative strategies which might be faster.
Since I have many 1000s of these strings to analyze in unique pairs, speed is of importance. (For reference, my real world strings are between 120 and 180 characters in length.) Therefore, does any wise monk have a suggestion on ways I might speed this up. Or, can someone reassure me that I can't do much better than this.
Thanks wise monks,