Voluntary Coding #1

Problem: 3. A simple measure of how complex a sequence is would be the count of the most frequent character n-gram, divided by the count of all n-grams. For example, if n is 3, then the sequence ATATATATAG contains 4x ATA, 3x TAT and 1x TAG. The proportion is thus 4/8=0.5. The higher this number, the more repetitive the sequence.

Write a function simple(s,n) where s is a sequence and n is the length of the n-gram to consider. The function will return the proportion described above.

Continue reading “Voluntary Coding #1”