exercism

Exercism solutions.
git clone git://code.dwrz.net/exercism
Log | Files | Refs

README.md (1749B)


      1 # Hamming
      2 
      3 Calculate the Hamming difference between two DNA strands.
      4 
      5 A mutation is simply a mistake that occurs during the creation or
      6 copying of a nucleic acid, in particular DNA. Because nucleic acids are
      7 vital to cellular functions, mutations tend to cause a ripple effect
      8 throughout the cell. Although mutations are technically mistakes, a very
      9 rare mutation may equip the cell with a beneficial attribute. In fact,
     10 the macro effects of evolution are attributable by the accumulated
     11 result of beneficial microscopic mutations over many generations.
     12 
     13 The simplest and most common type of nucleic acid mutation is a point
     14 mutation, which replaces one base with another at a single nucleotide.
     15 
     16 By counting the number of differences between two homologous DNA strands
     17 taken from different genomes with a common ancestor, we get a measure of
     18 the minimum number of point mutations that could have occurred on the
     19 evolutionary path between the two strands.
     20 
     21 This is called the 'Hamming distance'.
     22 
     23 It is found by comparing two DNA strands and counting how many of the
     24 nucleotides are different from their equivalent in the other string.
     25 
     26     GAGCCTACTAACGGGAT
     27     CATCGTAATGACGGCCT
     28     ^ ^ ^  ^ ^    ^^
     29 
     30 The Hamming distance between these two DNA strands is 7.
     31 
     32 # Implementation notes
     33 
     34 The Hamming distance is only defined for sequences of equal length. This means
     35 that based on the definition, each language could deal with getting sequences
     36 of equal length differently.
     37 
     38 ## Source
     39 
     40 The Calculating Point Mutations problem at Rosalind [http://rosalind.info/problems/hamm/](http://rosalind.info/problems/hamm/)
     41 
     42 ## Submitting Incomplete Solutions
     43 
     44 It's possible to submit an incomplete solution so you can see how others have completed the exercise.