
Consider the two strings X = ADBAD and Y = DABDA. We are interested in the cost of the smallest sequence alignment of X and Y and prefixes of these. The gap cost and the penalty matrix M is
| A | B | D | |
|---|---|---|---|
| A | 0 | 3 | 2 |
| B | 3 | 0 | 1 |
| D | 2 | 1 | 0 |
What is the value of the smallest sequence alignment of the two strings X and Y?
2?
What is the value of the smallest sequence alignment of the strings X2 = AD and Y3 = DAB
2?

Compute the Fenwick tree F over the following array A of numbers:


