Name: Anonymous 2011-04-14 6:07
Four snippets of "chromosomes":
A = "gtggcaacgtgc"
B = "gtagcagcgcgc"
C = "gcggcacagggt"
D = "gtgacaacgtgc"
There are two methods to find the "distance" of two chromosomes , how much the two have varied through mutations. One method is to go letter by letter and count the number of discrepancies. Another method is to sum the discrepancies of a's (e.g. chromosome x has 5 a's, chromosome y has 7 a's), c's, g's and t's.
Write a function that uses method 1. It will take two chromosomes, and go letter by letter in
each, comparing them. It then returns the total number of discrepancies it finds.
Write another function that uses method 2. It will take two chromosomes, and return the sum of
'a' discrepancies, 'c' ones, and so on.
Then call each function on each of the combinations (A,B), (A,C), (A,D), (B,C), (B,D) and (C,D) and see which methods tell you which pair of chromosomes is "furthest" (i.e. most varied) and which pair is "closest" (i.e. least varied).Do it in the language of your choice.