# hw1 - 20.181.hw1 file/Users/endy/Desktop/hw1.html...

This preview shows pages 1–2. Sign up to view the full content.

20.181.hw1 file:///Users/endy/Desktop/hw1.html Biological Computation 20.181 Homework 1 Review of Recursion. In class we looked at a recursive definition for the factorial function f(n) = n! = n*(n-1)*(n-2)*. ..*1. Write a recrusive function that takes three numbers -- k,first,second -- as input, and returns a list including the first k terms of the Fibonacci series, using the recursive definition F(n+1) = F(n) + F(n-1), and the initial conditions F(1) = first and F(2) = second. Your solution should be of the following form: def fib(k,first,second): #return fibonacci series up to k terms #insert code here Introduction to phylogenies. Consider the following five sequences: 1. AAGGCCCACTA 2. GATGTCCGATA 3. AAGGCCCACTT 4. AATGGCCCCTA 5. GATGTCCGATA Compute all pairwise distances between these sequences in terms of number of mismatched base pairs (hint: sequences 1 and 2 have 5 mismatches, so their distance is 5). The UPGMA algorithm (which stands for unweighted pair group method using arithmetic averages) is

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

hw1 - 20.181.hw1 file/Users/endy/Desktop/hw1.html...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online